This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

KERNEL32!IsBadWritePtr () error raised while debugging thread test program.


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@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@ubist.com <= Preferred
                 kkurts@yahoo.com
====================================================================

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]