-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Simple hello world program crashes when linked to hoard #51
Comments
|
Hi Emery,
thanks for fixing the issue so quickly! I have tried the new version; my small test program works now. However I still have problems integrating Hoard into our production code, it crashes during loading the hoard dll when calling the "_onexit" function (it registers a routine to be called at exit time) from inside the "utility.cpp" file in the VC runtime. I'm going to ask some colleagues, maybe someone has an idea.
Using the debugger that way was quite simple: first make sure you compile with /DEBUG:FULL to get a pdb file. Then just start the debugger and choose File / Open / Project/Solution. There, pick the compiled .exe file (the test program). Agree to save the solution somewhere. Then simply use Debug / Start Debugging; this runs the exe file with debugger attached.
Best regards,
Hagen
Gesendet: Donnerstag, 24. Januar 2019 um 17:54 Uhr
Von: "Emery Berger" <[email protected]>
An: emeryberger/Hoard <[email protected]>
Cc: hgaedke <[email protected]>, Author <[email protected]>
Betreff: Re: [emeryberger/Hoard] Simple hello world program crashes when linked to hoard (#51)
Thanks for the bug report and full repro source code. Immensely helpful.
I'd love to know what you did to get into the debugger in this way. Feel free to send me mail directly.
I have AFAICT fixed the issue with cc8bf6c. It appears to be heap corruption caused by mixing the CRT heap and the Hoard heap; in previous versions, this just worked, but something has probably changed with a recent update. I just gave this a preliminary test (with your test case as well as some other code), and it seems to work. Please check it out.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi Emery,
it seems that there is still a heap problem. The crash I get when starting my program is a heap corruption occurring via urctbase.dll => ntdll.dll, this sounds as there is still something wrong related to mixture of heaps as you wrote.
Unfortunately I am not able to send you a reproducer this time, as this occurs only when I try to integrate Hoard into our production code, and not with my small example.
Best regards,
Hagen
Gesendet: Donnerstag, 24. Januar 2019 um 17:54 Uhr
Von: "Emery Berger" <[email protected]>
An: emeryberger/Hoard <[email protected]>
Cc: hgaedke <[email protected]>, Author <[email protected]>
Betreff: Re: [emeryberger/Hoard] Simple hello world program crashes when linked to hoard (#51)
Thanks for the bug report and full repro source code. Immensely helpful.
I'd love to know what you did to get into the debugger in this way. Feel free to send me mail directly.
I have AFAICT fixed the issue with cc8bf6c. It appears to be heap corruption caused by mixing the CRT heap and the Hoard heap; in previous versions, this just worked, but something has probably changed with a recent update. I just gave this a preliminary test (with your test case as well as some other code), and it seems to work. Please check it out.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Is this only in |
Hi Emery, I have a VS 2017 solution for a similar issue. Thanks! |
There seem to be multiple issues here. For one, x86jump.h incorrectly assumes that 32-bit jumps will work within 4 GB on both sides of the jump, however since jump offsets are signed 32-bit values, this should be 2 GB max (0x7FFFFFFF, not 0xFFFFFFFF). Also, it seems some Windows-internal components will have their own internal In addition to all that, |
Great investigative work! Much appreciated. I can work on this soon but I would also gladly accept a PR :). |
I tried fixing the rabbit hole of internal UCRT calls directly, but given that some internal For the time being our application just overrides |
Hi, Any news on the issue? I have a software that is running fine on Windows 2016, but crashes with the ucrtbase.dll immediately on Windows 2019. Currently I'm able to run it with the 2013 horde version, but I'd like to upgrade to the latest version. Thanks |
Hi,
I have compiled Hoard according to the instructions under Windows 10 with Compiler "Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24218.1 for x64".
I have then created a new dir containing
I am attaching the text files as "hg_test.zip" to this post:
hg_test.zip
I have then called "make" which creates "hello.exe", with this output on the console:
``
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24218.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
hello.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xlocale(341): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\exception(359): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc
uselibhoard.cpp
Generating Code...
Microsoft (R) Incremental Linker Version 14.00.24218.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:hello.exe
hello.obj
uselibhoard.obj
libhoard.lib
``
(OK - I have specified /EHsc in addition to get rid of those warnings, but this is irrelevant here as the crash still happens then.)
When I now execute "hello.exe", a popup window appears: "Appication Error - The application was unable to start correctly (0xc0000142). Click OK to close the application."
What am I doing wrong?
Best regards,
Hagen
The text was updated successfully, but these errors were encountered: