[haiku-bugs] [Haiku] #12442: Unit tests crash with segment violation in heap-management code

  • From: "simonsouth" <trac@xxxxxxxxxxxx>
  • Date: Sat, 31 Oct 2015 16:41:54 -0000

#12442: Unit tests crash with segment violation in heap-management code
------------------------+------------------------------
Reporter: simonsouth | Owner: nobody
Type: bug | Status: new
Priority: normal | Milestone: Unscheduled
Component: System | Version: R1/Development
Keywords: unittests | Blocked By:
Blocking: | Has a Patch: 0
Platform: x86-64 |
------------------------+------------------------------
Running `UnitTester` on x86_64 crashes in [http://cgit.haiku-

os.org/haiku/tree/src/tests/kits/app/bapplication/AppQuitTester.cpp?id=hrev49732#n113
BApplication::QuitTest4] with a segment violation. Debug report attached.

The location of the actual crash varies between (at least) `insert_chunk`
and `hoardUnsbrk` in [http://cgit.haiku-
os.org/haiku/tree/src/system/libroot/posix/malloc/arch-
specific.cpp?id=hrev49732 arch-specific.cpp] but the root cause seems to
always be corruption of the heap's free-chunk list, `sFreeChunks`,
possibly due to the (lack of) locking the unit test performs.

Note this test runs fine on x86_gcc2, so the problem is something
x86_64-specific.

--
Ticket URL: <https://dev.haiku-os.org/ticket/12442>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: