Bug 15228 - Crashes on wrapper exit
Summary: Crashes on wrapper exit
Status: NEW
Alias: None
Product: cwrap
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-08 00:49 UTC by Samuel Thibault
Modified: 2022-11-10 18:42 UTC (History)
0 users

See Also:


Attachments
proposed fix (573 bytes, text/plain)
2022-11-08 00:49 UTC, Samuel Thibault
no flags Details
proposed fix (for socket_wrapper) (790 bytes, patch)
2022-11-08 00:49 UTC, Samuel Thibault
no flags Details
proposed fix (for nss_wrapper) (1.00 KB, patch)
2022-11-08 00:49 UTC, Samuel Thibault
no flags Details
proposed fix (for priv_wrapper) (621 bytes, patch)
2022-11-08 00:49 UTC, Samuel Thibault
no flags Details
proposed fix (for uid_wrapper) (573 bytes, patch)
2022-11-08 00:50 UTC, Samuel Thibault
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Thibault 2022-11-08 00:49:05 UTC
Created attachment 17632 [details]
proposed fix

Hello,

When exiting various wrappers, the process crashes on the dlclose call. Indeed, when libc.so etc. are not found through an explicit name, RTLD_NEXT is used, but then at exit a dlclose attempt will be made, thus on RTLD_NEXT, which brings mayhem in the process.

The attached patches fix it.

Samuel
Comment 1 Samuel Thibault 2022-11-08 00:49:26 UTC
Created attachment 17633 [details]
proposed fix (for socket_wrapper)
Comment 2 Samuel Thibault 2022-11-08 00:49:41 UTC
Created attachment 17634 [details]
proposed fix (for nss_wrapper)
Comment 3 Samuel Thibault 2022-11-08 00:49:57 UTC
Created attachment 17635 [details]
proposed fix (for priv_wrapper)
Comment 4 Samuel Thibault 2022-11-08 00:50:23 UTC
Created attachment 17636 [details]
proposed fix (for uid_wrapper)
Comment 5 Andreas Schneider 2022-11-10 11:01:12 UTC
Could you please open MRs at

https://gitlab.com/cwrap/

for each of those wrappers?