From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14660 invoked by alias); 28 Jul 2007 00:08:02 -0000 Received: (qmail 14642 invoked by uid 71); 28 Jul 2007 00:08:01 -0000 Resent-Date: 28 Jul 2007 00:08:01 -0000 Resent-Message-ID: <20070728000801.14641.qmail@sourceware.org> Resent-From: gdb-gnats@sources.redhat.com (GNATS Filer) Resent-To: nobody@sources.redhat.com Resent-Cc: gdb-prs@sources.redhat.com, Jim Blandy Resent-Reply-To: gdb-gnats@sources.redhat.com, Oleg V.Zhylin Received: (qmail 14584 invoked by uid 48); 28 Jul 2007 00:07:37 -0000 Message-Id: <20070728000737.14583.qmail@sourceware.org> Date: Sat, 28 Jul 2007 00:08:00 -0000 From: Oleg V.Zhylin Reply-To: Oleg V.Zhylin To: gdb-gnats@sources.redhat.com Cc: Jim Blandy X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: Jim Blandy Subject: threads/2292: GDB process stops when debugging threaded program Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00019.txt.bz2 >Number: 2292 >Category: threads >Synopsis: GDB process stops when debugging threaded program >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Jul 28 00:08:01 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Oleg V. Zhylin >Release: GDB CVS 2007-7-27 >Organization: >Environment: Fedora Core 7 >Description: The attached program makes GDB itself stop when run. >How-To-Repeat: Hi Jim, pthread_test.cpp demonstrates the problematic behavior. It is built using g++ -g pthread_test.cpp -lpthread The version numbers are $ cat /proc/version Linux version 2.6.21-1.3228.fc7 (kojibuilder@xenbuilder2.fedora.redhat.com) (gcc version 4.1.2 20070502 (Red Hat 4.1.2-12)) #1 SMP Tue Jun 12 15:37:31 EDT 2007 and gdb snapshot for July 24th $ gdb --version GNU gdb 6.6.50.20070724 Below is the log of gdb session $ gdb a.out GNU gdb 6.6.50.20070724 Copyright (C) 2007 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-linux-gnu"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /home/cartcs/Work/gdb/pthread_create/a.out [Thread debugging using libthread_db enabled] [New Thread 0xb7f336d0 (LWP 22251)] [3]+ Stopped gdb a.out >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/x-c++src; name="pthread_test.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="pthread_test.cpp" I2luY2x1ZGUgPHB0aHJlYWQuaD4NCiNpbmNsdWRlIDxzeXMvdGltZS5oPgoNCnZvaWQgU2xlZXAo dW5zaWduZWQgbG9uZyB1bE1pbGxpc2Vjb25kcykNCnsNCiAgICBzdHJ1Y3QgdGltZXZhbCB0aW1l b3V0Ow0KICAgIHRpbWVvdXQudHZfc2VjID0gMDsNCiAgICB0aW1lb3V0LnR2X3VzZWMgPSB1bE1p bGxpc2Vjb25kcyAqIDEwMDA7DQogICAgc2VsZWN0KDEsIE5VTEwsIE5VTEwsIE5VTEwsICZ0aW1l b3V0KTsNCn0gDQoNCnN0YXRpYyB2b2lkKiB0aHJlYWRGdW5jKCB2b2lkKiBscFBhcmFtICkgDQp7 DQogICBTbGVlcCgzMDAwKTsNCn0NCg0KaW50IG1haW4oKQ0Kew0KICBwdGhyZWFkX2F0dHJfdCBh dHRyOw0KDQogIGludAkJbjsNCiAgYm9vbCByZXMgPSBmYWxzZTsNCg0KICBpZiAoIChuID0gOjpw dGhyZWFkX2F0dHJfaW5pdCgmYXR0cikpICE9IDApDQogIHsNCiAgICByZXR1cm4gLTE7DQogIH0N CiAgcHRocmVhZF90IHRpZDsNCg0KICBpZiAoIChuID0gOjpwdGhyZWFkX2NyZWF0ZSgmdGlkLCAm YXR0ciwgdGhyZWFkRnVuYywgMCkpID09IDApDQogIHsNCg0KICAgIHJlcyA9IHRydWU7DQogIH0N Cg0KICBpZiAoIChuID0gOjpwdGhyZWFkX2F0dHJfZGVzdHJveSgmYXR0cikpICE9IDApDQogIHsN CiAgICByZXR1cm4gLTI7DQogIH0NCiAgaWYgKCFyZXMpDQogIHsNCiAgICByZXR1cm4gLTM7DQog IH0NCiAgU2xlZXAoNTAwMCk7DQoNCiAgcmV0dXJuIDA7DQp9Cg==