Opened 6 years ago

Closed 6 years ago

#10186 closed bug (fixed)

Devices application crashes

Reported by: kallisti5 Owned by: nobody
Priority: high Milestone: R1/beta1
Component: Applications/Devices Version: R1/Development
Keywords: Cc: korli, pieter@…
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

	thread 944: Devices (main)
		state: Exception (Segment violation)

		Frame		IP			Function Name
		-----------------------------------------------
		0x7ff30d4d1150	0x6850e0b465	DevicesView::CreateCategoryMap() + 0x59

Complete tracefile attached. Tested on x86 and x86_64

Attachments (5)

Devices-944-debug-10-11-2013-02-47-26.report (12.0 KB) - added by kallisti5 6 years ago.
Devices-852-debug-11-11-2013-05-15-27.report (11.1 KB) - added by kallisti5 6 years ago.
Crash report w/debug
listdev (4.1 KB) - added by kallisti5 6 years ago.
listdev
listusb (561 bytes) - added by kallisti5 6 years ago.
listusb
0001-Devices-Fix-crash-for-devices-that-returned-unexpect.patch (2.4 KB) - added by PieterPanman 6 years ago.
Patch that checks the array bounds and should fix the crash

Download all attachments as: .zip

Change History (17)

Changed 6 years ago by kallisti5

comment:1 Changed 6 years ago by kallisti5

Priority: normalhigh

comment:2 Changed 6 years ago by anevilyak

Can I suggest attaching a crash report from running a debug build of Devices? It would yield more useful information. Furthermore, the output of listdev or lspci could be of interest, since this seems to be hardware-specific in some way. It's at least not reproducible over here.

Last edited 6 years ago by anevilyak (previous) (diff)

comment:3 Changed 6 years ago by kallisti5

can-do. I don't have a ton of free time now-a-days and wanted to get this one documented somewhere.

comment:4 Changed 6 years ago by anevilyak

Cc: korli added

From a quick look, and assuming I've interpreted the disassembly correctly, it would appear that the call to GetCategory() at http://cgit.haiku-os.org/haiku/tree/src/apps/devices/DevicesView.cpp#n148 returned 0xff, which is well outside the range of the kCategoryString's bounds. Would be interesting to know what kind of device caused that.

comment:5 in reply to:  4 ; Changed 6 years ago by korli

Replying to anevilyak:

From a quick look, and assuming I've interpreted the disassembly correctly, it would appear that the call to GetCategory() at http://cgit.haiku-os.org/haiku/tree/src/apps/devices/DevicesView.cpp#n148 returned 0xff, which is well outside the range of the kCategoryString's bounds. Would be interesting to know what kind of device caused that.

One has to check the kCategoryString's bounds anyway and print a message in such a case.

Changed 6 years ago by kallisti5

Crash report w/debug

Changed 6 years ago by kallisti5

Attachment: listdev added

listdev

Changed 6 years ago by kallisti5

Attachment: listusb added

listusb

comment:6 in reply to:  5 Changed 6 years ago by PieterPanman

Replying to korli:

One has to check the kCategoryString's bounds anyway and print a message in such a case.

That one was me (author of Devices), it's been a while since I've worked on this... I'm working on a patch for the above omission.

In the mean time, Alex, could you please execute listdev -d and post the results? I checked my code and the only reasonable location where fCategory can be outside of the array is when it comes from the DEVICE_TYPE attribute. This attribute which originates from the haiku Device Manager through the syscalls. This attribute will show up under "device/type" attribute when you do listdev -d.

comment:7 Changed 6 years ago by PieterPanman

Cc: pieter@… added

Changed 6 years ago by PieterPanman

Patch that checks the array bounds and should fix the crash

comment:8 Changed 6 years ago by PieterPanman

Has a Patch: set

comment:9 Changed 6 years ago by PieterPanman

Please try out the patch, should fix the issue. It is my first time using git, hope I did it right.

comment:10 Changed 6 years ago by korli

Edited and applied in hrev46379.

comment:11 Changed 6 years ago by PieterPanman

Thanks for the commit. I'm curious to know if it has been fixed for Alex.

comment:12 Changed 6 years ago by kallisti5

Resolution: fixed
Status: newclosed

fixed here as of hrev46552. Thanks!

Note: See TracTickets for help on using tickets.