public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/366] New: Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine.
@ 2004-09-03 2:39 dafrabbit at yahoo dot com
2004-09-03 2:39 ` [Bug libc/366] " dafrabbit at yahoo dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: dafrabbit at yahoo dot com @ 2004-09-03 2:39 UTC (permalink / raw)
To: glibc-bugs
Compiling a small C program in 64-bit mode with gcc, compiling is fine, but when
run the program seg faults. Same program, compiled in 32-bit mode with gcc runs
fine. Bug report posted in gcc Bugzilla, told to repost here. (link to gcc bug
report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17302)
Building on an Athlon64, gcc version 3.4.1-9, glibc version 2.3.3-27, kernel
version 2.6.5-1.358.
To reproduce:
1. gcc -g test_var5.c
2. gcc -o test5.exe test_var5.o
3. test5.exe
The program is attached.
--
Summary: Compiling on 64-bit yields segmentation fault when run,
on 32-bit runs fine.
Product: glibc
Version: 2.3.3
Status: NEW
Severity: normal
Priority: P1
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: dafrabbit at yahoo dot com
CC: glibc-bugs at sources dot redhat dot com
http://sources.redhat.com/bugzilla/show_bug.cgi?id=366
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libc/366] Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine.
2004-09-03 2:39 [Bug libc/366] New: Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine dafrabbit at yahoo dot com
@ 2004-09-03 2:39 ` dafrabbit at yahoo dot com
2004-09-03 4:23 ` aj at suse dot de
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: dafrabbit at yahoo dot com @ 2004-09-03 2:39 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From dafrabbit at yahoo dot com 2004-09-03 02:39 -------
Created an attachment (id=185)
--> (http://sources.redhat.com/bugzilla/attachment.cgi?id=185&action=view)
The test file that I was testing 64-bit compilation with.
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=366
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libc/366] Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine.
2004-09-03 2:39 [Bug libc/366] New: Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine dafrabbit at yahoo dot com
2004-09-03 2:39 ` [Bug libc/366] " dafrabbit at yahoo dot com
@ 2004-09-03 4:23 ` aj at suse dot de
2004-09-03 7:41 ` jakub at redhat dot com
2004-09-03 13:01 ` dafrabbit at yahoo dot com
3 siblings, 0 replies; 5+ messages in thread
From: aj at suse dot de @ 2004-09-03 4:23 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From aj at suse dot de 2004-09-03 04:23 -------
The ISO C99 standard in section 7.15 #3 forbids to usages of va_list without
a va_end/va_start. Removing one vfprintf call from io_vprint fixes the problem.
Your program is not valid C, it just works by chance on 32-bit.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://sources.redhat.com/bugzilla/show_bug.cgi?id=366
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libc/366] Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine.
2004-09-03 2:39 [Bug libc/366] New: Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine dafrabbit at yahoo dot com
2004-09-03 2:39 ` [Bug libc/366] " dafrabbit at yahoo dot com
2004-09-03 4:23 ` aj at suse dot de
@ 2004-09-03 7:41 ` jakub at redhat dot com
2004-09-03 13:01 ` dafrabbit at yahoo dot com
3 siblings, 0 replies; 5+ messages in thread
From: jakub at redhat dot com @ 2004-09-03 7:41 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From jakub at redhat dot com 2004-09-03 07:41 -------
Well, if you really need two vprintf calls, you can use
va_list ap2;
va_copy (ap2, ap);
vfprintf(out_fp, fmt, ap);
vfprintf(log_stream_g, fmt, ap2);
va_end (ap2);
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=366
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libc/366] Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine.
2004-09-03 2:39 [Bug libc/366] New: Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine dafrabbit at yahoo dot com
` (2 preceding siblings ...)
2004-09-03 7:41 ` jakub at redhat dot com
@ 2004-09-03 13:01 ` dafrabbit at yahoo dot com
3 siblings, 0 replies; 5+ messages in thread
From: dafrabbit at yahoo dot com @ 2004-09-03 13:01 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From dafrabbit at yahoo dot com 2004-09-03 13:01 -------
(In reply to comment #3)
> Well, if you really need two vprintf calls, you can use
> va_list ap2;
> va_copy (ap2, ap);
> vfprintf(out_fp, fmt, ap);
> vfprintf(log_stream_g, fmt, ap2);
> va_end (ap2);
>
Well, you then make it difficult to do the task to pass variable number of
arguments from one subroutine to another subroutine. I do't know whether C
forbids that. Your suggestion is to ask people not to use subroutines. I hope it
is not that restrictive.
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=366
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-09-03 13:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-03 2:39 [Bug libc/366] New: Compiling on 64-bit yields segmentation fault when run, on 32-bit runs fine dafrabbit at yahoo dot com
2004-09-03 2:39 ` [Bug libc/366] " dafrabbit at yahoo dot com
2004-09-03 4:23 ` aj at suse dot de
2004-09-03 7:41 ` jakub at redhat dot com
2004-09-03 13:01 ` dafrabbit at yahoo dot com
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).