Bug 20382 – Bad call stack with scope(success)

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2019-11-10T22:23:51Z
Last change time
2024-12-13T19:06:08Z
Assigned to
No Owner
Creator
GoaLitiuM
Moved to GitHub: dmd#19639 →

Comments

Comment #0 by goalitium — 2019-11-10T22:23:51Z
import std.stdio; void throws() { throw new Exception("hello world"); // should break here } void main() { scope(success) writeln("hi"); throws(); // breaks here instead } This following program when built with debug symbols (-g -m64) and debugged with VC++ debugger, does not correctly break at the exception, but instead in the main function where throws is called. Possibly related to issue 15190. Another issue with this code but without the scope(success) block, the debugger breaks in the object.Exception's constructor, which is also wrong, it should break at the line where throw is issued. Regressed in 2.086.0/1. stack trace: object.Exception@source\app.d(5): throws ---------------- 0x00007FF64D20DCBC in app.throws at C:\D\dmd2\windows\bin\..\..\src\druntime\import\object.d(1975) 0x00007FF64D20DD00 in D main at C:\Users\GoaLitiuM\AppData\Local\Temp\New folder (6)\test\source\app.d(12) 0x00007FF64D2157B3 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll().__lambda1() 0x00007FF64D2155EC in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate()) 0x00007FF64D2156EB in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() 0x00007FF64D2155EC in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate()) 0x00007FF64D21543D in d_run_main2 0x00007FF64D20F8D0 in d_run_main 0x00007FF64D20DDB2 in app._d_cmain!().main at C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\internal\entrypoint.d(34) 0x00007FF64D273A9C in __scrt_common_main_seh at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288) 0x00007FF9278C7BD4 in BaseThreadInitThunk 0x00007FF92810CED1 in RtlUserThreadStart
Comment #1 by robert.schadek — 2024-12-13T19:06:08Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19639 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB