Help debugging wine with CAM app

Andreas Mohr andi at rhlx01.fht-esslingen.de
Thu May 9 16:48:03 CDT 2002


On Wed, May 08, 2002 at 12:52:45PM -0600, Kyle wrote:
> I'd like to get involved in wine development.  I'm starting by trying to 
> get wine to run my favorite CAM application.  Anyone who could give me a 
> little coaching on debugging would be much appreciated.
> 
> I'm using a recent CVS download of wine.  To replicate the problem, do:
> 
> Download the zip file at  ftp://ftp.actarg.com/pub/misc/mtc.tgz.
> Unzip it under /c/Program Files. Then CD into MTC/TurboNest/Program
> and run:
> 
> winedbg TurboNst.exe --debugmsg trace+string,+relay 2>/tmp/debug.out
> 
> Search in the debug file for the string: TURBONST.ent
> Right around there is about where it starts to go into an endless loop.
> 
> I have been single stepping all around in there and I can't figure out 
> what is going on.
> 
> One wierd thing: In the debugger, do
> break INT_Int31Handler
> cont
> then single step into CallRMInt
> on line: if (!Dosvm.CallRMInt && !DPMI_LoadDosSystem()),
> it doesn't seem to call DPMI_LoadDosSystem() at the correct address
> it calls some other address which looks like a jump table of some
> kind
> 
> I'm not sure if that's the problem, but in any case, there's a point
> soon thereafter where it gets stuck doing:
> 
> trace:string:lstrcmpiA strcmpi "" and "TURBONST.ent"
> 
> over and over again.
> 
> One other interesting thing: I found out by accident that if I patch
> into wine an illegal operation as follows:
> 
> Put into the last line of procedure:
> BOOL WINAPI SetCurrentDirectoryA( LPCSTR dir )
> 
> a command that access memory illegally such as:
> FIXME("TRUE:%s\n",drive); //drive is an int--not a string
> 
> Then run the program. Wine reports the illegal memory access, but
> then goes on to run the program successfully (other than that the
> fonts look funny and that function doesn't work right).
> 
> Anyone that has experience debugging wine, I'm interested in learning
> more about how to do it. If I can get some experience under my belt,
> I'd love to help developing wine and finding more bugs.
Sounds like some DPMI messup probably.
(DPMI is very seldomly used by current apps and thus isn't highly stable !)
You forgot to include +dpmi,+int31 messages !!!!

All those memory contents that the thing is lstrcpy()ing look
godawful to me, too...
Sounds like uninitialized memory to me when it's doing its TURBONST.ent
LSTRCMPI comparisons...

Do you want to know what I think ?

I think it's doing some file list traversal (searching for the TURBONST.ent
counterpart).
And as it encounters heaps of uninitialized/broken memory, it will *never*
encounter a proper TURBONST.ent string and keeps looping for it.

--> a DPMI/int31 messup gets more and more likely, as DPMI's job is...
guess what... memory handling. ;-)

I guess that I could solve this problem given some time, but I'm afraid
I'd like to see you suffer first when debugging this problem :-)

DPMI stuff is in msdos/dpmi.c and dlls/winedos/int31.c, BTW.

Maybe just add tons of debugging traces there until you get mad :-)

Good luck, and tell us whether you made it.

-- 
Andreas Mohr                        Stauferstr. 6, D-71272 Renningen, Germany
Tel. +49 7159 800604                http://home.arcor.de/andi.mohr/



More information about the wine-devel mailing list