Bug 19054 – alloca() crashes with SEGFAULT after an exception

Status
NEW
Severity
major
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-07-04T07:23:26Z
Last change time
2024-12-07T13:38:28Z
Keywords
industry
Assigned to
No Owner
Creator
Tomer Filiba (weka)
Moved to GitHub: dmd#17169 →

Comments

Comment #0 by tomer — 2018-07-04T07:23:26Z
it seems RCX is corrupt after the exception (which has finished handling and all), which AFAICT should hold the size of the temp stack size ``` import core.stdc.stdlib: alloca; void main() { void* p1 = alloca(10); writeln(p1); try { throw new Exception("foo"); } catch (Exception ex) { writeln(ex.msg); } void* p2 = alloca(10); // <<< SEGFAULT on 0x7ffffffff000 //rax 0x7fffffffd7b0 140737488345008 //rbx 0x3 3 //rcx 0x1ffffffffffffcf8 2305843009213693176 //rdx 0x7fffffffd870 140737488345200 //rsi 0x7ffffffff000 140737488351232 //rdi 0x7fffffffeff0 140737488351216 //rbp 0x7fffffffd900 0x7fffffffd900 //rsp 0x7fffffffd848 0x7fffffffd848 writeln(p2); } ```
Comment #1 by tomer — 2018-07-04T07:25:04Z
DMD64 D Compiler v2.080.0
Comment #2 by tomer — 2018-07-04T07:27:19Z
Comment #3 by robert.schadek — 2024-12-07T13:38:28Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17169 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB