Open jaikiran opened 1 year ago
Any thoughts on this one? If this isn't the right place to report this, would anyone have any inputs on where to report this?
Hello @Endilll, do you think this issue is something that's relevant for this project? I was unsure when I opened it. If this is not relevant here, then I'll go ahead and close it.
I'm not an expert on the topics your report is concerned with, but it doesn't strike me as irrelevant for us. But it would be nice if you can reproduce this with trunk or latest release of upstream Clang, since your report is referencing AppleClang 14.
I'm not sure if this is the right place to report this, but looking at the Clang and LLVM website, I thought of raising it here.
Consider the following trivial code, which intentionally is written to generate a segmentation fault when the program is run. Line number 26 is where it intentionally writes to a uninitialized reference to trigger the crash. The program is compiled with
-g
flag with source level debug information enabled.Compiled as follows:
Then run as:
When this is run on macOS M1 system the program crashes and generates a crash report which contains the backtrace. The backtrace is what looks odd:
Notice the stack frame numbered
1
in that backtrace. I don't understand why that is listed in the backtrace. That line 23 represents a call to methodb()
from which the code flow has returned back and then moved to line 26 in methoda()
, which is where the crash occurs. So why is there that extra stack frame in the backtrace? The macOS M1 version andcc
version is as follows:Just to be sure that I am not missing something obvious, I ran this same code on a Linux system (of course recompiling there first) and the backtrace I get there is what I would expect:
Linux and
cc
version where it works as expected is: