Opened 7 months ago

Last modified 2 weeks ago

#18926 assigned bug

Tracker crashes when invoking Find with custom filetypes installed

Reported by: grexe Owned by: waddlesplash
Priority: normal Milestone: R1/beta6
Component: Applications/Tracker Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

While working on my project (SEN), I set up custom file type and also supertypes, which are valid (displayed and handled correctly in Tracker and the FileTypes app).

However this seems to crash the Find panel since some weeks (I'm always on the latest nightly because I need to work with the system closely and want to watch out for changes as soon as possible).

Simply invoking the "Find" command by shortcut or menu crashes Tracker, see log.

Attachments (5)

Tracker-1775-debug-06-06-2024-14-32-30_find-crash.report (31.6 KB ) - added by grexe 7 months ago.
Tracker crash report
mime_db.zip (243.6 KB ) - added by grexe 7 months ago.
my extended mime_db
issue-18926_find-panel.patch (1.8 KB ) - added by grexe 3 weeks ago.
fix patch
murder_mime.zip (5.7 KB ) - added by grexe 3 weeks ago.
suspicious entity super type
mime-kdb.jpg (57.9 KB ) - added by grexe 3 weeks ago.
KDL on trying to install custom MIME (super) type

Download all attachments as: .zip

Change History (16)

by grexe, 7 months ago

Tracker crash report

by grexe, 7 months ago

Attachment: mime_db.zip added

my extended mime_db

comment:1 by jscipione, 5 months ago

Owner: changed from nobody to jscipione
Status: newassigned

I am unable to reproduce this issue on latest nightly, it may have been fixed. I created a new supertype in FileType with a type, so some custom types inside application supertype. Find window does not crash.

comment:2 by grexe, 3 months ago

can still reproduce with hrev58241, will try to debug. Crash report still shows:

	thread 499: w>Desktop 
		state: Exception (Segment violation)

		Frame		IP			Function Name
		-----------------------------------------------
		0x7fa3c5508810	0x3c1c947b30	BList::CountItems() const + 0 
			Disassembly:
				BList::CountItems() const:
				0x0000003c1c947b30:           8b4714  movl 0x14(%rdi), %eax <--

			Frame memory:
				[0x7fa3c5508808]  ..".k...   98 02 22 1f 6b 01 00 00
		0x7fa3c55089a0	0x16b1f220293	BPrivate::FindPanel::AddOneMimeTypeToMenu(BPrivate::ShortMimeInfo const*, void*) + 0xc3 
		0x7fa3c5508a00	0x16b1f235704	BPrivate::MimeTypeList::EachCommonType(bool (*)(BPrivate::ShortMimeInfo const*, void*), void*) const + 0x74 
		0x7fa3c5508b20	0x16b1f220942	BPrivate::FindPanel::AddMimeTypesToMenu() + 0x362 
		0x7fa3c5508ba0	0x16b1f225931	BPrivate::FindPanel::FindPanel(BFile*, BPrivate::FindWindow*, bool, bool) + 0x141 
		0x7fa3c5508d10	0x16b1f2264e8	BPrivate::FindWindow::FindWindow(entry_ref const*, bool) + 0x1a8 

comment:3 by grexe, 3 weeks ago

ok I checked out the latest source as of today and fixed the issue, which I can still reproduce *everytime* I invoke Find.

In my case, the menu it tries to search for duplicate items can be NULL, so the CountItems() causes a segfault. Adding a safe guard fixed this, but:

  1. the code is really ugly and inefficient
  2. the fix should not be needed since superItem->Submenu() should never be NULL?

The end result looks fine, I have no missing menus or duplicate items. Please find the patch attached, I'll happily provide it via official Haiku patch flow if you guys agree.

by grexe, 3 weeks ago

fix patch

comment:4 by waddlesplash, 3 weeks ago

How did we wind up with a superitem without a submenu? That seems like the thing to fix here.

comment:5 by waddlesplash, 3 weeks ago

Milestone: UnscheduledR1/beta6

comment:6 by jscipione, 3 weeks ago

Owner: changed from jscipione to waddlesplash

comment:7 by jscipione, 3 weeks ago

I am going to be out of town this upcoming week. I have no idea how we ended up with a superitem without having a submenu, that should not be possible.

comment:8 by grexe, 3 weeks ago

I found the culprit - it was a custom supertype after all, which is strange, since other custom super types just worked fine.

For some reason, Haiku really does not like it - I even got thrown into KDL when trying to install the MIME type from its resource definition and going via the MimeType API (!).

You can find the resource definition and MIME:META type attached.

In any case, this should not cause the Find panel to crash, and FileTypes handles the type just fine (if installed via user settings mime_db directory and rebooting).

by grexe, 3 weeks ago

Attachment: murder_mime.zip added

suspicious entity super type

by grexe, 3 weeks ago

Attachment: mime-kdb.jpg added

KDL on trying to install custom MIME (super) type

comment:9 by grexe, 3 weeks ago

So I was not able to reproduce when installing this manually with my MIME tool (which installs/uninstalls MIME types from resource files).

I need to check why this happens when invoked from a shell script that wraps this tool and does some extra magic.

The script is located at: https://github.com/sen-laboratories/sen-oni/blob/milestone/proto3/scripts/oni.sh

MIME tool is at: https://github.com/sen-laboratories/mime

comment:10 by waddlesplash, 3 weeks ago

That's not a KDL but rather a registrar crash. You can probably run "save-report" at the prompt to get a debug report saved to your desktop.

comment:11 by waddlesplash, 2 weeks ago

The link is a 404. Can you give more details on how to install this MIME in a way that reproduces the problem?

Note: See TracTickets for help on using tickets.