delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/07/20/15:12:03

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Tue, 20 Jul 2004 22:10:44 +0200
From: "Eli Zaretskii" <eliz AT gnu DOT org>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <6480-Tue20Jul2004221044+0300-eliz@gnu.org>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <20040720050354.16492.00000149@mb-m14.aol.com> (sterten@aol.com)
Subject: Re: strange error
References: <7137-Tue20Jul2004073550+0300-eliz AT gnu DOT org> <20040720050354 DOT 16492 DOT 00000149 AT mb-m14 DOT aol DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: sterten AT aol DOT com (Sterten)
> Newsgroups: comp.os.msdos.djgpp
> Date: 20 Jul 2004 09:03:54 GMT
>
> thanks for the bfdsymify hint, but with -g
> switch I get no error at all.

Please show the compilation command(s) you used in each case.

> bfdsymify refers to crt1.c , but I couldn't find such a file
> on my computer.

That's okay, crt1.c is the startup module for which you have no
source (unless you download the library sources, djlsr203.zip).
Don't worry about that.

What _would_ be useful (and that's why I suggested bfdsymify) is the
translation of the hex EIP value in "0x00001cdf main+1631" into a
source line number in qser1.c.

> When compiled with -g , or when including the printf("");
> (which basically is a no-operation command !)

printf("") is certainly _not_ a no-op!  The program actually calls the
function and passes it an empty string, so the program code is
altered.

> then the program works correctly.

If the program compiled with -g does not crash (but please still show
us the compilation command you used to do that), then please run the
program under GDB, like this:

   C:\DJGPP>gdb qser1.exe
   (gdb) run 20 1 7

and when it crashes, type "disassemble" and post here the results.
(You will have to download and install GDB, if you don't have it
already.)

> can there be any disadvantage with -g ?

It makes the executable MUCH larger.

> C:\DJGPP>queensy4 20 1 7
>
> 480 solutions
> General Protection Fault at eip=8; flags=3046
> eax=00a30000 ebx=000000a7 ecx=00000000 edx=0001cc10 esi=00001000 edi=10000000
> ebp=00000000 esp=00000400 cs=87 ds=0 es=8f fs=0 gs=0 ss=8f error=0000

This message comes from CWSDPMI, which means you've seriously
thrashed the system.

> ---------------------------------------------
> C:\DJGPP>gcc qser1.c -O2 -o qser1.exe

What's the difference between qser1.exe and queensy4.exe?

> C:\DJGPP>gcc qser1.c -g -O2 -o qser1.exe
>
> C:\DJGPP>qser1 16 2 3
>
> 0 solutions

Is "0 solution" the correct answer for this input?

Also, please try -gstabs+ instead of -g, and see if the program
crashes then.  If it does, bfdsymify will show the line number.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019