On Fri, Feb 18, 2005 at 02:19:08PM +0100, Roberto Lumbreras wrote:
> Hi Bill...
> 
> Could you please download
> 
> http://rover.debian.net/slirp/slirp_1.0.16-2_i386.deb
> 
> and see if this fixes the problem and tell me the result...

It didn't but I rebuild slirp with debugging symbol and using the core
dump I found that:

src/main.c:616
  if(!isatty(2))
    blnKeepErr = TRUE;
  else {
    if((slirp_tty == NULL && strcmp(ttyname(0), ttyname(2)) == 0) ||
       (slirp_tty != NULL && strcmp(ttyname(2), slirp_tty) == 0) )
        blnKeepErr = FALSE;
    else
        blnKeepErr = TRUE;
    }

ttyname(0) return NULL, so slirp segfault.

It is not clear at all what that piece of code do (and the companion
below with strcmp(ttyname(0), ttyname(1)), but certainly it should
check isatty(0) before calling ttyname(0). The one-line patch below just
do that

Note that the fix assume you add -fno-strict-aliasing to CFLAGS.
Without -fno-strict-aliasing, the patch does not fix the problem.

Cheers,
-- 
Bill. <[EMAIL PROTECTED]>

Imagine a large red swirl here. 

--- slirp-1.0.16/src/main.c     2005-02-23 01:03:09.000000000 +0100
+++ slirp-1.0.16.new/src/main.c 2005-02-23 01:16:22.000000000 +0100
@@ -604,6 +604,7 @@
      Mainly for testing purposes, nice to be able to do fprintf(stderr...
   */

+  if (isatty(0))
   {
   int blnKeepErr, blnKeepStdOut;





-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to