c/1496: gcc 2.95.2 results in runtime segmentation fault

murali@mpi-softtech.com murali@mpi-softtech.com
Fri Dec 22 03:56:00 GMT 2000


>Number:         1496
>Category:       c
>Synopsis:       gcc 2.95.2 results in runtime segmentation fault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 22 03:56:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     murali@mpi-softtech.com
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
sparc-sun-solaris2.7/2.95.2
>Description:
There is only one executable line in the code below. 
I used gcc test.c to compile i.e. no options. When I run,
I get a segmentation fault.

a.out
Segmentation Fault (core dumped)
>How-To-Repeat:
#include "stdio.h"

int main(void)
{
  int* a;
  int* b;

  *b = 3 ;

  return 0;
}
>Fix:
I tried to insert a line
int c;
between the two pointer declarations. Then, it works.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-prs mailing list