Opened 10 years ago

Closed 6 months ago

#4164 closed bug (invalid)

assertion fails in malloc (rev 31961)

Reported by: Blub Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/ Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


I just hit an assertion in malloc() :( Adding a screenshot with some info printed in gdb, and the assertion (where you can see the file+line)

Unfortunately I cannot provide a small testcase, I'll try reproducing it with simple code, but I doubt I'll have much luck

Attachments (1)

malloc-assert-fail.png (177.8 KB) - added by Blub 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Blub

Attachment: malloc-assert-fail.png added

comment:1 Changed 10 years ago by Blub

seems like it was a double-free corruption, but I cannot really confirm that since I couldn't find the place where it actually happened.

I have a testcase where I was able to successfully double-free some data without any errors or assertion faults coming up, so I guess the errors occur some time too late.

After changing the data-layout of the program it didn't crash anymore (actually it is now optimized better since it doesn't fragment the memory as much)

I guess I'm just too used to glibc's huge and frightening "double free corruption" error message.

However, when I double-freed on purpose in my testcase (sometimes it did actually cause a crash) then it has always been a different assertion. (and it's always been the same different assertions)

Maybe if I have time to read through the malloc code I can add a check for double-free corruptions (if until then it's not already made).

comment:2 Changed 4 years ago by pulkomandy

This assert is usually triggered by heap corruption, which can be caused by double free but also overwriting malloc guards. You can try running your program with libroot_debug to use a safer (but slower) allocator:

LD_PRELOAD=/system/lib/ ./yourprogram

This one may be better at detecting the initial problem.

comment:3 Changed 4 years ago by waddlesplash

Milestone: R1Unscheduled

comment:4 Changed 2 years ago by axeld

Owner: changed from axeld to nobody
Status: newassigned

comment:5 Changed 6 months ago by waddlesplash

Resolution: invalid
Status: assignedclosed


Note: See TracTickets for help on using tickets.