Bug 835908 - race condition in aterm causing double exit when SIGCHLD
race condition in aterm causing double exit when SIGCHLD
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: aterm (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Andreas Bierfert
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-27 09:51 EDT by Philippe Vouters
Modified: 2015-02-18 08:44 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-18 08:44:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
updated aterm source code compressed archive (291.86 KB, application/octet-stream)
2013-08-31 10:18 EDT, Philippe Vouters
no flags Details

  None (edit)
Description Philippe Vouters 2012-06-27 09:51:40 EDT
Description of problem:
The aterm --loginShell window may not disappear at bash exit time

Version-Release number of selected component (if applicable):
aterm-1.0.1-12.fc17.i686

How reproducible:
Often but not always (race condition). Note that I run a Dual Core processor

Steps to Reproduce:
1. Create several `aterm --loginShell'
2. type exit
3.
  
Actual results:
With ~/.bash_logout containing clear, a black aterm window.

Expected results:
Window disappears

Additional info:
gdb /usr/bin/aterm 14455
(gdb) where
#0  0xb7718424 in __kernel_vsyscall ()
#1  0x42e8bcc2 in __lll_lock_wait_private () from /lib/libc.so.6
#2  0x42e05123 in _L_lock_4112 () from /lib/libc.so.6
#3  0x42dffeb9 in _int_free () from /lib/libc.so.6
#4  0xb74c8279 in ?? () from /usr/lib/dri/nouveau_vieux_dri.so
#5  0xb74c825b in ?? () from /usr/lib/dri/nouveau_vieux_dri.so
#6  0xb74c861e in ?? () from /usr/lib/dri/nouveau_vieux_dri.so
#7  0x42dbdd01 in __run_exit_handlers () from /lib/libc.so.6
#8  0x42dbdd8d in exit () from /lib/libc.so.6
#9  0x0804e91d in Child_signal ()
#10 <signal handler called>
#11 0x42dffd3a in _int_free () from /lib/libc.so.6
#12 0x08056dcf in scr_release ()
#13 0x0804eaea in clean_exit ()
#14 0x42dbdd01 in __run_exit_handlers () from /lib/libc.so.6
#15 0x42dbdd8d in exit () from /lib/libc.so.6
#16 0x080521da in cmd_getc ()
#17 0x08052ac5 in main_loop ()
#18 0x0804e642 in main ()
(gdb) info thread
  Id   Target Id         Frame 
* 1    Thread 0xb76d4780 (LWP 14455) "aterm" 0xb7718424 in __kernel_vsyscall ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 14455] will be detached.

Quit anyway? (y or n) y
Detaching from program: /usr/bin/aterm, process 14455
[root@victor ~]# 
[root@victor ~]# kill -TERM 14455

This should be this double exit() in aterm which should cause the problem all depending upon when SIGCHLD is delivered and handled.
Comment 1 Philippe Vouters 2012-06-27 10:43:17 EDT
A way to reproduce the problem systemicatically is to run:
$ aterm -tn rxvt -e bash -l

I have downloaded the aterm source code. I shall debug it and let you know.

Yours truly,
Philippe Vouters
Comment 2 Philippe Vouters 2012-07-11 10:45:18 EDT
This seems to cure the problem:

# cd /root/rpmbuild/BUILD/aterm-1.0.1/
# vi src/command.c

            for (count = BUFSIZ; count; count -= n, cmdbuf_endp += n)
                if ((n = read(cmd_fd, cmdbuf_endp, count)) > 0)
                    continue;
                else if (n == 0 || (n < 0 && errno == EAGAIN))
                    break;
                else {
++++ line 2180 +++> signal(SIGCHLD,SIG_IGN);
#if !defined(HAVE_ATEXIT) && !defined(__sun__)
                    clean_exit();
#endif
                    exit(EXIT_SUCCESS);
                }
        /* some characters read in */
            if (count != BUFSIZ)
                goto Return_Char;
        }
Comment 3 Andreas Bierfert 2012-07-12 07:21:45 EDT
Thanks for the in-depth look.
Comment 4 Philippe Vouters 2012-09-04 13:37:38 EDT
I run again aterm as my preferred terminal with this described change. I never so far suffered again from such a problem. aterm on my computer now seems to run perfectly.

The #if 0 added by someone else as quick fix hack along with now the dead code to get a correct compilation may be suppressed leading to a more updated and simplified aterm source code.

If aterm with this code addition and suppressions is resubmitted to http://sourceforge.net/projects/aterm/files/, this means everyone looking after aterm sources will benefit from the updates, This may be for running aterm under any Unix or Unix-like operating systems. Some good willing person may well use this code update to give aterm a second life. As Red Hat and Opensource are so intimataly bound, Red Hat is the in best position to perform this proposal.

When everything will correctly be performed, this problem report with aterm may be definitely closed.
Comment 5 Fedora End Of Life 2013-07-04 01:37:39 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 6 Fedora End Of Life 2013-08-01 12:50:54 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 7 Paul Wouters 2013-08-16 16:40:38 EDT
This issue is still not fixed.
Comment 8 Philippe Vouters 2013-08-31 10:18:07 EDT
Created attachment 792422 [details]
updated aterm source code compressed archive

Fedora 19 upgraded aterm.

Contains fixes and as most as possible a clean build for ./configure.

Only failed on assert(str != NULL) getting into error when compiled with -Werror gcc switch. Cause : Linux assert.h prototypes and/or macros not correct.
Comment 9 Philippe Vouters 2013-08-31 12:50:34 EDT
Downloadable:
http://vouters.dyndns.org/zip/aterm-1.0.2-1.fc19.i386.rpm
http://vouters.dyndns.org/zip/aterm-1.0.2-1.fc19.src.rpm
http://vouters.dyndns.org/zip/aterm-1.0.2.tar.bz2

Changes:
1/ Fix to SIGCHLD signal handling before aterm's exit
2/ Code cleanups (no more #if 0 in source codes)
3/ Clean builds under both $ ./configure and $ rpmbuild -ba /path/to/aterm.spec

You may close this Bugzilla report. Many thanks to Red Hat for his active participation.
Comment 10 Fedora End Of Life 2015-01-09 16:59:18 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 11 Fedora End Of Life 2015-02-18 08:44:33 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.