Comments (8)
I think in the case of the path format like
\Device\ImDisk20\...
it needs some kind of a prefix to get win32 APIs to open it correctly? Maybe something like\\.\
?
Yep, GetFileNameFromHandle
body needs the rest of the sample code on https://msdn.microsoft.com/en-us/library/aa366789.aspx . I thought it wasn't necessary, but it unmistakably makes a diference on this case.
I'll push a fix after cleaning up the code somewhat.
from drmingw.
It shouldn't be difficult to reproduce this, but it would help me to understand where exactly are the binaries. For example, what's the krita.dll
and krita.dll.debug
's full path?
from drmingw.
Nevermind, I downloaded krita from https://binary-factory.kde.org/job/Krita_Nightly_Windows_Build/ so I can see all binaries.
However I can't reproduce this. mgwhelp_module_create
's ImageName
parameter is always correct for me.
It might be something more subtle going on here. Please double check this happens with the released catchsegv.exe
or catchsegv.exe
built with gcc.
from drmingw.
@alvinhochun, please rerun catchsegv
with -v
option, ie, catchsegv.exe -v -m krita.com
.
I want to see what's logged on https://github.com/jrfonseca/drmingw/blob/0.9.5/src/common/debugger.cpp#L676-L698
My guess is that GetFileNameFromHandle
is somehow returning garbage. Why is not clear, and I can't investigate it furher without reprocuding locally. You'll need to step through GetFileNameFromHandle and see why it's failing.
One potential problem is my abuse of MAX_PATH
all over the place. I've been lazy, as I really should start using variable length vectors everywhere for paths, preferably Unicode. But it's time consuming grunt work..
from drmingw.
Sorry, I see you already run with -v
... The relevant message is
CREATE_PROCESS PID=13776 TID=22388 lpBaseOfImage=00007FF7E4C40000
...
the expectation would be
CREATE_PROCESS PID=13776 TID=22388 lpBaseOfImage=00007FF7E4C40000 krita.com
...
so this is consistent with GetFileNameFromHandle
returning garbage. Why I don't know...
from drmingw.
@alvinhochun , ignore all my previous rambles. I think I nailed it in af8adbf. Let me know if the issue persists.
from drmingw.
Ah, thanks for looking into this. I always forgot to mention that I am using a ramdisk drive created with ImDisk, which often seems to expose some edge cases in applications.
In my case it is still failing to load. A snippet of the debug output:
[19300] GetFinalPathNameByHandle failed with 0x00000001
[19300] MGWHELP: \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\krita.com.debug - not found
[19300] MGWHELP: \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\.debug\krita.com.debug - not found
[19300] GetFinalPathNameByHandle failed with 0x00000001
[19300] MGWHELP: \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\krita.dll.debug - not found
[19300] MGWHELP: \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\.debug\krita.dll.debug - not found
And a snippet of the catchsegv -v
output:
CREATE_PROCESS PID=18276 TID=23856 lpBaseOfImage=00007FF7E4C40000 \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\krita.com
LOAD_DLL PID=18276 TID=23856 lpBaseOfDll=00007FFAA4D50000 \\?\C:\Windows\System32\ntdll.dll
LOAD_DLL PID=18276 TID=23856 lpBaseOfDll=00007FFAA3020000 \\?\C:\Windows\System32\kernel32.dll
LOAD_DLL PID=18276 TID=23856 lpBaseOfDll=00007FFAA24F0000 \\?\C:\Windows\System32\KernelBase.dll
CREATE_THREAD PID=18276 TID=10200
LOAD_DLL PID=18276 TID=23856 lpBaseOfDll=00007FFAA2B80000 \\?\C:\Windows\System32\ucrtbase.dll
CREATE_THREAD PID=18276 TID=11020
LOAD_DLL PID=18276 TID=10200 lpBaseOfDll=00007FFA4F440000 \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\krita.dll
CREATE_THREAD PID=18276 TID=24568
LOAD_DLL PID=18276 TID=24568 lpBaseOfDll=00007FFA64150000 \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\libkritaresources.dll
LOAD_DLL PID=18276 TID=10200 lpBaseOfDll=00007FFA4EE20000 \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\libkritaimage.dll
LOAD_DLL PID=18276 TID=24568 lpBaseOfDll=00007FFA62D70000 \Device\ImDisk20\krita-v5.1.0-prealpha-1799-g386dee827c-dirty\bin\libkritaglobal.dll
I think in the case of the path format like \Device\ImDisk20\...
it needs some kind of a prefix to get win32 APIs to open it correctly? Maybe something like \\.\
? IIRC the same thing also applies to a hard disk volume mounted to a folder mountpoint instead of a drive letter...
from drmingw.
Yay it works! 😄
from drmingw.
Related Issues (20)
- add copy to Clipboard
- Faulting location incorrect if executable uses ASLR. HOT 3
- Have it handle stack corruption HOT 3
- No source code is showing for projects built with MSYS2 HOT 4
- Reason for erroring out with posix threads? HOT 2
- Can exchndl be made to catch RaiseFailFastException? HOT 4
- catchsegv clobbers Unicode arguments
- Feature request: Support ARM64 HOT 23
- Feature request: Allow opt-in to use system provided zlib HOT 1
- ExcHndl.dll can't print the crash call stack under Windows 7 HOT 20
- Dumping register values on x86_64 HOT 1
- Write minidump from exchndl.dll
- Support minidump locations/filenames containing unicode (wide char) characters HOT 4
- Release 0.9.8: Naming of link libraries different between 32 and 64 bit HOT 3
- What is the minimal OS to run the official drmingw release? HOT 2
- libwinpthread-1.dll missing from release HOT 9
- Save the result automatically HOT 3
- Is it possible to update drmingw to the latest version in the msys2 package? HOT 2
- better sample code in the home page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drmingw.