Issue Details (XML | Word | Printable)

Key: PCC-58
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Nicolas Joly
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.

pcc compiled program that use fprintf(3) crash on NetBSD/amd64

Created: 31/May/09 01:20 PM   Updated: 06/Jul/09 02:40 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

NetBSD petaure.lan 5.99.12 NetBSD 5.99.12 (PETAURE) #30: Fri May 29 23:37:43 CEST 2009 njoly@petaure.lan:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/PETAURE amd64

pcc 0.9.9 for x86_64-unknown-netbsd5.99.12, njoly@petaure.lan Tue May 26 09:45:48 CEST 2009

 Description  « Hide
Looks like any program thst use fprintf(3) crash on NetBSD/amd64, when compiled with CVS pcc.
The problem does not occur with printf(3), or when using gcc ....

njoly@petaure [~]> cat fprintf.c
#include <stdio.h>
int main() {
  fprintf(stdout, "Hello world\n");
  return 0; }
njoly@petaure [~]> pcc -o fprintf fprintf.c
njoly@petaure [~]> ./fprintf
zsh: segmentation fault (core dumped) ./fprintf
njoly@petaure [~]> gdb ./fprintf ./fprintf.core
GNU gdb 6.5
Core was generated by `fprintf'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f7ffdbc6ee4 in __vfprintf_unlocked (fp=0x500dc0,
    fmt0=0x4009f1 "Hello world\n", ap=0x7f7fffffd610)
    at /local/src/NetBSD/src/lib/libc/stdio/vfwprintf.c:798
798 _SET_ORIENTATION(fp, -1);
(gdb) bt
#0 0x00007f7ffdbc6ee4 in __vfprintf_unlocked (fp=0x500dc0,
    fmt0=0x4009f1 "Hello world\n", ap=0x7f7fffffd610)
    at /local/src/NetBSD/src/lib/libc/stdio/vfwprintf.c:798
#1 0x00007f7ffdbca950 in vfprintf (fp=0x500dc0,
    fmt0=0x4009f1 "Hello world\n", ap=0x7f7fffffd610)
    at /local/src/NetBSD/src/lib/libc/stdio/vfwprintf.c:545
#2 0x00007f7ffdbc43c8 in fprintf (fp=0x500dc0, fmt=0x4009f1 "Hello world\n")
    at /local/src/NetBSD/src/lib/libc/stdio/fprintf.c:59
#3 0x000000000040094b in main ()

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 06/Jul/09 02:40 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]