🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1256

One Program Always Triggers Segmentation Faults

#1256
From: Vale Group
Date: Thu, 10 Mar 2005 22:46
60 lines
4021 bytes
I have one program which has been exhibiting a problem for months.  The program
compiles and links without errors or warnings with gcc version 3.3.3. When I run
it in the gdb debugger, it always stops near the beginning with a segmentation
fault.  There appears to be a corruption of the heap memory; the point of
failure moves as I change the source code of the program.

The program (too large and proprietary to reproduce here) runs fine outside of
the gdb debugger.  It runs fine when compiled with Borland version 5.6.4. It
runs fine in the Borland Turbo Debugger.  Borland's Code Guard reports no memory
problems.

Here's the condensed output of a run with gdb:
$ gdb
GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special)

(gdb) r
Program received signal SIGSEGV, Segmentation fault.
0xbff7a606 in KERNEL32!Heap32ListNext ()
   from /cygdrive/c/WINDOWS/SYSTEM/KERNEL32.DLL

(gdb) bt
#0  0xbff7a606 in KERNEL32!Heap32ListNext ()
   from /cygdrive/c/WINDOWS/SYSTEM/KERNEL32.DLL
#1  0x00000013 in ?? ()
#2  0x00e6813c in ?? ()
#3  0x00000012 in ?? ()
#4  0xffffffff in ?? ()
#5  0x00c2e890 in ?? ()
#6  0x81a71ad4 in ?? ()
#7  0x83d8d038 in ?? ()
#8  0xbffc05b4 in ?? () from /cygdrive/c/WINDOWS/SYSTEM/KERNEL32.DLL
#9  0xbff79260 in KERNEL32!BuildCommDCBAndTimeoutsA ()
   from /cygdrive/c/WINDOWS/SYSTEM/KERNEL32.DLL
#10 0x00000000 in ?? () from

(gdb) info threads
  3 thread -502221.0xfff65693  0xbff99b32 in SetThreadExecutionState ()
   from /cygdrive/c/WINDOWS/SYSTEM/KERNEL32.DLL
  2 thread -502221.0xfff7e84f  0x610997cc in sigfillset ()
   from /usr/bin/cygwin1.dll
* 1 thread -502221.0xfff60c9f  0xbff7a606 in KERNEL32!Heap32ListNext ()
   from /cygdrive/c/WINDOWS/SYSTEM/KERNEL32.DLL


The program will resume (with numerous segmentation faults) if I 'continue.'
The segmentation faults are always the same, "0xbff7a606 in
KERNEL32!Heap32ListNext ()."

Other programs run in the gdb debugger just fine.  The same results are observed
if I use the Insight interface to the gdb debugger. There is some nasty
interaction between this particular program and gdb.  I wish that I could tell
you what changed 5 or 6 months ago and brought on this behavior, but I can't.

I'm using the Windows 98SE operating system.  KERNEL32 is version 4.10.2222,
dated 4/23/99.  The Cygwin engine is version 1.5.13-1. There is only one version
of cygwin1.dll on my machine.

What path of investigation do you recommend that I take from here?

Chuck
Technical Details
Message-ID: <mailman.3382.1110497454.32256.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,c532fffdf4e303d5,start
X-Google-Attributes: gidf5053,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
From: "Vale Group" <valegroup@att.net>
Newsgroups: gnu.gdb.bug
Subject: One Program Always Triggers Segmentation Faults
Date: Thu, 10 Mar 2005 14:46:46 -0800
Lines: 63
Approved: bug-gdb@gnu.org
Message-ID: <mailman.3382.1110497454.32256.bug-gdb@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: text/plain;
 charset="Windows-1252"
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1110496555 2752 199.232.76.165 (10 Mar 2005 23:15:55 GMT)
X-Complaints-To: news@news.stanford.edu
To: <bug-gdb@gnu.org>
Envelope-to: bug-gdb@gnu.org
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4942.400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4942.400
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>