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

Re: exit(1) pb



Regarding my problem of exit(1) not causing a program to exit, here's 
some further information:

The following code fragment from src/chat.c in the 2001-06-26 release of
Portslave seems critical to the exit(1) problem I am having.  The "return
0" statement on line 380 of the file seems to change things somehow.  If
I comment it out then exit(1) will work, if I leave it in then it won't
work.  In this case *expect != 0 so the return 0 code is not being
 called!

                /* Empty expects always succeed. */
                if (*expect == 0) {
                        nsyslog (LOG_DEBUG, "chat_expect - got it");
                        free(s);
                        return 0;
                }

Here's the difference that this makes to the assembly code that is
produced:

--- chat.s.works        Tue Jun 26 19:31:48 2001
+++ chat.s      Tue Jun 26 19:32:38 2001
@@ -1012,7 +1012,8 @@
        addl $-12,%esp
        pushl %esi
        call free@PLT
-       addl $32,%esp
+       xorl %eax,%eax
+       jmp .L502
        .p2align 4,,7
 .L423:
        addl $-12,%esp

So why does this change anything?


Also here is the output of "px xl":
004     0  4535 25364   9   0     0    0 tty_wa SW   ?          0:00 
[portslave]

So I guess it's blocked on tty_wait_until_sent.  I don't know why it's 
status is "SW", it looks like some type of Zombie (it goes SW status 
after the exit() system call).


I have had this problem on kernels 2.2.19 and 2.4.5.

-- 
http://www.coker.com.au/bonnie++/     Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/       Postal SMTP/POP benchmark
http://www.coker.com.au/projects.html Projects I am working on
http://www.coker.com.au/~russell/     My home page



Reply to: