Opened 4 years ago

Closed 10 months ago

#12442 closed bug (duplicate)

Unit tests crash with segment violation in heap-management code

Reported by: simonsouth Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System Version: R1/Development
Keywords: unittests Cc:
Blocked By: #14376 Blocking:
Has a Patch: no Platform: x86-64


Running UnitTester on x86_64 crashes in BApplication::QuitTest4 with a segment violation. Debug report attached.

The location of the actual crash varies between (at least) insert_chunk and hoardUnsbrk in 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.

Attachments (1) (37.0 KB ) - added by simonsouth 4 years ago.
Debug report

Download all attachments as: .zip

Change History (3)

by simonsouth, 4 years ago

Debug report

comment:1 by pulkomandy, 4 years ago

To debug memory allocation problems, you can use LD_PRELOAD=/system/lib/ ./program. This replaces libroot with a version using a slower version of malloc that takes care of erasing freed blocks, and other protection measures, and can detect some errors earlier and closer to the point where they happen.

comment:2 by waddlesplash, 10 months ago

Blocked By: 14376 added
Resolution: duplicate
Status: newclosed

#14376 is a duplicate but has more information.

Note: See TracTickets for help on using tickets.