Summary
signal handling smashes memory management
Metadata
- Id: f2b3fff8b590354d7d0eb8000a1b6bd60629bf56
- Trac id: 1232
- Type: defect
- Reporter: joergw
- Owner:
- Cc:
- Status: closed
- Component: core libraries
- Estimated difficulty:
- Resolution: fixed
- Priority: critical
- Milestone: 4.11.0
- Version: 4.10.x
- Changetime: 2016-01-14 20:19:39 UTC
- Created: 2015-12-12 14:14:43 UTC
- Keywords: signal handling, runtime
Attachments
- f2b3fff8b590354d7d0eb8000a1b6bd60629bf56/attachments/0008-Allowsignalhandlerstobedispatchedtomultiplethreads.patch
Description
The signal handler stores a references relative (1000 words off) to the stack pointer of in effect during signal handlers invocation.
This may result in an overflow (if the stack pointer happens to be close to the border of the virtual address space.
It does (reproducible) set C_stack_limit to some point within the stack of unrelated pthreads. And, if many signals are dispatched, does overwrite saved_stack_limit.
See also http://lists.nongnu.org/archive/html/chicken-hackers/2015-12/msg00006.html
Patch attached.
Changes and comments
[2015-12-12 14:15:39 UTC] joergw attached 0008-Allowsignalhandlerstobedispatchedtomultiplethreads.patch (description=Patch allowing signal handlers to be dispatched to any pthread)
[2015-12-12 15:01:33 UTC] sjamaan changed milestone from someday to 4.11.0
[2016-01-14 20:19:39 UTC] sjamaan changed status from new to closed
[2016-01-14 20:19:39 UTC] sjamaan set resolution to fixed
[2016-01-14 20:19:39 UTC] sjamaan wrote:
Patch applied as 8294683 (master) and 169cb27 (chicken-5)