Issue Details (XML | Word | Printable)

Key: PCC-169
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Altamiranus
Votes: 0
Watchers: 1

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

fprintf fails badly with NetBSD/pmax (MIPS)

Created: 22/Sep/10 09:51 AM   Updated: 14/Oct/10 12:03 AM
Component/s: pcc backend
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File fprintf.E (9 kB)
2. File fprintf.S (0.9 kB)

Environment: NetBSD/pmax 5.0.2 - MIPS emulation under gxemul

 Description  « Hide
Using fprintf make simple programs to crash and burn.

--- fprintf.c ---
#include <stdio.h>
int main(void)
   fprintf(stdout, "%s\n", "hello, world");
   return 0;
--- fprintf.c ---
$ pcc -o f fprintf.c
$ ./f
[ warning: LOW reference: vaddr=0x0000000000000110, exception TLBL, pc=0x000000007df0ad3c <(no symbol)> ]
Memory fault (core dumped)

The first line appears to be generated by the emulator.

$ pcc -v -g -E fprintf.c > fprintf.E
/usr/local/libexec/cpp -v -D__PCC__=0 -D__PCC_MINOR__=9 -D__PCC_MINORMINOR__=9 -D__GNUC__=4 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D__GNUC_STDC_INLINE__=1 -D__REGISTER_PREFIX__= -D__USER_LABEL_PREFIX__= -D__NetBSD__ -D__ELF__ -D__STDC_ISO_10646__=200009L -D__WCHAR_TYPE__=int -D__SIZEOF_WCHAR_T__=4 -D__WCHAR_MAX__=2147483647 -D__WINT_TYPE__=unsigned int -D__SIZE_TYPE__=unsigned long -D__PTRDIFF_TYPE__=int -D__SIZEOF_WINT_T__=4 -D__mips__ -S /usr/local/include/pcc/ -S /usr/include/ -S /usr/local/lib/pcc/mipsel-unknown-netbsd5.0.2/0.9.9/include/ fprintf.c

Attached are the file created by the preprocessor (fprintf.E), and the assembler instructions generated by ccom (fprintf.S).

The program behaves as expected when fprintf is replaced with printf.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Altamiranus added a comment - 14/Oct/10 12:03 AM
May be related to PCC-58.