From: "Huang Chee Thong" Newsgroups: comp.os.msdos.djgpp Subject: Program crashes only when not in debugger Date: 28 Dec 1996 12:53:45 GMT Organization: Pacific Internet, Singapore Lines: 158 Message-ID: <01bbf4bd$76bfd3e0$LocalHost@hal9000> NNTP-Posting-Host: max77ppp99.pacific.net.sg To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Hi, I have written a program to read in a file and display it screen by screen (another more) using pd curses. It compiles without any warning. 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 tried enlarging the stack space, the behaviour is still the same. My system configuration: P90 with 64M ram 256 cache. Running win 95 with long file name in bash. (No difference with normal dos mode or plain dos) djgpp v2.01 My enviroment in bash: BASH=c:/djgpp/bin/bash.exe BASH_VERSION=1.14.7(173) BLASTER=A220 I5 D1 H5 P330 T6 CMDLINE=WIN COMSPEC=C:\WINDOWS\COMMAND.COM DJDIR=c:/djgpp DJGPP=C:\DJGPP\DJGPP.ENV E2CWD=129:3 EMU387=c:/djgpp/bin/emu387.dxe EUID=42 HISTFILE=D:/cth/.bash_history HISTFILESIZE=500 HISTSIZE=500 HOME=D:/cth HOSTTYPE=PCAT IFS= LESS=-Q LFN=y MAILCHECK=60 OLDPWD=d:/cth/source OPTERR=1 OPTIND=1 OSTYPE=MSDOS PATH=C:/WINDOWS;C:/WINDOWS/COMMAND;C:/DOS;C:/UTL;C:/EMACS/BIN;C:/DJGPP/BIN;. / PPID=1 PROMPT=$p$g PS1=[\u \w \#$] PS2=> PS4=+ PWD=d:/cth/source/project SHELL=bash SHLVL=1 SOUND=c:\SB16 TEMP=F:\TMP TERM=dumb TMP=F:\TMP TMPDIR=F:\TMP UID=42 USER=cth _=set winbootdir=C:\WINDOWS windir=C:\WINDOWS Infomation given by go32-v2: DPMI memory available: 37875 Kb DPMI swap space available: 23777 Kb I have attach the source code to this message and also the 2 files that 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. Thanks. Huang Chee Thong begin 600 view.zip M4$L#!!0``@`(`.T,G"%PSWN/M (```L&```&````=FEE=RYCC51M;YLP$/X< M?L4UU503D0;V<1F5IC:=HF5IU:RJIJVJ'##!&C'(F*13FO^^LV,@:59M?$#< MB^]Y[NXQ AT YX#/?@$BCTK2'C&8,79FDGM_4JY@&4>5QG3I AT Z<1_ AT U<$ZYB+(J M9O QJF3)RO/T8L]7\H6 AT V2N?BC,^?^V37"P.?;0LF53:YYS&+.&"P9?1]]N[ MT6PVN@+8K%/-D2R8BE+BAN'H[LX=;AUGE?,82D6EJ AT K"A0(J%Y$'44HE]/![ M]>/1'=HT)>DN!XFBT_AB7A89_?VDN,K8TYQ*LCNJ1R+HDKW.T_[C%"2@> 0F MDXF8Z \-J\&6.,VWF#D;!_"I^>\R= P/ZX!Y'5,TIX-'FW1 [3#4CG!G:VXV M))FJI(!@Z&P;I/^:IN5\/9Z,< 8%=FE:,+LGL_'G\?2;9T:]WP-/P'07A@&\ MO)BR%^_=C=,I4 HJ(=W[DB[8!WA70CW6GZ+K&4A?=]-ASUR1P-;<.K8J(4D1 M)GG!1-VY!UVINBY*9'H_F>Q#7&L%(8#(4?%Y)>*3!B+X&X1^)U&6EPQ!7-OG MH >71OKUF"#*4;]X-PPAP549R7K&T5PR^JNV1,ZB-&\MD35Y&:.R74PB69EJ MTZD%WFC*#A_M-:K*GC"\?32V1T)'759E?6J9KQB9C*>C63_P?'N8QC'>1]*] ME?E"TB6VH)BL"L7BD^XQHS? +4[+X)_7RE+"<5[M4D&E#$PZS'7FH+X9^F(] MC*=7-P_0:\H-]Z.Z4SU%W*D*?=M6I?(Z@'LYD"(Y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