Opened 4 years ago

Closed 6 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

Description

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)

UnitTester-1852-debug-31-10-2015-16-26-51.report (37.0 KB) - added by simonsouth 4 years ago.
Debug report

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by simonsouth

Debug report

comment:1 Changed 4 years ago by pulkomandy

To debug memory allocation problems, you can use LD_PRELOAD=/system/lib/libroot_debug.so ./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 Changed 6 months ago by waddlesplash

Blocked By: 14376 added
Resolution: duplicate
Status: newclosed

#14376 is a duplicate but has more information.

Note: See TracTickets for help on using tickets.