bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GDB 4.18 and thread stack


From: FLETERF
Subject: GDB 4.18 and thread stack
Date: Mon, 13 Nov 2000 17:06:18 +0100


 GDB 4.18 (LINUX Mandrake 7.1) seems to have a bug
 to report the stack of a thread having a page fault.
 When I run the below simple program, the commande "where"
 of GDB does not report the stack of the faulty thread.

 Does the GDB 5.0 fix this pb ?
 Does a previous version of 4.18 not contain this pb ?

--------------------------------------------------------------
The program triggering a page fault in a thread
--------------------------------------------------------------
/*
 * Compilation command :
 *
 *       gcc hello2.c -lpthread  -lc -g -o hello2
 *
 */
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

void print_message_function( char *ptr );

main()
{
     pthread_t thread;
     char *message = "Hello World \n";

     print_message_function(message) ;

     pthread_create( &thread, NULL,(void *) &print_message_function, (void
*) NULL);

     while(1) ;
}

void print_message_function( char *ptr )
{
     if (ptr)
        printf("%s",ptr) ;
     else
        printf("%s ",  * ptr);   /* page fault here with NULL argument */
}



-----------------------------------
Result under GDB 4.18
-----------------------------------
address@hidden threads]$
address@hidden threads]$ gdb hello2
GNU gdb 4.18
Copyright 1998 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 "i586-mandrake-linux"...
(gdb) run
Starting program: /home/fleter/src/divers/threads/hello2
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Hello World

Program received signal SIG32, Real-time event 32.
0x4004e13e in sigsuspend () from /lib/libc.so.6
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x400242c4 in pthread_setconcurrency () from /lib/libpthread.so.0
(gdb) where
#0  0x400242c4 in pthread_setconcurrency () from /lib/libpthread.so.0
#1  0x400241b0 in pthread_setconcurrency () from /lib/libpthread.so.0
#2  0x40024459 in pthread_create () from /lib/libpthread.so.0
#3  0x80484ae in main () at hello2.c:17
(gdb)









reply via email to

[Prev in Thread] Current Thread [Next in Thread]