Ticket #889 (closed bug: fixed)

Opened 2 years ago

Last modified 20 months ago

[PackageBuilder] crash on File->Open

Reported by: diver Owned by: bonefish
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1 development
Cc: Blocked By:
Platform: All Blocking:

Description

PackageBuilder and many other BeOS apps crash on file dialog, see back trace.

Attachments

PackageBuilder.txt (2.3 KB) - added by diver 2 years ago.

Change History

Changed 2 years ago by diver

  Changed 2 years ago by jackburton

BeIDE Crashes with the same backtrace. Maybe we aren't binary compatible in some place ? I think we should add some tests to see if we are. Or at least compare the size of our classes with the size of the beos's classes.

  Changed 22 months ago by jackburton

  • component changed from Kits/Application Kit to Kits/Interface Kit

  Changed 21 months ago by jackburton

Diver, can you name some other apps (beside BeIDE and PackageBuilder) which crash with the same backtrace ?

follow-up: ↓ 5   Changed 21 months ago by jackburton

Axel, I think you changed the location of the some reserved members with r15060... since BView has some friends classes, this could lead to bc problems, I think. Check also Window.h, r13131.

in reply to: ↑ 4 ; follow-up: ↓ 6   Changed 21 months ago by axeld

in reply to: ↑ 5 ; follow-up: ↓ 7   Changed 21 months ago by jackburton

Replying to axeld:

Replying to jackburton: See https://lists.berlios.de/pipermail/haiku-commits/2005-June/001681.html I'll have a look one day :)

What about MenuBar.h r18649 ? Doesn't adding a virtual method require removing another virtual ?

in reply to: ↑ 6   Changed 21 months ago by axeld

Replying to jackburton:

What about MenuBar.h r18649 ? Doesn't adding a virtual method require removing another virtual ?

This is not a new virtual of class BMenuBar - it's a new virtual method in BView, and a virtual slot has been removed there. If you have any other ideas, feel free to shoot :-)

  Changed 20 months ago by xed

just a note that maybe can help: If you run the application (BeIDE or PackageBuilder) with 'spybmessage' it just works as expected..

follow-up: ↓ 10   Changed 20 months ago by jackburton

I was thinking if this isn't a case like the one described here (since the crash happened in type_info also in that case): http://dl.hirschkaefer.de/gcc/

"Every app is now automatically linked against a (new) object file named

fix_bdirectwin_typeinfo.o As a result of the multiple / single symbol space issue, older compilers generate typeinfo-functions in each object file that uses them (via dynamic_cast). As this compiler uses a single symbol space when optimizing, type-info functions are not kept in each object file, but they are taken from the library which "defines" the class that is the target of the dynamic_cast. This works fine for most cases, but the Be-libraries seem to contain a broken version of the BDirectWindow-typeinfo-function."

If BeIDE and some other methods contained some broken type_info function, at least it would be a good explanation.

Maybe Oliver could tell ?

in reply to: ↑ 9   Changed 20 months ago by jackburton

Replying to jackburton:

If BeIDE and some other methods

and some other _applications_

  Changed 20 months ago by bonefish

  • owner changed from axeld to bonefish
  • status changed from new to assigned

I've started to work on this one. It does indeed smell like a compatibility problem.

The dynamic_cast() that segfaults is on a BPrivate::BHScrollBar object (defined in libtracker), when trying to cast it from BHandler* to BView* in BWindow::_FindView(int32). I've compared the Haiku and Be headers for BScrollBar, BView, BHandler, BArchivable and they look compatible to me.

Will dig deeper...

  Changed 20 months ago by bonefish

Doesn't seem to be a simple binary compatibility problem (different object/vtable size). The __si_type_info::dcast() works recursively. It is invoked for the parent class' type info until the type info of the right class is found (or the bottom is hit). In this case the BPrivate::BHScrollBar type info tries to calls dcast() of the super class, namely BScrollBar, type info. Apparently our loader chose the BScrollBar type info living in the PackageBuilder executable. In memory this one has a NULL vtable pointer, which causes the segfault, when the dcast() method is tried to be resolved.

I don't know yet, why that pointer is NULL. I haven't understood yet, how it usually should be initialized. There don't seem to be relocation entries. So there's probably special initialization code responsible for those initializations. Maybe our loader doesn't call it for the executable in this case for any reason.

  Changed 20 months ago by bonefish

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r21290.

  Changed 20 months ago by jackburton

Ingo: you are THE MAN!

Note: See TracTickets for help on using tickets.