Opened 10 years ago

Closed 10 years ago

#4949 closed bug (fixed)

Beam threads crash on exit in some pthread cleanup methods

Reported by: stippi Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Network Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

It looks like this has been caused by making every thread convertible into a pthread recently.

[Switching to team /boot/apps/beam-1.2alpha-haiku/Beam (802) thread Mail_2098166 (998)]
0x0052c0b8 in __res_nclose () from /boot/system/lib/gcc2/libnetwork.so
(gdb) bt
#0  0x0052c0b8 in __res_nclose () from /boot/system/lib/gcc2/libnetwork.so
#1  0x0052c164 in __res_ndestroy () from /boot/system/lib/gcc2/libnetwork.so
#2  0x00512a2b in __net_data_destroy ()
   from /boot/system/lib/gcc2/libnetwork.so
#3  0x00aac115 in __pthread_key_call_destructors ()
   from /boot/system/lib/gcc2/libroot.so
#4  0x00aab4c9 in __pthread_destroy_thread ()
   from /boot/system/lib/gcc2/libroot.so
#5  0x00a991a0 in _thread_do_exit_notification ()
   from /boot/system/lib/gcc2/libroot.so
#6  0x00a99135 in thread_entry () from /boot/system/lib/gcc2/libroot.so
#7  0x702c9fec in ?? ()
(gdb)

The crash is a segment violation. I am running hrev34023.

Change History (5)

comment:1 Changed 10 years ago by axeld

Component: - GeneralKits/Network Kit
Version: R1/alpha1R1/Development

Can you try to replace malloc with malloc_debug? It crashes in a libbind destructor function.

comment:2 Changed 10 years ago by stippi

I downgraded to hrev33966, too many issues with the bleeding edge. :-) I did see Firefox threads crash with a very similar stack trace, if that helps. Are the global destructors keyed to pthread exit hooks even supposed to be called for regular threads? Maybe something is deleted twice now because of this?

comment:3 Changed 10 years ago by axeld

Besides the crash, it's supposed to work like this. And I'm running the "bleeding edge", too, without any such issues.

comment:4 Changed 10 years ago by stippi

I guess I can try to upgrade and report my findings with malloc_debug. (Is the shell tab completion working again in trunk?) I find it strange that both Beam and Firefox start crashing for me like this after that change and work 100% reliable on hrev33966. Are you sure you don't have any uncommitted changes? ;-)

comment:5 Changed 10 years ago by stippi

Resolution: fixed
Status: newclosed

Fixed in hrev34161.

Note: See TracTickets for help on using tickets.