-
Notifications
You must be signed in to change notification settings - Fork 263
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
php.exe crashes under Windows 10 #1854
Comments
Please clarify: the title says "program being debugged", and the message "Exception thrown at 0x73838FE1 in php.exe" does not look like a message printed by Dr. Memory. It looks like an expected and handled access violation fault from Dr. Memory's callstack walk or something (drmemorylib is often loaded at 0x73..., and a fault there will either be handled or will be reported as an internal tool crash: it will not be forwarded to the app). Are you sure that's a fatal fault? Please clarify precisely what happens when run outside a debugger. |
@derekbruening thanks for the quick response. The program, that popups in the VS debugger is php.exe, not DR. Memory. The exception text descends to VS, not do Dr. Memory. Please note that the binaries i've linked are debug builds that include debug symbols. When I run just as it, even with application verifier enabled, it finishes with zero exit status. Also, when i run it on server 2012 with the same DrMemory release bins, it shows no issue. So it seems to be solely win10 and the mentioned DrMemory release bins. If the binary being debugged were potentially crashing, from what were known for valgrind - it would just report an invalid "something" and exit normally. Or, if Dr. Memory would crash itself, i'd not expect debugger showing the program being debugged. So a bit lost about what happens :) At least debugger should show some correct BT and the program, and this seems to not to happen in this constellation. Please give a tip what could I do to clarify the situation on my side. Thanks. |
If you are on win10 TH2 1511 (a major update which should really be called Windows 11), the 1.9.0-4 release does not work there. Xref #1826. Please try a post-fix build such as https://build.chromium.org/p/client.drmemory/builds/DrMemory-Windows-1.9.16822-0x6d06080-sfx.exe The confusion stems from the title "program being debugged" -- that sounds like the problem only occurs when you run Dr. Memory on your target application inside a debugger such as windbg or the VS debugger. Is that not the case? |
Yeah, that's 1511 (os build 10586.63) ... With the build you've linked this is the output i've got
So this seems way better than 1.9.0-4, despite it doesn't show the backtraces. But at least no crash and so. With 1.9.0-4 - nope, I wasn't running drmemory in a debugger, just normally in a console like Thanks. |
What i have to add is that php.exe with the provided test case under that win10 version doesn't crash, when no Dr. Memory is used. Also things like Application Verifier don't show anything. Thanks. |
So the only problem left is the series of complaints (in the form of error reports) about the code at 0x08920000? Can you identify whose code that is from the addresses involved there in the call, etc.? It's some kind of generated code related to hooks, perhaps? |
Huh, today I run the same command with the same binaries, and have clean output.
Cannot explain why. The same binaries both Dr. Memory and PHP (both binary and script), what only changed is that i closed my laptop's lid yesterday and opened it today :) Any suggestion to check what happened? Maybe things like some reboot, suspend, etc. could affect the way it works? With your question about dynamic code - the only place in PHP with creation of dynamic code is usage of JIT in the PCRE library. But in this particular run it is not involved. It's probably hard to catch what is exactly on that address because of ASLR. At least today, when i check the running binary, VMMap shows that there's no region in the heap occupied where 0x08920000 could belong to. Thanks. |
It may be third-party invasive software using generated code as part of its hooks of Windows API routines (common for security software or malware or even some mouse software, etc.). We log the libraries loaded. Look for "module load event" in E:\local_programs\DrMemory-Windows-1.9.16822-0x6d06080\drmemory\logs\DrMemory-php.exe.15552.000\global.15552.log. In general, when reproducing, you would run with "-pause_at_error" and then use Process Explorer or a debugger to examine the libraries and what the code at those "UNADDRESSABLE ACCESS: executing ..." addresses is doing and who it belongs to. The fact that Dr. Memory thinks it is unaddressable memory could mean that it is allocated from another process (hence the hook theory, but usually these hooks are put in early enough that we consider their memory legitimate), that it's a bug where it's freed memory or beyond the top of a stack, or possibly that it's legitimate and a bug in Dr. Memory's memory tracking (maybe some new Windows 10 behavior we missed), so we are curious to find out more about it. |
Hi, today it's reproducable again. Here is the stack the process explorer shows when paused on error:
PHP is loaded at 0x8c000. But i currently cannot find the way to view all the addresses through procexp. Procexp seems only to allows to see the start addresses and addresses from the stack, but not the full view ;( Unfortunately i stick at this point. However, as you've pointed me to the global log, i've looked inside. There is something attracting attention
I usually work in Conemu. Now, where it points to PHP, it's a place where a setjmp call gets prepared. Now, it looks like a mix of any possible errors :) Well, setjmp itself is used in PHP quite often, but it actually never crash (or only in very bad cases). It's unlikely there were something to report about it. But the presense of Conemu in the BT looks very suspicious to me, could it be that it injects something into a process? Now i repeated the same test about 10 times using pure cmd and there are only clean runs. I'll continue observing this next days. Thanks. |
Conemu doing its own business with the io and console, I would suggest to It could be a conemu bug as well but we will need to investigate that later
|
ConEmu is relatively invasive: it injects a library into all processes you run in its shell and inserts many hooks. Xref DynamoRIO/dynamorio#1597. I'm curious about how the unaddressable memory was allocated as I haven't seen those errors in prior ConEmu testing. In any case, I'm going to close this issue and if the unaddrs show up again and we get more info on them we can open a new issue. |
@pierrejoye yeah, that's my conclusion as well, pure cmd runs clean with 1.9.16822, now after 8 hours. ConEmu appearing in the trace where it has nothing to do with is a big sign. @derekbruening many thanks for supporting by this case. ConEmu issues are out of this tickets scope anyway. They only provide beta/alpha and (i guess :) also no one fetches debug symbols for it. I'll be verifying this next days and will report back, if the experience is different. But now, 8 hours later - cmd shows no issues while conemu still shows the same crash. I haven't close my laptop's lid yet :) Cheers. |
@derekbruening ah, i'm runnnig a x64 conemu on x64 win10, could it make some diff? Thanks. |
Hi,
I work together with @pierrejoye on integrating DrMemory for PHP test suite on Windows. Currently I have an issue on Windows 10 with the DrMemory release from DrMemory-Windows-1.9.0-4.zip. The program being debugged just crashes with no meaningful backtrace.
Error message: Exception thrown at 0x73838FE1 in php.exe: 0xC0000005: Access violation reading location 0x77A1FFFB.
BT:
The test files can be found here: http://windows.php.net/downloads/snaps/ostc/drmemory_test/ , the binary includes debug symbols and is linked with vc14 debug. Instead, any PHP release binary (and debug symbols can be used, available under http://windows.php.net/download/ . The test is run like
drmemory -- php.exe bug24312.php
The same command works well on Windows Server 2012. Also the binary itself doesn't crash when run without drmemory. The binary i've linked is built with vc14, but the same is reproduceable with vc11.
Thanks.
The text was updated successfully, but these errors were encountered: