Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#1371 closed bug (fixed)

Registrar died while compiling "doodle" sample app.

Reported by: jackburton Owned by: mmlr
Priority: normal Milestone: R1
Component: Kits/Application Kit Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

With hrev21867, I installed the R5 development tools under haiku, and tried to compile the "doodle" sample app in optional/sample-code/intro.

The actual compiling and linking works fine, but when mimesetting the binary, registrar crashed. Since it crashes in BMessage, I assume it's a BMessage bug. It's 100% reproducible. Included is the backtrace.

Attachments (1)

backtrace.jpg (166.5 KB ) - added by jackburton 17 years ago.

Download all attachments as: .zip

Change History (5)

by jackburton, 17 years ago

Attachment: backtrace.jpg added

comment:1 by jackburton, 17 years ago

Owner: changed from axeld to mmlr

comment:2 by mmlr, 17 years ago

Resolution: fixed
Status: newclosed

The cause was that the size of a message item was not swapped when the swapped BMessage format was used. This caused the message to try to allocate 640MB instead of 40Bytes which failed. By the way the flat message is hidden in the Doodle resource file which was apparently made on a PPC BeOS. A simple "mimeset -f Doodle" on a already built app would have caused the same crash. Fixed in hrev21901.

in reply to:  2 ; comment:3 by jackburton, 17 years ago

Replying to mmlr:

The cause was that the size of a message item was not swapped when the swapped BMessage format was used. This caused the message to try to allocate 640MB instead of 40Bytes which failed.

Interesting. I think Registrar shouldn't die anyway in that case, what do you think?

in reply to:  3 comment:4 by mmlr, 17 years ago

Replying to jackburton:

Interesting. I think Registrar shouldn't die anyway in that case, what do you think?

Yes it shouldn't. I have fixed our realloc() wrapper in this regard and it does now not try to memcpy() if the allocation failed. BMessage should handle the error correctly, but I still have to investigate what happens when you use the BMessage where a reallocation failed though.

Note: See TracTickets for help on using tickets.