Bug 131679

Summary: Compiling in 64-bit yields segmentation fault when program run, 32-bit compilation is fine
Product: [Fedora] Fedora Reporter: Fred Huang <dafrabbit>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 2   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-03 07:41:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The test file that I was testing 64-bit compilation with. none

Description Fred Huang 2004-09-03 03:47:30 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Gecko/20040808 Firefox/0.9.3

Description of problem:
Compiling a simple C program with gcc in 64-bit mode. When the program
is run, it seg faults. GDB reports:

Program received signal SIGSEGV, Segmentation fault.
0x000000344026e3a0 in strlen () from /lib64/tls/libc.so.6

Backtrace:
#0  0x000000344026e3a0 in strlen () from /lib64/tls/libc.so.6
#1  0x0000003440240a01 in vfprintf () from /lib64/tls/libc.so.6
#2  0x0000000000400570 in io_vprint ()
#3  0x0000000000400644 in io_printf ()
#4  0x00000000004006cc in main ()

When the same C program is compiled with gcc but in 32-bit mode (with
the flag -m32) it works fine.

The program being used is attached and can also be downloaded at:
http://home.comcast.net/~thefrabbit/test_var.c

Version-Release number of selected component (if applicable):
kernel-2.6.5-1.358 gcc-3.4.1-9 glibc-2.3.3-27

How reproducible:
Always

Steps to Reproduce:
1. gcc -Wall test_var.c -o test
2. ./test
    

Actual Results:  The message is outputted to the command line
(correct) along with the error message "Segmentation fault".

Expected Results:  The message should be outputted to the command
line, but also a file (temp3.txt) should be created and the same
message should be written into that file.

Additional info:

Building on an Athlon64, FC2 X86_64.

Comment 1 Fred Huang 2004-09-03 03:48:11 UTC
Created attachment 103420 [details]
The test file that I was testing 64-bit compilation with.