Bug 77804 - gcc: Internal error: Segmentation fault (program as)
Summary: gcc: Internal error: Segmentation fault (program as)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 8.0
Hardware: i586
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-13 21:08 UTC by Need Real Name
Modified: 2007-04-18 16:48 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-10-02 20:40:54 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2002-11-13 21:08:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823
Netscape/7.0

Description of problem:
When I tried to compile a very simple program to call ipv6 related
functions,including gethostbyname2, gethostbyname2_r, or getipnodebyname,
a problem happened.
You can find what i encountered in the following:

[garros@ipv6 ip6test]$ gcc -o gethostbyname2 gethostbyname2.c
gcc: Internal error: Segmentation fault (program as)
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


For saving your effort, I have enclosed my simple progam that i tested.
In addition, I used 'gcc version 3.2 20020903' on redhat 8.0 (kernel 2.4.18-4).


How reproducible:
Always

Steps to Reproduce:
1.gcc gethostbyname2.c


Additional info:

# This is gethostbyname2.c
#
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
 
main(int argc, char **argv)
{
        struct hostent  *hp;
        char *s;
        char dname[40];
 
/*      if((hp=getipnodebyname(argv[1],AF_INET6,0,err_num))==(struct hostent
*)NULL) { */
        if((hp=gethostbyname2(argv[1],AF_INET6))==(struct hostent *)NULL) {
/*      if(gethostbyname2_r(argv[1],AF_INET6,hp,NULL,0,NULL,NULL)==NULL){ */
        fprintf(stderr,"Error occurred.\n");
        exit(1);
        }
        if ((s = strchr(hp->h_name, '.')) != NULL) {
                strcpy(dname,++s);
          }
        fprintf(stdout,"hostname = %s,  domainname = %s\n",hp->h_name,dname);
        fprintf(stderr,"h_addrtype = %d, h_length = %d, h_addr = %s\n",
hp->h_addrtype, hp->h_length, hp->h_addr);
}

Comment 1 Jakub Jelinek 2002-11-13 21:36:57 UTC
Cannot reproduce it.
Furthermore, from your error message it is gas, not gcc which segfaults, so
you'd need attach assembly which as is segfaulting on (reproduceably).

Comment 2 Need Real Name 2002-11-14 08:51:11 UTC
I hardly understand your comment. Then what is your suggestion or your solution?
What does it mean by "attach assebly"?

by the way, the following tells me that internal error happened in gcc, doesn't it?

++

[garros@ip6 ip6test]$ gcc gethostbyname2.c
gcc: Internal error: Segmentation fault (program as)
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
[garros@ip6 ip6test]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

Comment 3 Michael Lee Yohe 2002-11-14 15:44:37 UTC
I have also been unable to reproduce this problem with the source code you
provided.  You might want to run a thorough stress test on your system to ensure
it is not hardware related.  Many gcc faults can be credited to quirky hardware.
 "memtest86" is a good start - http://www.memtest86.com

Comment 4 Jakub Jelinek 2002-11-20 09:40:13 UTC
It tells you program as segfaulted and thus gcc driver couldn't build the program.
By attaching assembly I mean that you do:
gcc -S gethostbyname2.c
and attach gethostbyname2.s it creates, provided that running
as -o gethostbyname2.o gethostbyname2.s
segfaults reproduceably.
If not, it is most probably hardware problem.

Comment 5 Jakub Jelinek 2004-10-02 20:40:54 UTC
No feedback, closing.


Note You need to log in before you can comment on or make changes to this bug.