* platform difference with threads -- help
@ 2001-08-06 17:07 John Van Horne
2001-08-06 17:52 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: John Van Horne @ 2001-08-06 17:07 UTC (permalink / raw)
To: gdb; +Cc: jvhorne
Hi,
I've got two PowerPC Linux platforms -- one is a G4 Macintosh, the other
is one of my employer's products. Both are running Linux kernel 2.4.2.
A while ago I built the 6/27/2001 snapshot of GDB on the G4.
Now I've got a simple test program:
#include <pthread.h>
#include <stdio.h>
void *do_thread(void *arg)
{
while(1);
return NULL;
}
void *do_bad_thread(void *arg)
{
int *x;
x=1;
printf("bad number: %d\n", *x);
return NULL;
}
int main(int argc, char **argv)
{
int i;
pthread_t ptid;
for( i=0; i<4; i++ )
{
pthread_create(&ptid, NULL, do_thread, NULL);
}
pthread_create(&ptid, NULL, do_bad_thread, NULL );
}
When I run the program under GDB on the G4, it works just fine:
[jvhorne@g4-1 ppcutils]$ uname -a
Linux g4-1.os.eng.cosinecom.com 2.4.2 #9 Fri Mar 30 16:43:45 PST 2001 ppc
unknown
[jvhorne@g4-1 ppcutils]$ /usr/local/bin/gdb gdb_thread_test
GNU gdb 20010627
Copyright 2001 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 "powerpc-unknown-linux-gnu"...
(gdb) run
Starting program: /dvlp/jvhorne/ppcutils/gdb_thread_test
[New Thread 1024 (runnable)]
[New Thread 2049 (runnable)]
[New Thread 1026 (runnable)]
[New Thread 2051 (runnable)]
[New Thread 3076 (runnable)]
[New Thread 4101 (runnable)]
[New Thread 5126 (runnable)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 5126 (runnable)]
0x100004e8 in do_bad_thread (arg=0x0) at gdb_thread_test.c:15
15 printf("bad number: %d\n", *x);
(gdb)
But when I run it on the product I get:
sh-2.03$ uname -a
Linux blade3_pe0.cosine 2.4.2 #45 Mon Aug 6 10:18:17 PDT 2001 ppc unknown
sh-2.03$ ./gdb gdb_thread_test
GNU gdb 20010627
Copyright 2001 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 "powerpc-unknown-linux-gnu"...
(gdb) run
Starting program: /home/sharc/gdb_thread_test
Program received signal SIG32, Real-time event 32.
0x0fedf224 in __syscall_rt_sigsuspend () from /lib/libc.so.6
(gdb)
I can continue passed this until:
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x0fedf224 in __syscall_rt_sigsuspend () from /lib/libc.so.6
(gdb)
Can anyone help me figure out why the behavior is different on the two
platforms? The kernel
version is the same. The test program is the same, and the GDB is the same.
I also have the
same libraries on both platforms.
BTW, when I try using GDB 4.18, it does not have this difference between the
two platforms.
Thanks for any help,
-John
John Van Horne
CoSine Communications, Inc.
jvhorne@cosinecom.com
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: platform difference with threads -- help
2001-08-06 17:07 platform difference with threads -- help John Van Horne
@ 2001-08-06 17:52 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2001-08-06 17:52 UTC (permalink / raw)
To: John Van Horne; +Cc: gdb, jvhorne
On Mon, Aug 06, 2001 at 05:07:40PM -0700, John Van Horne wrote:
> Hi,
>
> I've got two PowerPC Linux platforms -- one is a G4 Macintosh, the other
> is one of my employer's products. Both are running Linux kernel 2.4.2.
> But when I run it on the product I get:
>
> sh-2.03$ uname -a
> Linux blade3_pe0.cosine 2.4.2 #45 Mon Aug 6 10:18:17 PDT 2001 ppc unknown
> sh-2.03$ ./gdb gdb_thread_test
> GNU gdb 20010627
> Copyright 2001 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 "powerpc-unknown-linux-gnu"...
> (gdb) run
> Starting program: /home/sharc/gdb_thread_test
>
> Program received signal SIG32, Real-time event 32.
> 0x0fedf224 in __syscall_rt_sigsuspend () from /lib/libc.so.6
> (gdb)
>
> I can continue passed this until:
>
> (gdb) c
> Continuing.
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0fedf224 in __syscall_rt_sigsuspend () from /lib/libc.so.6
> (gdb)
>
>
> Can anyone help me figure out why the behavior is different on the two
> platforms? The kernel
> version is the same. The test program is the same, and the GDB is the same.
> I also have the
> same libraries on both platforms.
Do you really? Is there a libthread_db installed on your target
system? This looks as if the thread module is not initialized.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-06 17:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-06 17:07 platform difference with threads -- help John Van Horne
2001-08-06 17:52 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox