From: George Foot Newsgroups: comp.os.msdos.djgpp Subject: Re: CWSDPMI: My application crash on "Win95 Command Prompt Only" Date: 15 Jun 1998 15:02:47 GMT Organization: Oxford University, England Lines: 45 Message-ID: <6m3d2n$qoq$3@news.ox.ac.uk> References: <01bd9474$0e94ec80$92c809c0 AT chessa> NNTP-Posting-Host: sable.ox.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On 10 Jun 1998 13:31:03 GMT in comp.os.msdos.djgpp Alberto Chessa wrote: : Hi, : I'm in troubble with an little Allegro based program. It run under Win95 : DOS Box but It won't run under "Win95 Command Prompt Only" mode with : CWSDPMI DOS Extender (I need to test the pure performace of my program with : no intrusion at all). : It reports a "Page fault" error. You are probably trying to dereference a NULL pointer -- for example, one that is uninitialised, or had a value assigned from a `malloc' that failed. By default, djgpp's startup code arranges for this to cause the error you see; Windows 95's DPMI server does not support this, so the error does not show up. You can turn off this feature (see `crt0.h' in the `include' directory), but I don't recommend this -- the crash is due to a bug in your program, and you should fix it. If you run `symify' while the call frame traceback is still on the screen, it will tell you what functions were being executed when the problem occured. If you compile with extra debugging information (`-g') then it will also tell you what filename and line number was reached in each function in the list. The first entry in the list is the actual location where the problem occured; entries further down the list are the locations of calls to the function immediately above them in the list. If you are so inclined, you could learn to use a debugger; then you can examine the values of variables in your program when the crash occurs, which may help you to find the NULL pointer. Some types of programs don't behave well when run from debuggers, though, so other problems may arise if you try this. References to djgpp FAQ: Null pointer dereference crashes v2.0 programs: Section 9.1 SYMIFY, a program to read crash traceback: Section 9.2 Debugging: Chapter 12 Also see `readme.1st' for brief information on debugging. -- george DOT foot AT merton DOT oxford DOT ac DOT uk xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/lojban.html