ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] Spam & Bugs


From: Judd Storrs
Subject: Re: [RP] Spam & Bugs
Date: Tue Dec 10 06:46:02 2002
User-agent: Mutt/1.3.27i

Dylan Evans <address@hidden> writes:
> Now onto ratpoison, i like it, but it dumps monster cores on freebsd
> 4.3 release when putenv is called unchecked in the spawn function of
> actions.c. The fix is simple, just put a check in like...

Sorry to jump in like this, but I recently became the ratpoison-1.1.1
FreeBSD port maintainer. I also observed the core dumpping, but I
found a different fix for the problem. I diagnosed the problem to be
the setenv in actions.c being inappropriatly included when FreeBSD has
a working setenv. On FreeBSD, when setenv is called it somehow gets
called an infinate number of times and I guess it eventually overflows
the stack. At least that is how I interpreted the gdb of the core...

I eventually decided that the Solaris hack wasn't needed on FreeBSD
and I was going to post my workaround, but coincidentally everyone
else started talking about the idea that

   #if !defined(HAVE_SETENV) || !defined(setenv)

should be

   #if !defined(HAVE_SETENV) && !defined(setenv) 

I wasn't sure what the final decision on the matter was, but CVS is
still ||. On FreeBSD, ./configure does find setenv and HAVE_SETENV is
set in config.h. I don't know why setenv is undefined when RP is
building actions.c on FreeBSD: ratpoision.h includes stdlib.h
already. ChangeLog suggests that:

2002-04-25  Gergely Nagy  <address@hidden>

        * src/actions.c: include <strings.h>
        include setenv implementation if HAVE_SETENV is not set,
        OR setenv is not defined (removes a compiler warning on
        AIX)

But at least on FreeBSD it forces the override of native setenv with
the buggy actions.c version designed for Solaris. So maybe the correct
solution is to just live with a compiler warning on AIX:

   #if !defined(HAVE_SETENV)

--judd

The FreeBSD ratpoison-1.1.1 port currently builds and runs without
core dumping on at least 4.7-RELEASE and 4.7-CURRENT with the
following patch:

*** src/actions.c.orig         Sun Nov  3 12:58:30 2002
--- src/actions.c              Sat Jul  6 17:31:27 2002
***************
*** 2078,2084 ****
    return NULL;
  }
  
! #if !defined(HAVE_SETENV) || !defined(setenv)
  /* For systems, such as Solaris, where setenv is not implemented
   * in libc */
  /* FIXME: overwrite has no effect in this implementation! */
--- 2078,2084 ----
    return NULL;
  }
  
! #if !defined(HAVE_SETENV) && !defined(setenv)
  /* For systems, such as Solaris, where setenv is not implemented
   * in libc */
  /* FIXME: overwrite has no effect in this implementation! */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]