Bug 243963 - [libpas] FreeBSD displays a lot of warning when thread exits
Summary: [libpas] FreeBSD displays a lot of warning when thread exits
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-08-15 16:59 PDT by Basuke Suzuki
Modified: 2022-08-22 17:00 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Basuke Suzuki 2022-08-15 16:59:51 PDT
> Thread 8807027e0 has exited with leftover thread-specific data after 4 destructor iterations
Comment 1 Basuke Suzuki 2022-08-15 17:08:00 PDT
The reason might be here:

https://github.com/WebKit/WebKit/blob/main/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c#L137-L145

It calls thread_setspecific from destructor to mark the thread has been exited already. Then FreeBSD's _thread_cleanupspecific reports error here:

https://github.com/freebsd/freebsd-src/blob/373ffc62c158e52cde86a5b934ab4a51307f9f2e/lib/libthr/thread/thr_spec.c#L163-L167

Are there any other way to set the flag to tell the thread is exiting ?
Comment 2 Basuke Suzuki 2022-08-15 17:09:00 PDT
Apple platforms have `pthread_self_is_exiting_np()` to detect this situation.
Comment 3 Radar WebKit Bug Importer 2022-08-22 17:00:19 PDT
<rdar://problem/99006058>