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)

comment:1 by kallisti5, 6 years ago

Priority: normalhigh

comment:2 by anevilyak, 6 years ago

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 by kallisti5, 6 years ago

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

comment:4 by anevilyak, 6 years ago

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.

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

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.

by kallisti5, 6 years ago

Crash report w/debug

by kallisti5, 6 years ago

Attachment: listdev added

listdev

by kallisti5, 6 years ago

Attachment: listusb added

listusb

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

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 by PieterPanman, 6 years ago

Cc: pieter@… added

by PieterPanman, 6 years ago

Patch that checks the array bounds and should fix the crash

comment:8 by PieterPanman, 6 years ago

Has a Patch: set

comment:9 by PieterPanman, 6 years ago

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

comment:10 by korli, 6 years ago

Edited and applied in hrev46379.

comment:11 by PieterPanman, 6 years ago

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

comment:12 by kallisti5, 6 years ago

Resolution: fixed
Status: newclosed

fixed here as of hrev46552. Thanks!

Note: See TracTickets for help on using tickets.