Bug 618743
Summary: | [RHEL6] malloc's error path deadlocks | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Adam Jackson <ajax> |
Component: | glibc | Assignee: | Andreas Schwab <schwab> |
Status: | CLOSED DUPLICATE | QA Contact: | qe-baseos-tools-bugs |
Severity: | urgent | Docs Contact: | |
Priority: | urgent | ||
Version: | 6.1 | CC: | cmeadors, dgregor, drepper, ebachalo, fweimer, gholms, jakub, jburke, jkurik, jwest, mgordon, moshiro, myamazak |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 618356 | Environment: | |
Last Closed: | 2011-06-03 13:45:03 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 658636 |
Description
Adam Jackson
2010-07-27 15:57:02 UTC
The backtrace above shows malloc calling __libc_message(abort=1) which calls malloc. This deadlocks. That's awful. Hung processes are worse than crashed processes. Either this needs to use some statically allocated bit of memory in .bss, or use sbrk() and just cope with leaking if the app is insane enough to trap SIGABRT and try to carry on. Reassigning back to glibc. I didn't change component for nothing. This has nothing to do with catching SIGABRT but with having the abort message visible in coredumps. (In reply to comment #4) > This has nothing to do with catching SIGABRT but with having the abort message > visible in coredumps. If the app catches SIGABRT, it may continue instead of exiting. If it does, and then the abort is raised _again_, we try to free() the old message. That's what I meant by "use sbrk() and just leak"; we could allocate the storage for the crash message with sbrk(), but we'd have no way of freeing it. We could call into some internal bit of malloc that assumes the lock has already been taken, but that's dangerous, we're already at this point _because_ malloc's bookkeeping is corrupted. We could use alloca, but then you'd get no record of the crash if the app does catch SIGABRT. We could use mmap, but then you'd leak maps instead of leaking heap. Or we could use a static buffer in .bss, but then that's additional data space in every process. But really, at this point in a process' death throes, who cares. Allocate with sbrk because it's easy. Anyone trying to survive from a SIGABRT is already in a state of sin. *** Bug 664365 has been marked as a duplicate of this bug. *** Moving to RHEL 6.2 release, as no fix is upstream yet. This will need to be fixed upstream before it is considered for a RHEL release. *** This bug has been marked as a duplicate of bug 676591 *** |