Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads
@ 2011-11-25  7:00 bugzilla at busybox.net
  2011-11-25  7:01 ` [Buildroot] [Bug 4538] " bugzilla at busybox.net
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2011-11-25  7:00 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=4538

           Summary: main() not exited normally then using pthreads
           Product: buildroot
           Version: 2011.08
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Other
        AssignedTo: unassigned at buildroot.uclibc.org
        ReportedBy: sunheretic13 at gmail.com
                CC: buildroot at uclibc.org
   Estimated Hours: 0.0


Created attachment 3782
  --> https://bugs.busybox.net/attachment.cgi?id=3782
Source Code demonstrated a bug

Architecture: x86.

When I build system with buildroot-2011.08 with uclibc-0.9.32 (old stable
threads)simple program not working properly.

main function not exited normally. Program not stopped, until I not press
Ctrl-C.

But if I put _exit() at the end of main(), the program exited normally???

Attach: simple program source code.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 4538] main() not exited normally then using pthreads
  2011-11-25  7:00 [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads bugzilla at busybox.net
@ 2011-11-25  7:01 ` bugzilla at busybox.net
  2011-11-25  7:02 ` bugzilla at busybox.net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2011-11-25  7:01 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=4538

--- Comment #1 from Boris Yaroslav <sunheretic13@gmail.com> 2011-11-25 07:01:30 UTC ---
Created attachment 3788
  --> https://bugs.busybox.net/attachment.cgi?id=3788
Buildrootconfig file

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 4538] main() not exited normally then using pthreads
  2011-11-25  7:00 [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads bugzilla at busybox.net
  2011-11-25  7:01 ` [Buildroot] [Bug 4538] " bugzilla at busybox.net
@ 2011-11-25  7:02 ` bugzilla at busybox.net
  2011-11-25  7:03 ` bugzilla at busybox.net
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2011-11-25  7:02 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=4538

--- Comment #2 from Boris Yaroslav <sunheretic13@gmail.com> 2011-11-25 07:02:19 UTC ---
Created attachment 3794
  --> https://bugs.busybox.net/attachment.cgi?id=3794
busybox-1.18.5 config

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 4538] main() not exited normally then using pthreads
  2011-11-25  7:00 [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads bugzilla at busybox.net
  2011-11-25  7:01 ` [Buildroot] [Bug 4538] " bugzilla at busybox.net
  2011-11-25  7:02 ` bugzilla at busybox.net
@ 2011-11-25  7:03 ` bugzilla at busybox.net
  2011-11-25  7:04 ` bugzilla at busybox.net
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2011-11-25  7:03 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=4538

--- Comment #3 from Boris Yaroslav <sunheretic13@gmail.com> 2011-11-25 07:03:08 UTC ---
Created attachment 3800
  --> https://bugs.busybox.net/attachment.cgi?id=3800
uclibc-0.9.32 config

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 4538] main() not exited normally then using pthreads
  2011-11-25  7:00 [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads bugzilla at busybox.net
                   ` (2 preceding siblings ...)
  2011-11-25  7:03 ` bugzilla at busybox.net
@ 2011-11-25  7:04 ` bugzilla at busybox.net
  2013-04-01 23:23 ` bugzilla at busybox.net
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2011-11-25  7:04 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=4538

--- Comment #4 from Boris Yaroslav <sunheretic13@gmail.com> 2011-11-25 07:04:06 UTC ---
Created attachment 3806
  --> https://bugs.busybox.net/attachment.cgi?id=3806
linux kernel config

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 4538] main() not exited normally then using pthreads
  2011-11-25  7:00 [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads bugzilla at busybox.net
                   ` (3 preceding siblings ...)
  2011-11-25  7:04 ` bugzilla at busybox.net
@ 2013-04-01 23:23 ` bugzilla at busybox.net
  2013-04-02 19:36 ` bugzilla at busybox.net
  2013-04-04  6:51 ` bugzilla at busybox.net
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2013-04-01 23:23 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=4538

--- Comment #5 from Michael J. Wang <mjwang@broadcom.com> 2013-04-01 23:24:18 UTC ---
We see this problem as well on the MIPS architecture with uClibc 0.9.32 (old
stable pthreads).

I managed to trace it down a bit more and it seems like the
pthread_onexit_process function is called twice.  The first time it is called,
everything works as designed: main thread sends the REQ_PROCESS_EXIT message to
the manager thread, and the manager thread sends the RESTART signal (32) to the
main thread, and the main thread wakes up from its sigsuspend and collects the
manager.  But from my kernel tracing, I see that the main thread sends the same
REQ_PROCESS_EXIT to the manager thread again and blocks in sigsuspend.  This
time, there is no manager thread to send the restart signal, so the main thread
hangs in sigsuspend and cannot exit.

We do not see this behavior in uClibc 0.9.29, which was the previous version
that we were using.

The simple fix/workaround to this problem is to add the following line in
pthread_onexit_process after waitpid(__pthread_manager_thread.p_pid, NULL,
__WCLONE);

__pthread_manager_request = -1;

But that does not address the root issue of why the pthread_onexit_process
function is called twice.

Michael

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 4538] main() not exited normally then using pthreads
  2011-11-25  7:00 [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads bugzilla at busybox.net
                   ` (4 preceding siblings ...)
  2013-04-01 23:23 ` bugzilla at busybox.net
@ 2013-04-02 19:36 ` bugzilla at busybox.net
  2013-04-04  6:51 ` bugzilla at busybox.net
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2013-04-02 19:36 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=4538

--- Comment #6 from Gustavo Zacarias <gustavo@zacarias.com.ar> 2013-04-02 19:36:49 UTC ---
And may i ask why don't you report this to the uClibc developers instead of
Buildroot ones?

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 4538] main() not exited normally then using pthreads
  2011-11-25  7:00 [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads bugzilla at busybox.net
                   ` (5 preceding siblings ...)
  2013-04-02 19:36 ` bugzilla at busybox.net
@ 2013-04-04  6:51 ` bugzilla at busybox.net
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2013-04-04  6:51 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=4538

Michael J. Wang <mjwang@broadcom.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjwang at broadcom.com,
                   |                            |uclibc-cvs at uclibc.org
          Component|Other                       |Threads
            Version|2011.08                     |0.9.32
         AssignedTo|unassigned at buildroot.uclibc |unassigned at uclibc.org
                   |.org                        |
            Product|buildroot                   |uClibc
   Target Milestone|---                         |0.9.33.2

--- Comment #7 from Michael J. Wang <mjwang@broadcom.com> 2013-04-04 06:52:37 UTC ---
(In reply to comment #6)

Oh, I now see that "product" is set to "BuildRoot" instead of "uClibc".  
Fixing it now and see if that will get the attention of the uClibc developers.

Michael

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-04  6:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-25  7:00 [Buildroot] [Bug 4538] New: main() not exited normally then using pthreads bugzilla at busybox.net
2011-11-25  7:01 ` [Buildroot] [Bug 4538] " bugzilla at busybox.net
2011-11-25  7:02 ` bugzilla at busybox.net
2011-11-25  7:03 ` bugzilla at busybox.net
2011-11-25  7:04 ` bugzilla at busybox.net
2013-04-01 23:23 ` bugzilla at busybox.net
2013-04-02 19:36 ` bugzilla at busybox.net
2013-04-04  6:51 ` bugzilla at busybox.net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox