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

Windows 64 bits (Visual Studio): "foreign" C++ exceptions unwinding through LLVM cause a crash #12922

Closed
llvmbot opened this issue Apr 13, 2012 · 3 comments
Labels
backend:X86 bugzilla Issues migrated from bugzilla duplicate Resolved as duplicate

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 13, 2012

Bugzilla Link 12550
Resolution DUPLICATE
Resolved on Oct 21, 2015 15:28
Version trunk
OS Windows NT
Attachments Repro program
Reporter LLVM Bugzilla Contributor
CC @asl,@rnk

Extended Description

We are currently porting our application to Windows 64 bits (amd64), and we are getting regressions from 32 bits relatively to LLVM 3.0's ability to get traversed by "foreign" Visual Studio C++ exceptions. That is, there is a crash when C++ exceptions which are thrown from Visual Studio code, are unwinding through LLVM code before being eventually catch by other Visual Studio code.

Note: I am not sure if this is specific to Visual Studio.

I was able to repro the issue simply by modifying the Fibonacci example to call an external C++ function which throws an exception, much like in ExceptionsDemo.cpp: works on 32 bits but not on 64 bits Visual Studio. The crash happens within Windows' _cxxThrowException routine.

Attached is the file containing the "repro" executable (to be compiled with the same settings as the Fibonacci example). The program does a recursive call of depth "N", with "N" being passed as an arg (like in the Fibonacci example). Here it crashes even with N=0, on 64 bits.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 15, 2012

Clang has not supported Win64 EH yet.
LLVM might support it, but it is not activated IIRC.

We are currently porting our application to Windows 64 bits (amd64), and we are
getting regressions from 32 bits relatively to LLVM 3.0's ability to get
traversed by "foreign" Visual Studio C++ exceptions. That is, there is a crash
when C++ exceptions which are thrown from Visual Studio code, are unwinding
through LLVM code before being eventually catch by other Visual Studio code.

I don't imagine i686-msvc-llvm could handle MS EH.

@rnk
Copy link
Collaborator

rnk commented Oct 21, 2015

The issue is that JITs need to register xdata with the OS on win64. LLVM's JIT has never had this ability. llvm/llvm-bugzilla-archive#24233 has a better description of the work that needs to be done, so I'm duping against it.

We already know what xdata to generate because we can compile normal C++ code ahead of time and MSVC exceptions can unwind through our code just fine.

*** This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#24233 ***

@rnk
Copy link
Collaborator

rnk commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#24233

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 bugzilla Issues migrated from bugzilla duplicate Resolved as duplicate
Projects
None yet
Development

No branches or pull requests

2 participants