Opened 12 years ago

Closed 12 years ago

#3411 closed bug (fixed)

Programs that call setbuf(fp, NULL) dump core

Reported by: schily Owned by: axeld
Priority: normal Milestone: R1
Component: - General Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All


setbuf() calls setbuffer() and setbuffer calls a NULL pointer from an incompletely initalized struct of function pointer that belongs to libc.

Please implement the missing function "__setbuf()".

star, smake, cdrtools and other programs will not work witout a fix.

Change History (5)

comment:1 by korli, 12 years ago

Here is a stacktrace with smake:

vm_soft_fault: va 0x0 not covered by area in address space
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x0, ip 0x0, write 0, user 1, thread 0x2485
vm_page_fault: thread "smake" (9349) in team "smake" (9349) tried to read address 0x0, ip 0x0 ("???" +0x0)
debug_server: Thread 9349 entered the debugger: Segment violation
stack trace, current PC (nil)  :
  (0x7ffeee4c)  0x26b220  setbuf + 0x28
  (0x7ffeee7c)  0x210691  _fcons + 0x71
  (0x7ffeeeac)  0x21060c  fileopen + 0x6c
  (0x7ffeeedc)  0x2066c0  readfile + 0x80
  (0x7ffeef0c)  0x20350a  read_makefiles + 0xf2
  (0x7ffeef4c)  0x204404  main + 0x37c
  (0x7ffeef7c)  0x202f4f  _start + 0x5b
  (0x7ffeefac)  0x10090a  runtime_loader + 0x14a

comment:2 by schily, 12 years ago

setbuf() is part of libc and calls setbuffer() The program aborts because setbuffer tries to call a function via a structure of function pointers. The specific entry setbuffer from libc tries to call is a NULL pointer.

comment:3 by korli, 12 years ago

Could you please check with hrev29153 ?

comment:4 by schily, 12 years ago

If there is a raw disk image that I can use for Quemu, I will check.

comment:5 by korli, 12 years ago

Resolution: fixed
Status: newclosed

schily told smake was running.

Note: See TracTickets for help on using tickets.