-
Notifications
You must be signed in to change notification settings - Fork 509
Debug Assertion Violation Expression: 'm_pHackPInvokeTunnel != NULL' #2851
Comments
@imkow Do you have a stack trace? |
didn't notice there is stack trace? how can I get stack trace out? |
Run the compiled app under a debugger and let the debugger generate the stack. (E.g. open the native EXE as a solution in Visual Studio and hit F5.) |
@MichalStrehovsky
|
Ah, okay - the code is taking a GC. CppCodegen-generated code currently can't survive a GC (we track this in #2033). You could work around this by setting a higher Gen0 budget (the issue I'm linking to points to the code where you can do that), but eventually you'll hit limits. I'm going to close this as a duplicate. |
@MichalStrehovsky how to set a higher Gen0 budget? in C# or generated C++? |
From #2033:
Edit gcenv.h the link is pointing to and rebuild the repo. GetGCgen0size is currently 100 MB. |
@MichalStrehovsky use the class EEConfig? |
haha, almost simultaneously, I found the trick |
@MichalStrehovsky just tried with code like this: g_pConfig->SetGCgen0size(1000 * 1024 * 1024); |
You'll need to step through the GC setup in the debugger (step through the places that use the value). The GC will ignore Gen0 sizes once it crosses a threshold that the GC can no longer tolerate (I don't know the places, but I've seen them a year ago when I was playing with this). The code might also just be allocating too much. There's not much complex managed code that can run without a GC. |
I had even tried 10000 * 1024 * 1024, same problem |
Try // Generation 0 must never be more than 1/2 the segment size.
if (gen0size >= (seg_size / 2))
gen0size = seg_size / 2; That kicks in in |
this pops up when running from compiled exe which is compiled from generated CPP
File: {corert}\src\Native\Runtime\thread.cpp
The text was updated successfully, but these errors were encountered: