[SERVER-6817] Continue research on tcmalloc static initialization crash Created: 21/Aug/12 Updated: 06/Dec/22 Resolved: 17/Jun/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Ian Whalen (Inactive) | Assignee: | [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Server Development Platform
|
||||||||||||
| Participants: | |||||||||||||
| Comments |
| Comment by Andrew Morrow (Inactive) [ 17/Jun/20 ] |
|
I'm closing this as gone away. It is an eight year old ticket and I have no evidence that it is still an issue. Major changes to our linking environment have taken place since the era in which this was found. We can always re-open it if needed, but I suspect we would do better with a newer ticket with more details in any case. |
| Comment by Andy Schwerin [ 22/Aug/12 ] |
|
By instruction-stepping the execution of the first call to the ::log() function in the crashing build, I discovered that in this particular version of libc (glibc-2.11.3-17.39.1, SUSE 11), the selection of which log function to use is made during libm's static initialization. On this system, ::log() looks up a global function pointer, g_amd_libm_ep_log, and jumps straight to that. Before libm's static initialization, rather than initialize this field to a safe default, it is initialized to NULL, making it impossible to call log() before libm's static initialization. This is different from resolving the log() function's symbol dynamically at runtime. That part totally works, though the jump trampoline that log() uses looks a lot like the plt jump trampoline, which led to some earlier confusion. This comes up because tc_malloc() is supplied in the mongod binary, causing mongod to depend on libm directly, but libselinux, which calls malloc during its static initialization, does not (and cannot) know of its implicit dependency on libm through the resolved mongod symbol, "tc_malloc". |