On Thu, Mar 07, 2013 at 07:53:57PM +0000, Graham wrote: > I use a LD_PRELOAD before running wine so that i can debug my application. > > The library which is preloaded is able to replace system dlsym and from > that, other consequence library call. > > There is no problem until, i put some Detour code(hot patching) into the > kernel32.dll.so address space. But the very funny things is this > ** THE PROGRAM CRASHES BEFORE MY HOTPATCH IS APPLIED ** > > so it seems somehow the order of cause and effect is extremely weird > and frightening to me. How can a piece of code which is not excecuted be > teh cause for errors PRIOR/BEFORE to its execution. And this is surely > happening because when i uncomment the Hotpatch/detour lines the problem > goes away. > > here are some lines from the crashs ... > > err:module:attach_process_dlls "user32.dll" failed to initialize, aborting > err:module:LdrInitializeThunk Main exe initialization for > L"C:\\windows\\system32\\winemenubuilder.exe" failed, status c0000005 > wine: Unhandled page fault on execute access to 0x7c9e4cd7 at address > 0x7c9e4cd7 (thread 000b), starting debugger... > err:module:DelayLoadFailureHook failed to delay load > user32.dll.BroadcastSystemMessageW > wine: Call from 0x7b83ba92 to unimplemented function > user32.dll.BroadcastSystemMessageW, aborting > wine: Unimplemented function user32.dll.BroadcastSystemMessageW called > at address 0x7b83ba92 (thread 001d), starting debugger... > > Another thing to notice is that this was tested using wine1.4.1 > > However it DOES work with wine1.5.10 ... to get something to work for me > is not the challenge, its to understand the logic behind why something > does not. > > THanks a lot and I am grateful for any who contributes his knowledge to > this problem i am a real NOVICE
"real NOVICE" and using LD_PRELOAD or "hotpatching" does not fit together for me...? - wine uses it own elfloader, which might cause issues. - during loading/linking it might also interact already. what should the LD_PRELOAD thing achieve? Can perhaps a wine internal debug mechanism be used already? Ciao, Marcus