public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/15399] New: static link causes segfault under gdb when call is used
@ 2004-05-13  7:42 tosa at nmr dot mgh dot harvard dot edu
  2004-05-13  9:04 ` [Bug debug/15399] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tosa at nmr dot mgh dot harvard dot edu @ 2004-05-13  7:42 UTC (permalink / raw)
  To: gcc-bugs

The following program exhibits the "segfault" under gcc3.2.2 and gdb 5.3post-0.

I would appreciate it very much if you could test at the current version
of gcc.

Compile the program as (statically link with libc.a):

        gcc -static -g -o test test.c

Run test under gdb and put a break point at printf().  When you do 
        
        gdb> call arrayPrint(array,5)

you get  

Program received signal SIGSEGV, Segmentation fault.
0x0804827c in __libc_start_main ()
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.

This problem did not occur under gcc2.96.   

Workaround: link with libc.so (this problem won't occur).

---------------- simple program test.c ------------------
#include <stdio.h>
#include <stdlib.h>
    
void arrayPrint(const int *array, int size)
{
  int i;
  printf("\n");
  for (i=0; i < size; ++i)
    printf("%d ", array[i]);
  printf("\n");
}
    
int main(int argc, char *argv[])
{
  int array[5];
  int i;
    
  for (i=0; i < 5; ++i)
    array[i] = i;
    
  arrayPrint(array, 5);
  printf("put break point here\n");
  return 0;
}

-- 
           Summary: static link causes segfault under gdb when call is used
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tosa at nmr dot mgh dot harvard dot edu
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15399


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

* [Bug debug/15399] static link causes segfault under gdb when call is used
  2004-05-13  7:42 [Bug debug/15399] New: static link causes segfault under gdb when call is used tosa at nmr dot mgh dot harvard dot edu
@ 2004-05-13  9:04 ` pinskia at gcc dot gnu dot org
  2004-05-13 11:37 ` tosa at nmr dot mgh dot harvard dot edu
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-13  9:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-12 16:41 -------
This works for me with gcc 3.2.2 and gdb 5.1.90CVS-3 and gdb 2004-04-17-cvs so this must be a 
bug in the version of gdb you are using.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15399


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

* [Bug debug/15399] static link causes segfault under gdb when call is used
  2004-05-13  7:42 [Bug debug/15399] New: static link causes segfault under gdb when call is used tosa at nmr dot mgh dot harvard dot edu
  2004-05-13  9:04 ` [Bug debug/15399] " pinskia at gcc dot gnu dot org
@ 2004-05-13 11:37 ` tosa at nmr dot mgh dot harvard dot edu
  2004-05-13 11:40 ` tosa at nmr dot mgh dot harvard dot edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tosa at nmr dot mgh dot harvard dot edu @ 2004-05-13 11:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tosa at nmr dot mgh dot harvard dot edu  2004-05-12 21:37 -------
Subject: Re:  static link causes segfault under gdb when
 call is used

Hi,

I disagree with the change.

I confirmed that this happens on three platform (my report is
on RedHat 9) thanks to my friend who has the following systems:

Gentoo:      2.6.5-gentoo-r1, gcc 3.3.2, gdb 6.0
Mandrake:  2.6.3-4mdk,       gcc 3.3.2, gdb 6.0-2mdk

Please be careful.   If you compiled with shared libc.so, then
you don't see the problem.   Please check the executable by ldd.

Thanks.

Tosa

pinskia at gcc dot gnu dot org wrote:

>------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-12 16:41 -------
>This works for me with gcc 3.2.2 and gdb 5.1.90CVS-3 and gdb 2004-04-17-cvs so this must be a 
>bug in the version of gdb you are using.
>
>  
>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15399


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

* [Bug debug/15399] static link causes segfault under gdb when call is used
  2004-05-13  7:42 [Bug debug/15399] New: static link causes segfault under gdb when call is used tosa at nmr dot mgh dot harvard dot edu
  2004-05-13  9:04 ` [Bug debug/15399] " pinskia at gcc dot gnu dot org
  2004-05-13 11:37 ` tosa at nmr dot mgh dot harvard dot edu
@ 2004-05-13 11:40 ` tosa at nmr dot mgh dot harvard dot edu
  2004-05-13 11:46 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tosa at nmr dot mgh dot harvard dot edu @ 2004-05-13 11:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tosa at nmr dot mgh dot harvard dot edu  2004-05-12 21:43 -------
Please be careful for verifying.  Did you check with ldd for the executable.
I now confirmed that this happens on two more platforms with gcc 3.3.2:

Gentoo      : 2.6.5-gentoo-r1,   gcc 3.3.2,   gdb 6.0
Mandrake 10 : 2.6.3-4mdk,        gcc 3.3.2,   gdb 6.0-2mdk

Note that gcc --static -g -o test test.c   
(not -static.   my typo).

Thank you.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15399


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

* [Bug debug/15399] static link causes segfault under gdb when call is used
  2004-05-13  7:42 [Bug debug/15399] New: static link causes segfault under gdb when call is used tosa at nmr dot mgh dot harvard dot edu
                   ` (2 preceding siblings ...)
  2004-05-13 11:40 ` tosa at nmr dot mgh dot harvard dot edu
@ 2004-05-13 11:46 ` pinskia at gcc dot gnu dot org
  2004-05-13 11:51 ` pinskia at gcc dot gnu dot org
  2004-05-14  7:54 ` tosa at nmr dot mgh dot harvard dot edu
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-13 11:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-12 22:54 -------
Note a gcc bug, I tried it with --static and it worked still.  I am using glibc 2.2.5 so this is a glibc if it is 
any.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15399


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

* [Bug debug/15399] static link causes segfault under gdb when call is used
  2004-05-13  7:42 [Bug debug/15399] New: static link causes segfault under gdb when call is used tosa at nmr dot mgh dot harvard dot edu
                   ` (3 preceding siblings ...)
  2004-05-13 11:46 ` pinskia at gcc dot gnu dot org
@ 2004-05-13 11:51 ` pinskia at gcc dot gnu dot org
  2004-05-14  7:54 ` tosa at nmr dot mgh dot harvard dot edu
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-13 11:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-12 23:10 -------
Just to let you know:
tin:~/src/gnu/gcctest>ldd a.out
        not a dynamic executable

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15399


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

* [Bug debug/15399] static link causes segfault under gdb when call is used
  2004-05-13  7:42 [Bug debug/15399] New: static link causes segfault under gdb when call is used tosa at nmr dot mgh dot harvard dot edu
                   ` (4 preceding siblings ...)
  2004-05-13 11:51 ` pinskia at gcc dot gnu dot org
@ 2004-05-14  7:54 ` tosa at nmr dot mgh dot harvard dot edu
  5 siblings, 0 replies; 7+ messages in thread
From: tosa at nmr dot mgh dot harvard dot edu @ 2004-05-14  7:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tosa at nmr dot mgh dot harvard dot edu  2004-05-13 14:36 -------
Subject: Re:  static link causes segfault under gdb when
 call is used

Hi,

I'm very curious about what is different on your system about static libc or
anything different from the popular Linux release.

Note that RedHat 9, Gentoo, Mandrake 10 are having the same problem
(using different Linux 2.4 and 2.6).

Thank you.

What I have is the RedHat version (RedHat 9):
GNU C Library stable release version 2.3.2, by Roland McGrath et al.
Compiled by GNU CC version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
        GNU libio by Per Bothner

Tosa

pinskia at gcc dot gnu dot org wrote:

>------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-12 23:10 -------
>Just to let you know:
>tin:~/src/gnu/gcctest>ldd a.out
>        not a dynamic executable
>
>  
>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15399


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

end of thread, other threads:[~2004-05-13 14:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-13  7:42 [Bug debug/15399] New: static link causes segfault under gdb when call is used tosa at nmr dot mgh dot harvard dot edu
2004-05-13  9:04 ` [Bug debug/15399] " pinskia at gcc dot gnu dot org
2004-05-13 11:37 ` tosa at nmr dot mgh dot harvard dot edu
2004-05-13 11:40 ` tosa at nmr dot mgh dot harvard dot edu
2004-05-13 11:46 ` pinskia at gcc dot gnu dot org
2004-05-13 11:51 ` pinskia at gcc dot gnu dot org
2004-05-14  7:54 ` tosa at nmr dot mgh dot harvard dot edu

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).