Bug 77804

Summary: gcc: Internal error: Segmentation fault (program as)
Product: [Retired] Red Hat Linux Reporter: Need Real Name <hahnsang.kim>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i586   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-02 20:40:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

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:

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");
        if ((s = strchr(hp->h_name, '.')) != NULL) {
        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.