From: Patrick Dawson Newsgroups: comp.os.msdos.djgpp Subject: Re: strange problem Date: Tue, 25 Mar 1997 07:51:38 -0800 Organization: LI Net (Long Island Network) Lines: 41 Message-ID: <3337F48A.DF9@geocities.com> References: <33332701 DOT 1A29 AT uit DOT net> Reply-To: pkdawson AT geocities DOT com NNTP-Posting-Host: lisuser72.li.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Chris Larson wrote: > > I'm having a strange problem with DJGPP(most likely my error). I am > reading integer and floating point values into a structure from a text > file. If I print the variables to the screen while still in the while() > loop that reads them in (using fscanf()and fseek()) the values print out > right, but if I print them out after exiting the while() loop they don't > retain there value(usually = 0). It also does not always work at all but > will bomb out with the following message. > > Exiting due to signal SIGSEGV > General Protection Fault at eip=000087fe > eax=00000001 ebx=0004f420 ecx=0004f300 edx=88f84d8a esi=000015aa > edi=00000033 > ebp=0004f398 esp=0004f318 program=C:\ASCREAD\ASCOR.EXE > cs: sel=00af base=825ab000 limit=0008ffff > ds: sel=00b7 base=825ab000 limit=0008ffff > es: sel=00b7 base=825ab000 limit=0008ffff > fs: sel=0087 base=000221b0 limit=0000ffff > gs: sel=00c7 base=00000000 limit=ffffffff > ss: sel=00b7 base=825ab000 limit=0008ffff > > Call frame traceback EIPs: > 0x000087fe __doscan_low+1710 > 0x00008382 __doscan_low+562 > 0x0000814b __doscan+27 > 0x00002dda _fscanf+18 > 0x00001806 _load_asc_obj_f+490, line 76 of ascor.c > 0x00001cbf _main+43, line 141 of ascor.c > 0x000023a2 ___crt1_startup+138 > > This is what I get when I run symify. It doesn't always bomb on the > same line but generally the traceback is always the same. > If anyone could help I would really appreciate it. > > Thanks in advance - Chris. You need to run cwsdpmi.exe . I experienced the same problem. Funny thing is, I get a different error message when trying to compile after that, oh well. Actually use 'cwsdpmi -p'. Tell me if you get it working. You're welcome - Patrick