-
-
Notifications
You must be signed in to change notification settings - Fork 268
[druntime-test] memoryerror_stackoverflow.d: Prevent hangs with >=llv… #4969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[druntime-test] memoryerror_stackoverflow.d: Prevent hangs with >=llv… #4969
Conversation
…m-20 Since llvm-20, the stack variables are optimized away leading to an infinite loop. The affected assembly became: ``` Disassembly of section .text._D25memoryerror_stackoverflow1fFKG1024hZv: 0000000000000000 <_D25memoryerror_stackoverflow1fFKG1024hZv>: 0: e9 00 00 00 00 jmp 5 <_D25memoryerror_stackoverflow1fFKG1024hZv+0x5> Disassembly of section .text._D25memoryerror_stackoverflow1gFKG1024hZv: 0000000000000000 <_D25memoryerror_stackoverflow1gFKG1024hZv>: 0: e9 00 00 00 00 jmp 5 <_D25memoryerror_stackoverflow1gFKG1024hZv+0x5> ``` Compared to the llvm-19 optimized version: ``` Disassembly of section .text._D25memoryerror_stackoverflow1fFKG1024hZv: 0000000000000000 <_D25memoryerror_stackoverflow1fFKG1024hZv>: 0: 53 push %rbx 1: 48 81 ec 00 04 00 00 sub $0x400,%rsp 8: 48 89 fe mov %rdi,%rsi b: 48 89 e3 mov %rsp,%rbx e: ba 00 04 00 00 mov $0x400,%edx 13: 48 89 df mov %rbx,%rdi 16: e8 00 00 00 00 call 1b <_D25memoryerror_stackoverflow1fFKG1024hZv+0x1b> 1b: 48 89 df mov %rbx,%rdi 1e: e8 00 00 00 00 call 23 <_D25memoryerror_stackoverflow1fFKG1024hZv+0x23> 23: 48 81 c4 00 04 00 00 add $0x400,%rsp 2a: 5b pop %rbx 2b: c3 ret Disassembly of section .text._D25memoryerror_stackoverflow1gFKG1024hZv: 0000000000000000 <_D25memoryerror_stackoverflow1gFKG1024hZv>: 0: 53 push %rbx 1: 48 81 ec 00 04 00 00 sub $0x400,%rsp 8: 48 89 fe mov %rdi,%rsi b: 48 89 e3 mov %rsp,%rbx e: ba 00 04 00 00 mov $0x400,%edx 13: 48 89 df mov %rbx,%rdi 16: e8 00 00 00 00 call 1b <_D25memoryerror_stackoverflow1gFKG1024hZv+0x1b> 1b: 48 89 df mov %rbx,%rdi 1e: e8 00 00 00 00 call 23 <_D25memoryerror_stackoverflow1gFKG1024hZv+0x23> 23: 48 81 c4 00 04 00 00 add $0x400,%rsp 2a: 5b pop %rbx 2b: c3 ret ``` Signed-off-by: Andrei Horodniceanu <[email protected]>
I'm also fine backporting these upstream but I wanted to get a review from here first |
lgtm |
How come this doesn't show up as a CI problem? |
It's an amazing question that I have no idea how to answer. It wouldn't be the first time CI would work while a real system would fail but this specific issue does seem weird. The release artifacts do optimize the code as expected so it does leave a question mark over how those exact artifacts managed to pass the test. Is it ever possible that the test is not running in CI? This seems like the most plausible explanation |
#4970 for logs on the current situation |
…tions gdc and ldc2 with llvm-20 optimize away the array declarations leading to an infinite cycle. See-Also: ldc-developers/ldc#4969 Signed-off-by: Andrei Horodniceanu <[email protected]>
…tions (#21742) gdc and ldc2 with llvm-20 optimize away the array declarations leading to an infinite cycle. See-Also: ldc-developers/ldc#4969 Signed-off-by: Andrei Horodniceanu <[email protected]>
…tions (dlang/dmd!21742) gdc and ldc2 with llvm-20 optimize away the array declarations leading to an infinite cycle. See-Also: #4969 Signed-off-by: Andrei Horodniceanu <[email protected]>
…m-20
Since llvm-20, the stack variables are optimized away leading to an infinite loop. The affected assembly became:
Compared to the llvm-19 optimized version: