X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Lines: 665 X-Admin: news AT aol DOT com From: sterten AT aol DOT com (Sterten) Newsgroups: comp.os.msdos.djgpp Date: 25 Jul 2004 05:32:14 GMT References: <2914-Sat24Jul2004104537+0300-eliz AT gnu DOT org> Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com Subject: Re: strange error Message-ID: <20040725013214.18573.00000172@mb-m22.aol.com> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli wrote: >> only the final one, where it crashed > >Sure; but that's better than what you have now (which is nothing >except guesses). I'm 90% sure, that it's the line which I posted, m55:r--;if(R[r]!=1)goto m55; and then r becomes negative. Then I assume r runs into array Sym[99][99] which was initialized immediately before R99]. It should stop at Sym[16][16] which should be the first entry which is =1. Then presumably r is 0-99*99+16*16=-9545 (modulo modifications due to starting at 1 vs.0, I'm too lazy to check this) Then the next line is c=C[r] .. then setting R[9562]=0 which is about 9000*4 bytes behind the last defined data-area-element ... then setting C[c]=0 and I don't really know, what value c=C[-9545] is here. Somewhere here the program crashes (or not). Now, this all wouldn't have happened if the _first_ version had crashed after I included the m55:.. line. But it ran correctly, so I assumed my new version were OK , did some other changes .. and then suddenly it crashed and I didn't know, why. >> >Bottom line, using the debugger in such cases might need some hard >> >work, but it is always the shortest way to the solution, because it >> >saves you the need to guess. ..which is sometimes the shorter way to the solution >> wouldn't a compiler which checks the indices >> (I found compaq-C with google) be a shorter solution here ? > >If the indices are the culprit, yes. But we don't know that, do we? with high probability >> under DOS: >> gdb qser3.exe > file >> run 16 1 5 (typed blindly) >> disassemble (typed blindly) >> >> crash, no way to escape, reboot > >What type of crash? Did you see any messages? did it freeze? what >happened? just as below. When I type 2 times quit then I see one quit and XXes after break. >> redir -o file gdb qser3.exe >> run 16 1 5 (typed blindly) >> disassemble (typed blindly) >> quit (typed blindly) >> quit (now displayed) > >Try "yes" at this point. works ! I forgot. Result see below. >> > >BAD IDEA. only chance. Alternative was immediate reboot. Usually I have this "hbreak" TSR running which allows me to escape programs but I removed it recently to exclude its possible responsibility for the "strange error". ---------------------------------- GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-pc-msdosdjgpp"... (no debugging symbols found)... (gdb) run 16 1 5 Starting program: c:/djgpp/qser3.exe 16 1 5 Program received signal SIGSEGV, Segmentation fault. 0x00001cfc in main () (gdb) disassemble Dump of assembler code for function main: 0x1680
: push %ebp 0x1681 : xor %eax,%eax 0x1683 : mov %esp,%ebp 0x1685 : mov $0xd0d0,%ecx 0x168a : push %edi 0x168b : mov $0xd270,%edx 0x1690 : push %esi 0x1691 : push %ebx 0x1692 : sub $0x3c,%esp 0x1695 : and $0xfffffff0,%esp 0x1698 : movl $0x0,0xf984 0x16a2 : movl $0x0,(%ecx,%eax,4) 0x16a9 : movl $0x0,(%edx,%eax,4) 0x16b0 : inc %eax 0x16b1 : mov %eax,0xf984 0x16b6 : cmp $0x62,%eax 0x16b9 : jle 0x16a2 0x16bb : cmpl $0x1,0x8(%ebp) 0x16bf : jle 0x1f43 0x16c5 : push %eax 0x16c6 : mov 0xc(%ebp),%eax 0x16c9 : push $0x1a634 0x16ce : push $0x15e0 0x16d3 : mov 0x4(%eax),%eax 0x16d6 : push %eax 0x16d7 : call 0x3b90 0x16dc : add $0x10,%esp 0x16df : mov 0x1a634,%edx 0x16e5 : mov %edx,0xffffffc8(%ebp) 0x16e8 : test %edx,%edx 0x16ea : js 0x1f29 0x16f0 : movl $0x1,0xffffffcc(%ebp) 0x16f7 : mov 0xffffffc8(%ebp),%edx 0x16fa : movl $0x1,0x1a9f4 0x1704 : cmp %edx,0xffffffcc(%ebp) 0x1707 : jg 0x1752 0x1709 : mov $0x10e10,%ecx 0x170e : mov $0x1,%esi 0x1713 : movl $0x1,0xfcd4 0x171d : cmp %edx,%esi 0x171f : jg 0x1738 0x1721 : lea 0x4(%ecx),%eax 0x1724 : inc %esi 0x1725 : movl $0x0,(%eax) 0x172b : mov %esi,0xfcd4 0x1731 : add $0x4,%eax 0x1734 : cmp %edx,%esi 0x1736 : jle 0x1724 0x1738 : mov 0xffffffcc(%ebp),%ebx 0x173b : mov 0xffffffc8(%ebp),%edx 0x173e : inc %ebx 0x173f : add $0x18c,%ecx 0x1745 : mov %ebx,0xffffffcc(%ebp) 0x1748 : mov %ebx,0x1a9f4 0x174e : cmp %edx,%ebx 0x1750 : jle 0x170e 0x1752 : movl $0x1,0xffffffcc(%ebp) 0x1759 : mov 0xffffffc8(%ebp),%eax 0x175c : movl $0x0,0xffffffd0(%ebp) 0x1763 : movl $0x0,0x1a5d4 0x176d : movl $0x1,0x1a9f4 0x1777 : cmp %eax,0xffffffcc(%ebp) 0x177a : jg 0x1f1c 0x1780 : movl $0x63,0xffffffc4(%ebp) 0x1787 : mov $0x1,%esi 0x178c : mov %eax,%ecx 0x178e : movl $0x1,0xfcd4 0x1798 : cmp %eax,%esi 0x179a : jg 0x195f 0x17a0 : mov 0xffffffc4(%ebp),%eax 0x17a3 : mov %eax,0xffffffe8(%ebp) 0x17a6 : mov 0xffffffcc(%ebp),%edx 0x17a9 : mov %esi,0x1a664 0x17af : mov %edx,%eax 0x17b1 : mov %edx,0x1a614 0x17b7 : imul %ecx,%eax 0x17ba : lea (%esi,%eax,1),%edx 0x17bd : add %ecx,%eax 0x17bf : sub %esi,%eax 0x17c1 : mov %edx,0x1a644 0x17c7 : lea 0x1(%eax),%edi 0x17ca : mov %edi,0x1a5c4 0x17d0 : cmp %edx,%edi 0x17d2 : jge 0x17e4 0x17d4 : mov %ecx,%eax 0x17d6 : mov %edi,0x1a644 0x17dc : sub %esi,%eax 0x17de : inc %eax 0x17df : mov %eax,0x1a664 0x17e4 : mov 0xffffffcc(%ebp),%edi 0x17e7 : mov %ecx,%eax 0x17e9 : sub %edi,%eax 0x17eb : mov 0x1a644,%edx 0x17f1 : inc %eax 0x17f2 : mov %eax,%ebx 0x17f4 : mov %eax,0xfffffff0(%ebp) 0x17f7 : imul %ecx,%ebx 0x17fa : lea (%ecx,%ebx,1),%eax 0x17fd : sub %esi,%eax 0x17ff : lea 0x1(%eax),%edi 0x1802 : mov %edi,0x1a5c4 0x1808 : cmp %edx,%edi 0x180a : jge 0x1826 0x180c : mov 0xfffffff0(%ebp),%eax 0x180f : mov %edi,0x1a644 0x1815 : mov %eax,0x1a614 0x181a : mov %edi,%edx 0x181c : mov %ecx,%eax 0x181e : sub %esi,%eax 0x1820 : inc %eax 0x1821 : mov %eax,0x1a664 0x1826 : lea (%esi,%ebx,1),%edi 0x1829 : mov %edi,0x1a5c4 0x182f : cmp %edx,%edi 0x1831 : jge 0x184a 0x1833 : mov 0xfffffff0(%ebp),%edx 0x1836 : mov %edi,0x1a644 0x183c : mov %edx,0x1a614 0x1842 : mov %esi,0x1a664 0x1848 : mov %edi,%edx 0x184a : mov %esi,%eax 0x184c : mov 0xffffffcc(%ebp),%ebx 0x184f : imul %ecx,%eax 0x1852 : lea (%ebx,%eax,1),%edi 0x1855 : mov %edi,0x1a5c4 0x185b : cmp %edx,%edi 0x185d : jge 0x1873 0x185f : mov %edi,0x1a644 0x1865 : mov %esi,0x1a614 0x186b : mov %ebx,0x1a664 0x1871 : mov %edi,%edx 0x1873 : add %ecx,%eax 0x1875 : mov 0xffffffcc(%ebp),%ebx 0x1878 : sub %ebx,%eax 0x187a : lea 0x1(%eax),%edi 0x187d : mov %edi,0x1a5c4 0x1883 : cmp %edx,%edi 0x1885 : jge 0x189d 0x1887 : mov 0xfffffff0(%ebp),%eax 0x188a : mov %edi,0x1a644 0x1890 : mov %esi,0x1a614 0x1896 : mov %eax,0x1a664 0x189b : mov %edi,%edx 0x189d : mov %ecx,%eax 0x189f : sub %esi,%eax 0x18a1 : lea 0x1(%eax),%ebx 0x18a4 : mov %ebx,%eax 0x18a6 : imul %ecx,%eax 0x18a9 : mov %eax,0xffffffec(%ebp) 0x18ac : add %ecx,%eax 0x18ae : mov 0xffffffcc(%ebp),%ecx 0x18b1 : sub %ecx,%eax 0x18b3 : lea 0x1(%eax),%edi 0x18b6 : mov %edi,0x1a5c4 0x18bc : cmp %edx,%edi 0x18be : jge 0x18d7 0x18c0 : mov 0xfffffff0(%ebp),%edx 0x18c3 : mov %edi,0x1a644 0x18c9 : mov %edx,0x1a664 0x18cf : mov %ebx,0x1a614 0x18d5 : mov %edi,%edx 0x18d7 : mov 0xffffffec(%ebp),%edi 0x18da : mov 0xffffffcc(%ebp),%eax 0x18dd : add %eax,%edi 0x18df : mov %edi,0x1a5c4 0x18e5 : cmp %edx,%edi 0x18e7 : jge 0x18fe 0x18e9 : mov 0xffffffcc(%ebp),%ecx 0x18ec : mov %edi,0x1a644 0x18f2 : mov %ebx,0x1a614 0x18f8 : mov %ecx,0x1a664 0x18fe : mov 0x1a614,%eax 0x1903 : mov 0x1a664,%ecx 0x1909 : lea (%eax,%eax,2),%eax 0x190c : mov %eax,%edx 0x190e : shl $0x5,%edx 0x1911 : add %edx,%eax 0x1913 : add %ecx,%eax 0x1915 : mov 0x10c84(,%eax,4),%edx 0x191c : test %edx,%edx 0x191e : jne 0x1937 0x1920 : mov 0xffffffd0(%ebp),%edi 0x1923 : inc %edi 0x1924 : mov %edi,0xffffffd0(%ebp) 0x1927 : mov 0xffffffd0(%ebp),%ebx 0x192a : mov %ebx,0x1a5d4 0x1930 : mov %ebx,0x10c84(,%eax,4) 0x1937 : mov 0xffffffe8(%ebp),%edx 0x193a : mov 0x10c84(,%eax,4),%eax 0x1941 : add %esi,%edx 0x1943 : mov 0xffffffc8(%ebp),%ecx 0x1946 : mov %eax,0x10c84(,%edx,4) 0x194d : lea 0x1(%esi),%eax 0x1950 : mov %eax,%esi 0x1952 : mov %eax,0xfcd4 0x1957 : cmp %ecx,%eax 0x1959 : jle 0x17a6 0x195f : mov 0xffffffc4(%ebp),%esi 0x1962 : mov 0xffffffc8(%ebp),%eax 0x1965 : add $0x63,%esi 0x1968 : mov %esi,0xffffffc4(%ebp) 0x196b : mov 0xffffffcc(%ebp),%esi 0x196e : inc %esi 0x196f : mov %esi,0xffffffcc(%ebp) 0x1972 : mov %esi,0x1a9f4 0x1978 : cmp %eax,%esi 0x197a : jle 0x1787 0x1980 : mov 0xc(%ebp),%ecx 0x1983 : push %ebx 0x1984 : mov 0xffffffd0(%ebp),%edx 0x1987 : push $0x1a9f4 0x198c : mov %edx,0x1a5b4 0x1992 : push $0x15e0 0x1997 : xor %edi,%edi 0x1999 : mov 0x8(%ecx),%ecx 0x199c : push %ecx 0x199d : call 0x3b90 0x19a2 : mov 0xc(%ebp),%ebx 0x19a5 : add $0xc,%esp 0x19a8 : mov 0x1a9f4,%edx 0x19ae : mov 0x1a634,%eax 0x19b3 : push $0xfcd4 0x19b8 : sub %edx,%eax 0x19ba : push $0x15e0 0x19bf : inc %eax 0x19c0 : mov %eax,0xfb34 0x19c5 : mov 0xc(%ebx),%eax 0x19c8 : push %eax 0x19c9 : call 0x3b90 0x19ce : add $0x10,%esp 0x19d1 : mov 0x1a634,%esi 0x19d7 : mov 0xfcd4,%ecx 0x19dd : mov 0xfb34,%edx 0x19e3 : mov %esi,%ebx 0x19e5 : mov %esi,0xffffffc8(%ebp) 0x19e8 : sub %ecx,%ebx 0x19ea : mov 0x1a9f4,%esi 0x19f0 : inc %ebx 0x19f1 : mov %ebx,0x1a5f4 0x19f7 : lea (%edx,%esi,1),%eax 0x19fa : mov %esi,0xd270(,%esi,4) 0x1a01 : movl $0x2,0xd0d0(,%esi,4) 0x1a0c : movl $0x1,0x1aa04(,%eax,4) 0x1a17 : lea (%ebx,%ecx,1),%eax 0x1a1a : mov %ebx,0xd270(,%ecx,4) 0x1a21 : movl $0x1,0xf9a4(,%esi,4) 0x1a2c : movl $0x1,0x1a674(,%esi,8) 0x1a37 : movl $0x2,0xd0d0(,%ecx,4) 0x1a42 : movl $0x1,0xf9a4(,%ebx,4) 0x1a4d : movl $0x1,0x1a674(,%eax,4) 0x1a58 : movl $0x1,0x1aa04(,%ecx,8) 0x1a63 : lea (%ebx,%edx,1),%eax 0x1a66 : mov %ecx,0xd270(,%edx,4) 0x1a6d : movl $0x1,0xf9a4(,%ecx,4) 0x1a78 : movl $0x2,0xd0d0(,%edx,4) 0x1a83 : lea (%ecx,%edx,1),%ecx 0x1a86 : mov %edx,0xd270(,%ebx,4) 0x1a8d : movl $0x2,0xd0d0(,%ebx,4) 0x1a98 : add %esi,%ebx 0x1a9a : movl $0x1,0x1a674(,%ecx,4) 0x1aa5 : movl $0x1,0x1aa04(,%eax,4) 0x1ab0 : movl $0x1,0xf9a4(,%edx,4) 0x1abb : movl $0x1,0x1a674(,%eax,4) 0x1ac6 : movl $0x1,0x1aa04(,%ebx,4) 0x1ad1 : movl $0x0,0x1a5c4 0x1adb : inc %edi 0x1adc : mov %edi,0x1a5c4 0x1ae2 : mov 0xd0d0(,%edi,4),%eax 0x1ae9 : test %eax,%eax 0x1aeb : jne 0x1adb 0x1aed : cmp 0xffffffc8(%ebp),%edi 0x1af0 : jg 0x1dda 0x1af6 : movl $0x0,0xd270(,%edi,4) 0x1b01 : mov $0xd270,%eax 0x1b06 : mov (%eax,%edi,4),%edx 0x1b09 : inc %edx 0x1b0a : mov %edx,(%eax,%edi,4) 0x1b0d : mov %edx,0x1a654 0x1b13 : cmp 0xffffffc8(%ebp),%edx 0x1b16 : jg 0x1cd0 0x1b1c : mov 0xffffffc8(%ebp),%eax 0x1b1f : sub %edi,%eax 0x1b21 : lea 0x1(%eax),%ebx 0x1b24 : mov 0xffffffc8(%ebp),%eax 0x1b27 : sub %edx,%eax 0x1b29 : mov %ebx,0x1a624 0x1b2f : cmp %edx,%edi 0x1b31 : lea 0x1(%eax),%ecx 0x1b34 : mov %ecx,0x1a5e4 0x1b3a : je 0x1b01 0x1b3c : cmp %ecx,%edi 0x1b3e : je 0x1b01 0x1b40 : mov 0xf9a4(,%edx,4),%eax 0x1b47 : test %eax,%eax 0x1b49 : jne 0x1b01 0x1b4b : lea (%edx,%edi,1),%eax 0x1b4e : mov %eax,0xffffffe4(%ebp) 0x1b51 : mov 0x1a674(,%eax,4),%eax 0x1b58 : test %eax,%eax 0x1b5a : jne 0x1b01 0x1b5c : lea (%ecx,%edi,1),%esi 0x1b5f : mov %esi,0xffffffe0(%ebp) 0x1b62 : mov 0x1aa04(,%esi,4),%eax 0x1b69 : test %eax,%eax 0x1b6b : jne 0x1b01 0x1b6d : mov 0xf9a4(,%ecx,4),%esi 0x1b74 : test %esi,%esi 0x1b76 : jne 0x1b01 0x1b78 : lea (%ecx,%ebx,1),%esi 0x1b7b : mov 0x1a674(,%esi,4),%eax 0x1b82 : test %eax,%eax 0x1b84 : jne 0x1b01 0x1b8a : lea (%edx,%ebx,1),%eax 0x1b8d : mov %eax,0xffffffdc(%ebp) 0x1b90 : cmpl $0x0,0x1aa04(,%eax,4) 0x1b98 : jne 0x1b01 0x1b9e : cmpl $0x0,0xf9a4(,%edi,4) 0x1ba6 : jne 0x1b01 0x1bac : mov 0x1a674(,%eax,4),%eax 0x1bb3 : test %eax,%eax 0x1bb5 : jne 0x1b01 0x1bbb : mov 0xffffffe4(%ebp),%eax 0x1bbe : mov 0x1aa04(,%eax,4),%eax 0x1bc5 : test %eax,%eax 0x1bc7 : jne 0x1b01 0x1bcd : mov 0xf9a4(,%ebx,4),%eax 0x1bd4 : test %eax,%eax 0x1bd6 : jne 0x1b01 0x1bdc : mov 0xffffffe0(%ebp),%eax 0x1bdf : mov 0x1a674(,%eax,4),%eax 0x1be6 : test %eax,%eax 0x1be8 : jne 0x1b01 0x1bee : mov 0x1aa04(,%esi,4),%eax 0x1bf5 : test %eax,%eax 0x1bf7 : jne 0x1b01 0x1bfd : mov 0xfb44(,%edi,4),%eax 0x1c04 : mov %ebx,0xd270(,%edx,4) 0x1c0b : inc %eax 0x1c0c : mov %edi,0xd270(,%ecx,4) 0x1c13 : mov %eax,0xfb44(,%edi,4) 0x1c1a : mov %ecx,0xd270(,%ebx,4) 0x1c21 : mov $0xd0d0,%eax 0x1c26 : mov %edx,0xd270(,%edi,4) 0x1c2d : movl $0x1,0xf9a4(,%edx,4) 0x1c38 : movl $0x1,(%eax,%edi,4) 0x1c3f : movl $0x2,(%eax,%ebx,4) 0x1c46 : movl $0x1,0xf9a4(,%ecx,4) 0x1c51 : movl $0x2,(%eax,%edx,4) 0x1c58 : mov 0xffffffe4(%ebp),%edx 0x1c5b : movl $0x2,(%eax,%ecx,4) 0x1c62 : mov 0xffffffdc(%ebp),%ecx 0x1c65 : movl $0x1,0xf9a4(,%edi,4) 0x1c70 : movl $0x1,0xf9a4(,%ebx,4) 0x1c7b : mov 0xffffffe0(%ebp),%ebx 0x1c7e : movl $0x1,0x1a674(,%edx,4) 0x1c89 : movl $0x1,0x1aa04(,%ebx,4) 0x1c94 : movl $0x1,0x1a674(,%esi,4) 0x1c9f : movl $0x1,0x1aa04(,%ecx,4) 0x1caa : movl $0x1,0x1a674(,%ecx,4) 0x1cb5 : movl $0x1,0x1aa04(,%edx,4) 0x1cc0 : movl $0x1,0x1aa04(,%esi,4) 0x1ccb : jmp 0x1adb 0x1cd0 : dec %edi 0x1cd1 : mov %edi,0xffffffd8(%ebp) 0x1cd4 : mov %edi,0x1a5c4 0x1cda : mov %edi,%esi 0x1cdc : cmpl $0x1,0xd0d0(,%edi,4) 0x1ce4 : jne 0x1cd0 0x1ce6 : mov $0xd270,%eax 0x1ceb : mov 0xffffffc8(%ebp),%ecx 0x1cee : mov 0xffffffc8(%ebp),%edx 0x1cf1 : sub %edi,%ecx 0x1cf3 : mov (%eax,%edi,4),%ebx 0x1cf6 : inc %ecx 0x1cf7 : sub %ebx,%edx 0x1cf9 : add %ebx,%esi 0x1cfb : inc %edx 0x1cfc : movl $0x0,(%eax,%ebx,4) 0x1d03 : movl $0x0,0xd0d0(,%edi,4) 0x1d0e : movl $0x0,(%eax,%edx,4) 0x1d15 : mov %esi,0xffffffd4(%ebp) 0x1d18 : movl $0x0,(%eax,%ecx,4) 0x1d1f : mov %ebx,0x1a654 0x1d25 : mov $0xf9a4,%eax 0x1d2a : mov %edx,0x1a5e4 0x1d30 : movl $0x0,0xd0d0(,%ecx,4) 0x1d3b : movl $0x0,(%eax,%ebx,4) 0x1d42 : mov %ecx,0x1a624 0x1d48 : movl $0x0,(%eax,%edx,4) 0x1d4f : movl $0x0,(%eax,%edi,4) 0x1d56 : movl $0x0,(%eax,%ecx,4) 0x1d5d : mov $0x1a674,%eax 0x1d62 : movl $0x0,0xd0d0(,%ebx,4) 0x1d6d : movl $0x0,(%eax,%esi,4) 0x1d74 : add %ecx,%ebx 0x1d76 : lea (%edx,%ecx,1),%esi 0x1d79 : movl $0x0,0xd0d0(,%edx,4) 0x1d84 : movl $0x0,(%eax,%esi,4) 0x1d8b : add %edi,%edx 0x1d8d : movl $0x0,(%eax,%ebx,4) 0x1d94 : test %edi,%edi 0x1d96 : mov $0x1aa04,%eax 0x1d9b : movl $0x0,(%eax,%edx,4) 0x1da2 : mov 0xffffffd4(%ebp),%edx 0x1da5 : movl $0x0,(%eax,%ebx,4) 0x1dac : movl $0x0,(%eax,%edx,4) 0x1db3 : movl $0x0,(%eax,%esi,4) 0x1dba : jg 0x1b01 0x1dc0 : mov 0xd3fc,%eax 0x1dc5 : push %edx 0x1dc6 : push %edx 0x1dc7 : push %eax 0x1dc8 : push $0x15e3 0x1dcd : call 0x3be0 0x1dd2 : lea 0xfffffff4(%ebp),%esp 0x1dd5 : pop %ebx 0x1dd6 : pop %esi 0x1dd7 : pop %edi 0x1dd8 : pop %ebp 0x1dd9 : ret 0x1dda : mov 0xd3fc,%eax 0x1ddf : mov 0x1a5b4,%ebx 0x1de5 : inc %eax 0x1de6 : movl $0x0,0xffffffcc(%ebp) 0x1ded : mov %eax,0xd3fc 0x1df2 : cmp %ebx,0xffffffcc(%ebp) 0x1df5 : movl $0x0,0x1a9f4 0x1dff : jg 0x1e1e 0x1e01 : mov $0xfce4,%eax 0x1e06 : mov 0xffffffcc(%ebp),%esi 0x1e09 : movl $0x0,(%eax,%esi,4) 0x1e10 : inc %esi 0x1e11 : mov %esi,0xffffffcc(%ebp) 0x1e14 : mov %esi,0x1a9f4 0x1e1a : cmp %ebx,%esi 0x1e1c : jle 0x1e06 0x1e1e : movl $0x1,0xffffffcc(%ebp) 0x1e25 : mov 0xffffffc8(%ebp),%eax 0x1e28 : movl $0x1,0x1a9f4 0x1e32 : cmp %eax,0xffffffcc(%ebp) 0x1e35 : jg 0x1e70 0x1e37 : mov $0x63,%edx 0x1e3c : mov 0xffffffcc(%ebp),%ecx 0x1e3f : mov $0xd270,%esi 0x1e44 : mov %edx,%eax 0x1e46 : add $0x63,%edx 0x1e49 : add (%esi,%ecx,4),%eax 0x1e4c : mov 0x10c84(,%eax,4),%eax 0x1e53 : movl $0x1,0xfce4(,%eax,4) 0x1e5e : lea 0x1(%ecx),%eax 0x1e61 : mov 0xffffffc8(%ebp),%ecx 0x1e64 : mov %eax,0xffffffcc(%ebp) 0x1e67 : mov %eax,0x1a9f4 0x1e6c : cmp %ecx,%eax 0x1e6e : jle 0x1e3c 0x1e70 : xor %edx,%edx 0x1e72 : test %ebx,%ebx 0x1e74 : movl $0x0,0x1a644 0x1e7e : movl $0x1,0x1a9f4 0x1e88 : jle 0x1eaa 0x1e8a : mov $0x2,%ecx 0x1e8f : mov 0xfce0(,%ecx,4),%eax 0x1e96 : add %eax,%edx 0x1e98 : mov %ecx,%eax 0x1e9a : mov %edx,0x1a644 0x1ea0 : mov %eax,0x1a9f4 0x1ea5 : inc %ecx 0x1ea6 : cmp %ebx,%eax 0x1ea8 : jle 0x1e8f 0x1eaa : mov 0xd400,%esi 0x1eb0 : test %esi,%esi 0x1eb2 : je 0x1cd0 0x1eb8 : mov $0x1,%eax 0x1ebd : movl $0x1,0xf984 0x1ec7 : cmp 0xffffffc8(%ebp),%eax 0x1eca : jle 0x1ef0 0x1ecc : sub $0xc,%esp 0x1ecf : push $0x15f3 0x1ed4 : call 0x3c30 0x1ed9 : mov 0x1a5c4,%edi 0x1edf : mov 0x1a634,%ebx 0x1ee5 : add $0x10,%esp 0x1ee8 : mov %ebx,0xffffffc8(%ebp) 0x1eeb : jmp 0x1cd0 0x1ef0 : mov 0xd270(,%eax,4),%ecx 0x1ef7 : push %ebx 0x1ef8 : push %ebx 0x1ef9 : push %ecx 0x1efa : push $0x15f6 0x1eff : call 0x3be0 0x1f04 : mov 0xf984,%eax 0x1f09 : inc %eax 0x1f0a : add $0x10,%esp 0x1f0d : mov %eax,0xf984 0x1f12 : cmp 0x1a634,%eax 0x1f18 : jle 0x1ef0 0x1f1a : jmp 0x1ecc 0x1f1c : mov 0x1a5d4,%eax 0x1f21 : mov %eax,0xffffffd0(%ebp) 0x1f24 : jmp 0x1980 0x1f29 : neg %edx 0x1f2b : mov %edx,0xffffffc8(%ebp) 0x1f2e : mov %edx,0x1a634 0x1f34 : movl $0x1,0xd400 0x1f3e : jmp 0x16f0 0x1f43 : sub $0xc,%esp 0x1f46 : push $0x1600 0x1f4b : call 0x3c30 0x1f50 : movl $0x1,(%esp,1) 0x1f57 : call 0x3c60 0x1f5c : nop 0x1f5d : nop 0x1f5e : nop 0x1f5f : nop End of assembler dump. (gdb) quit ------------------------------------ now, I think, I needn't do the assembly listing with GCC. Let me write the important program lines : global arrays: int s2[999],Sym[99][99],R[99],C[99],Di1[222],Di2[222],Col[99],Node[99]; ... m55:r--;if(R[r]!=1)goto m55; // this line presumably starts at 0x1cd0 c=C[r]; // this line presumably starts at 0x1ce6 r2=n+1-r;c2=n+1-c; C[c]=0; // this line presumably starts at 0x1cfc,the crashing address we can get the registers : C:\DJGPP>qser3 16 1 5 Exiting due to signal SIGSEGV General Protection Fault at eip=00001cfc eax=0000d270 ebx=a00f0706 ecx=00000099 edx=5ff0f90b esi=a00f067e edi=ffffff78 ebp=0009cd60 esp=0009cd10 program=C:\DJGPP\QSER3.EXE cs: sel=00a7 base=10000000 limit=0009ffff ds: sel=00af base=10000000 limit=0009ffff es: sel=00af base=10000000 limit=0009ffff fs: sel=008f base=00026df0 limit=0000ffff gs: sel=00bf base=00000000 limit=0010ffff ss: sel=00af base=10000000 limit=0009ffff App stack: [0009cd80..0001cd80] Exceptn stack: [0001cce0..0001ada0] Call frame traceback EIPs: 0x00001cfc 0x000037a8 so, R is 0xd0d0 , r = edi = 0xffffff78 = -136 , eax=0xd270 = C (?) and presumably my assumption was incorrect that R[r] was pointing into the Sym array. The order of where the arrays are stored could have been affected by the small changes which changes the crashing behaviour. Or maybe indices were read from the code-area. Well, I could figure this all out by debugging the other versions with small changes, with -g , -o1 I've not yet done this, maybe later. --Guenter.