This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/60388] New: Program received signal SIGSEGV, Segmentation fault. 0xb7fb62ff in __pthread_create_2_1
- From: "sree.gooogle at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 02 Mar 2014 18:37:35 +0000
- Subject: [Bug c/60388] New: Program received signal SIGSEGV, Segmentation fault. 0xb7fb62ff in __pthread_create_2_1
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60388
Bug ID: 60388
Summary: Program received signal SIGSEGV, Segmentation fault.
0xb7fb62ff in __pthread_create_2_1
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: sree.gooogle at gmail dot com
Created attachment 32242
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32242&action=edit
c program used for Segmentation fault at line number 563 in pthread_create.c
Hi,
Please take a look at this issue. I have faced a SIGSEGV at line number 563 in
pthread_create.c. The program Crashed in the below fashion:
(gdb)s
514 in pthread_create.c
(gdb)
518 in pthread_create.c
(gdb)
563 in pthread_create.c
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0xb7fb62ff in __pthread_create_2_1 (newthread=0x0, attr=0x0,
start_routine=0x80484cc <mx_thrd>, arg=0x0) at pthread_create.c:563
563 in pthread_create.c
(gdb)
(gdb) bt
#0 0xb7fb62ff in __pthread_create_2_1 (newthread=0x0, attr=0x0,
start_routine=0x80484cc <mx_thrd>, arg=0x0) at pthread_create.c:563
#1 0x0804853c in main () at max_trd_creation.c:22
(gdb) i frame
Stack level 0, frame at 0xbffff670:
eip = 0xb7fb62ff in __pthread_create_2_1 (pthread_create.c:563); saved eip
0x804853c
called by frame at 0xbffff6a0
source language c.
Arglist at unknown address.
Locals at unknown address, Previous frame's sp is 0xbffff670
Saved registers:
ebx at 0xbffff65c, ebp at 0xbffff668, esi at 0xbffff660, edi at 0xbffff664,
eip at 0xbffff66c
(gdb)s
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
I am going through the below link for details about the line number 563 in
pthread_create.c
http://code.woboq.org/userspace/glibc/nptl/pthread_create.c.html
557 if (iattr->flags & ATTR_FLAG_SCHED_SET)
558 memcpy (&pd->schedparam, &iattr->schedparam,
559 sizeof (struct sched_param));
560 else if ((pd->flags & ATTR_FLAG_SCHED_SET) == 0)
561 {
562 INTERNAL_SYSCALL (sched_getparam, scerr, 2, 0, &pd->schedparam);
563 pd->flags |= ATTR_FLAG_SCHED_SET;
564 }
What is the gcc version which I have used?
==========================================
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)
How I compiled the program and what are all the options given and the warnings
produced?
===============================================================================
labro@ubuntu:~/Desktop/sree/DevUnix$ gcc max_trd_creation.c -g -lpthread
max_trd_creation.c: In function ÃmainÃ:
max_trd_creation.c:22:3: warning: passing argument 1 of Ãpthread_createà makes
pointer from integer without a cast [enabled by default]
In file included from max_trd_creation.c:2:0:
/usr/include/pthread.h:225:12: note: expected Ãpthread_t * __restrict__Ã but
argument is of type Ãpthread_tÃ
I have attached the piece of code which I have used for producing this seg
fault.
Kindly ignore this if you dot see something useful.
Thanks and Regards,
Sreenath