<< Back to previous view

[PCC-58] pcc compiled program that use fprintf(3) crash on NetBSD/amd64 Created: 31/May/09  Updated: 06/Jul/09

Status: Resolved
Project: pcc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Nicolas Joly Assignee: Unassigned
Resolution: Fixed Votes: 0
Environment: 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   
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 ()


 Comments   
Comment by Nicolas Joly [ 28/Jun/09 11:33 PM ]
I just tested it again, and this seems to be fixed now.
Comment by Anders Magnusson [ 06/Jul/09 02:40 PM ]
Working as reported from requestor.
Generated at Sat Aug 23 19:20:01 CEST 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.