Skip to content
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

Bad call stack with scope(success) #19639

Open
dlangBugzillaToGithub opened this issue Nov 10, 2019 · 0 comments
Open

Bad call stack with scope(success) #19639

dlangBugzillaToGithub opened this issue Nov 10, 2019 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

GoaLitiuM (@GoaLitiuM) reported this on 2019-11-10T22:23:51Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=20382

Description

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant