Date: Sat, 17 Feb 1996 12:18:25 +0800 (GMT+0800) From: "Orlando A. Andico" To: DJGPP Mailing List cc: dj AT delorie DOT com Subject: Segmentation problem in DJGPP v2 Message-ID: MIME-Version: 1.0 Hi all: I posted this problem previously, but nobody responded. Since then, I've done more testing and can report more. I downloaded an image-processing program called SUSAN. I'm pretty sure it's bug-free as it's patented by the UK Defense Agency. When I compile it with gcc -O3 -s -o susan susan2f.c -lm (as specified in the docs; I also set it up for DJGPP compilation) using DJGPP v2, the program immediately bombs with a SIGSEGV. The same happens when I compile with -O2 and -O. When compiled this way: gcc -g -o susan susan2f.c -lm the ``usage'' part (which comes up whenever you execute the program with no arguments) comes up correctly, ie the program _seems_ to be working. However, whenever I try to do anything, the program bombs anew. Here's the postmortem: Exiting due to signal SIGSEGV Page fault at eip=000106b1, error=0006 eax=000000af ebx=000107b0 ecx=00000010 edx=0005d1c0 esi=000107b0 edi=000005b0 ebp=00003474 esp=00003474 cs=00a7 ds=00af es=00af fs=008f gs=00bf ss=0033 Call frame traceback EIPs: 0x000106b1 ___djgpp_exception_table+281 I don't know what's error=0006, can anyone enlighten me? The SIGSEGV bombs are _always_ in ___djgpp_exception_table+281, wherever that is. I'm using CWSDPMI p1; I've tried the program on two 486DX2's and a Pentium-100. All these PC's have 16MB of RAM and 50-100MB of swap. There's around 12MB of DPMI memory (as reported by go32-v2). When running under Windoze 3.1, there's around 8MB of DPMI memory; the program still bombs. Windoze claims something really catastrophic has happened (recommends a reboot). I've also compiled the program on these platforms (all with no problems whatsoever): a) Sun SS10, gcc 2.6.3, Solaris 2.3 b) 486DX2-66, gcc 2.7.2, Linux 1.2.7 c) 486DX2-66, gcc 2.6.3, Linux 1.2.3 d) P100, gcc 2.6.3, MS-DOS (DJGPP 1.12m4) That's the oddest thing -- I reinstalled DJGPP 1.12m4 and the SUSAN program compiled with it runs without any problems whatsoever... However: when I use go32-v2 instead of the 1.12m4 go32 to execute the 1.12m4-compiled SUSAN program, I get a GPF. I don't think it's the malloc() problem which was discussed on the list previously, as the program makes nowhere near 3000 calls. How do I detect for stack problems? I'm not sure where the problem is, but my testing seems to point at one of the v2 packages; probably not CWSDPMI, as the problem also appears under Windoze. Could be my setup? I just use the DJGPP distribution "out of the box." I don't use stubify or cwsparam or any of those... Ideas, help, advice would be much appreciated. I'm trying to move all my work to DJGPP v2 but for problems like these... Thanks, /----------------------------------------------------------------------------\ | Orlando A. Andico "I have no concept of time, other than | | oandico AT eee DOT upd DOT edu DOT ph it is flying." -- Alanis Morissette | \----------------------------------------------------------------------------/