delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/15/22:51:09

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <003301c4235d$99229e50$4f2e6ade@jsong>
From: "Jeremy Song" <jeremy AT ubist DOT co DOT kr>
To: <cygwin AT cygwin DOT com>
Subject: KERNEL32!IsBadWritePtr () error raised while debugging thread test program.
Date: Fri, 16 Apr 2004 11:50:38 +0900
MIME-Version: 1.0
X-IsSubscribed: yes
Note-from-DJ: This may be spam
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id i3G2p6ir031340

I made a simple multi-threaded application with g++ for cygwin and it runs well but if I try to debug my program, it shows just SIGSEGV Segmentation fault like the following. I can't even get into the main though...If I move out the lines for creating threads, it works fine.

-------------------------------------------------------------------------
[kkurt AT jsong:~]$gdb thread2
GNU gdb 2003-09-20-cvs (cygwin-special)
Copyright 2003 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 "i686-pc-cygwin"...
(gdb) l 50,

50      
51      int main(int argc, char* argv[])
52      {
53              cout << "starting main thread" << endl;
54              Thread *th = new Father(0, 100);
55              th->detach();
56              Thread::sleep(7000);
57              cout << "ending main thread" << endl;
58      
59              return 0;
60      }
(gdb) b 53
Breakpoint 1 at 0x4010c1: file thread2.cpp, line 53.
(gdb) r
Starting program: /home/kkurt/thread2.exe 

Program received signal SIGSEGV, Segmentation fault.
0x77e35a3f in KERNEL32!IsBadWritePtr () from /cygdrive/c/WINDOWS/system32/kernel32.dll
(gdb) bt
#0  0x77e35a3f in KERNEL32!IsBadWritePtr () from /cygdrive/c/WINDOWS/system32/kernel32.dll
(gdb) 
-----------------------------------------------------------------------


I tried to find out what makes that kind of error raised, but failed.

Anyone has an idea on that? Thanks in advance.

Jeremy.


====================================================================

     Jeremy Song
     Team Lead of Mobile Technologies, UBIST Co. 
 
     Doo-Won Bld. 7th flr, Shin-Sah-Dong, Kang-Nam-Gu,
     Seoul, Republic of Korea

     Work   :  +82-2-3442-3559
     FAX    :   +82-2-3442-3519
    Mobile : +82-16-9703-9939
    E-Mail : kkurt AT ubist DOT com <= Preferred
                 kkurts AT yahoo DOT com
====================================================================

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019