Message-Id: <199612290114.CAA04823@math.amu.edu.pl> Comments: Authenticated sender is From: "Mark Habersack" Organization: Home, sweet home (Poznan, Poland) To: "Huang Chee Thong" , djgpp AT delorie DOT com Date: Sun, 29 Dec 1996 02:13:49 +0100 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Program crashes only when not in debugger Reply-to: grendel AT ananke DOT amu DOT edu DOT pl Once upon a time (on 28 Dec 96 at 12:53) Huang Chee Thong said: > The program works ok with text files with lines less than 80 > characters. > However for files with longer lines it does not seem to display > properly or crashes with a SIGSEGV with the following trace stack: > > 0x00008830 _malloc+124 > 0x000088f9 _free+1 > 0x00001b95 _readline+93, line 104 of display.c > 0x000019ae _display_file+270, line 51 of display.c > 0x00001587 _main+55, line 26 of view.c > 0x000074fe ___crt1_startup+70 > > However when I try to run the program in the debugger (FSDB and > GDB) the > program will run correctly. I have compiled the program and it runs without any problems on my machine. The stack backtrace seen above is very strange. At line 104 of display.c there's a call to the 'fgets' function which DOES NOT call any function that might invoke 'free()'. Are you sure you're not mixing libraries from DJGPP v2.0 and 2.01? Check whether ALL of them are compiled with one and the same version of DJGPP. What version of PDCURSES do you use? > the program have problem reading. The file 'test' could not display > properly though it display ok in GDB. 'Autoexec.bat' could not be > displayed at all (Crashes with the above backtrace) but it is runs > ok in GDB. Both of them were displayed properly on my machine. ----------------------------------------------------- So I talked about conscience and I talked about pain, And he looked out of window and it started to rain I thought maybe I've already gone crazy... ---- Visit http://ananke.amu.edu.pl/~grendel