delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/09/15:46:07

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
X-Authentication-Warning: eos.vss.fsi.com: ford owned process doing -bs
Date: Thu, 9 Jan 2003 14:45:30 -0600 (CST)
From: Brian Ford <ford AT vss DOT fsi DOT com>
X-X-Sender: ford AT eos
To: cygwin AT cygwin DOT com
Subject: gdb attach hang (w/pthreads on Cygwin)
Message-ID: <Pine.GSO.4.44.0301091440170.12926-100000@eos>
MIME-Version: 1.0

gdb on Cygwin can not attach to a running process if the main thread has
exited via a call to pthread_exit().  The attach just hangs.

Here is the  test case: w/o GDB_HANG defined, all is well; with GDB_HANG
defined, attaching is not possible.

#include <pthread.h>
#include <unistd.h>

void *
spinner(void *v)
{
    for (;;) sleep(500);

    return NULL;
}

int
main(void)
{
    pthread_t tid;

    pthread_create(&tid, NULL, spinner, NULL);
#ifdef GDB_HANG
    pthread_exit(NULL);
#else
    for (;;) sleep(500);
#endif

    return 0;
}

Thanks.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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