public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7
@ 2008-07-08 11:56 shal1783 at gmail dot com
  2008-07-08 12:11 ` [Bug libc/6728] " pasky at suse dot cz
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: shal1783 at gmail dot com @ 2008-07-08 11:56 UTC (permalink / raw)
  To: glibc-bugs

Hello,

When I tried to link my program using static it exited with seg fault in glibc-
2.7 but i didnt noticed same thing in glibc-2.3.I analysed this is becuse of 
using abort().

Here is sample test code..

$cat test_abort.c
#include  <stdio.h>
int main()
{
  abort();
}

$gcc -static -L/usr/glibcs/glibc-2.7/usr/lib -o test_abort test_abort.c 

$./test_abort 
Segmentation fault

When I tried same test with shared it didnt gave seg fault.
Also tested with glibc-2.3 and i didnt got seg fault with static and shared.


Thanks,
BOB

-- 
           Summary: abort() seg faults when statically linked in glibc-2.7
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: shal1783 at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=6728

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/6728] abort() seg faults when statically linked in glibc-2.7
  2008-07-08 11:56 [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7 shal1783 at gmail dot com
@ 2008-07-08 12:11 ` pasky at suse dot cz
  2008-07-08 12:22 ` halesh dot s at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pasky at suse dot cz @ 2008-07-08 12:11 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From pasky at suse dot cz  2008-07-08 12:10 -------
What architecture is this? Does it happen with the latest glibc release? I can't
reproduce it on i386 with glibc-2.8. By the way, abort() comes from <stdlib.h>,
not <stdio.h>.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6728

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/6728] abort() seg faults when statically linked in glibc-2.7
  2008-07-08 11:56 [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7 shal1783 at gmail dot com
  2008-07-08 12:11 ` [Bug libc/6728] " pasky at suse dot cz
@ 2008-07-08 12:22 ` halesh dot s at gmail dot com
  2008-07-08 12:25 ` shal1783 at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: halesh dot s at gmail dot com @ 2008-07-08 12:22 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From halesh dot s at gmail dot com  2008-07-08 12:21 -------
(In reply to comment #1)
> What architecture is this? Does it happen with the latest glibc release? I 
can't
> reproduce it on i386 with glibc-2.8. By the way, abort() comes from 
<stdlib.h>,
> not <stdio.h>.


Replaced stdio with stdlib, no effect.
$uname -a
Linux x86_server1 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 i686 i686 i386 GNU/
Linux

Here i got strace o/p, may be helpful.

$strace ./test_abort
........
........set_thread_area({entry_number:-1 -> 6, base_addr:0x8d2e830, 
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, 
seg_not_present:0, useable:1}) = 0
brk(0x8d4fcb0)                          = 0x8d4fcb0
brk(0x8d50000)                          = 0x8d50000
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
gettid()                                = 16743
tgkill(0, 16743, SIGABRT)               = -1 EINVAL (Invalid argument)
rt_sigaction(SIGABRT, {SIG_DFL}, NULL, 8) = 0
tgkill(0, 16743, SIGABRT)               = -1 EINVAL (Invalid argument)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


I will try with glibc-2.8.

Thanks.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6728

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/6728] abort() seg faults when statically linked in glibc-2.7
  2008-07-08 11:56 [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7 shal1783 at gmail dot com
  2008-07-08 12:11 ` [Bug libc/6728] " pasky at suse dot cz
  2008-07-08 12:22 ` halesh dot s at gmail dot com
@ 2008-07-08 12:25 ` shal1783 at gmail dot com
  2008-07-08 12:41 ` drepper at redhat dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: shal1783 at gmail dot com @ 2008-07-08 12:25 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From shal1783 at gmail dot com  2008-07-08 12:25 -------
(In reply to comment #1)
> What architecture is this? Does it happen with the latest glibc release? I 
can't
> reproduce it on i386 with glibc-2.8. By the way, abort() comes from 
<stdlib.h>,
> not <stdio.h>.

Hello,

I am using i686.
tried to upgrade with glibc-2.7.
I found this issue.

Thanks,
BOB


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6728

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/6728] abort() seg faults when statically linked in glibc-2.7
  2008-07-08 11:56 [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7 shal1783 at gmail dot com
                   ` (2 preceding siblings ...)
  2008-07-08 12:25 ` shal1783 at gmail dot com
@ 2008-07-08 12:41 ` drepper at redhat dot com
  2008-07-08 13:45 ` halesh dot s at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: drepper at redhat dot com @ 2008-07-08 12:41 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2008-07-08 12:41 -------
I see no problem.  It must be either old code or an incorrect build on your side.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME


http://sourceware.org/bugzilla/show_bug.cgi?id=6728

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/6728] abort() seg faults when statically linked in glibc-2.7
  2008-07-08 11:56 [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7 shal1783 at gmail dot com
                   ` (3 preceding siblings ...)
  2008-07-08 12:41 ` drepper at redhat dot com
@ 2008-07-08 13:45 ` halesh dot s at gmail dot com
  2008-07-08 13:51 ` halesh dot s at gmail dot com
  2008-07-09  7:47 ` halesh dot s at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: halesh dot s at gmail dot com @ 2008-07-08 13:45 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From halesh dot s at gmail dot com  2008-07-08 13:44 -------
(In reply to comment #4)
> I see no problem.  It must be either old code or an incorrect build on your 
side.

Hi,

I checked this testcode against gilbc 2.3, 2.5 and 2.7

Please check the below o/p

$ gcc -g -static -L /home/halesh/glibc-2.5/usr/lib abort_t.c 
Aborted

$ gcc -g -static -L /home/halesh/glibc-2.7/usr/lib abort_t.c
Segmentation fault

$ gcc -g static abort_t.c  <- glibc-2.3
Aborted

When i went still more deep..

GDB O/P for glibc-2.7
-----------------------
.................
.................
raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:34
34        pid_t pid = THREAD_GETMEM (pd, pid);
(gdb)
36        pid_t selftid = THREAD_GETMEM (pd, tid);
(gdb)
37        if (selftid == 0)
(gdb)
67        int res = INLINE_SYSCALL (tgkill, 3, THREAD_GETMEM(pd, pid), selftid, 
sig);
(gdb)
68        if (res != -1 || errno != ENOSYS)
(gdb)
69          return res;
(gdb)
73      }
(gdb)
abort () at abort.c:121
121       if (stage == 6)
(gdb)
123           ++stage;
(gdb)
124           ABORT_INSTRUCTION;
(gdb)

Program received signal SIGSEGV, Segmentation fault.
abort () at abort.c:124
124           ABORT_INSTRUCTION;
........................
........................


GDB O/P for glibc-2.5
-----------------------
.................
.................
raise (sig=0) at ../nptl/sysdeps/unix/sysv/linux/raise.c:31
31      {
(gdb)
34        pid_t pid = THREAD_GETMEM (pd, pid);
(gdb)
36        pid_t selftid = THREAD_GETMEM (pd, tid);
(gdb)
37        if (selftid == 0)
(gdb)
42            selftid = INTERNAL_SYSCALL (gettid, err, 0);
(gdb)
46            THREAD_SETMEM (pd, tid, selftid);
(gdb)
51            pid = selftid;
(gdb)
64        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb)

Program received signal SIGABRT, Aborted.
..............................
..............................


There is difference in raise.c, is it old code in 2.7?


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6728

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/6728] abort() seg faults when statically linked in glibc-2.7
  2008-07-08 11:56 [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7 shal1783 at gmail dot com
                   ` (4 preceding siblings ...)
  2008-07-08 13:45 ` halesh dot s at gmail dot com
@ 2008-07-08 13:51 ` halesh dot s at gmail dot com
  2008-07-09  7:47 ` halesh dot s at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: halesh dot s at gmail dot com @ 2008-07-08 13:51 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From halesh dot s at gmail dot com  2008-07-08 13:50 -------
I think this is releated to this debian bug

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=414795

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6728

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/6728] abort() seg faults when statically linked in glibc-2.7
  2008-07-08 11:56 [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7 shal1783 at gmail dot com
                   ` (5 preceding siblings ...)
  2008-07-08 13:51 ` halesh dot s at gmail dot com
@ 2008-07-09  7:47 ` halesh dot s at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: halesh dot s at gmail dot com @ 2008-07-09  7:47 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From halesh dot s at gmail dot com  2008-07-09 06:27 -------
(In reply to comment #4)
> I see no problem.  It must be either old code or an incorrect build on your 
side.

Apologies, Confirmed..this was old code. and it works in 2.5,2.7&...

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6728

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-07-09  7:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-08 11:56 [Bug libc/6728] New: abort() seg faults when statically linked in glibc-2.7 shal1783 at gmail dot com
2008-07-08 12:11 ` [Bug libc/6728] " pasky at suse dot cz
2008-07-08 12:22 ` halesh dot s at gmail dot com
2008-07-08 12:25 ` shal1783 at gmail dot com
2008-07-08 12:41 ` drepper at redhat dot com
2008-07-08 13:45 ` halesh dot s at gmail dot com
2008-07-08 13:51 ` halesh dot s at gmail dot com
2008-07-09  7:47 ` halesh dot s at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).