Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#909 closed defect (fixed)

Assertion failure on allocating 0 bytes from pool when rendering terrain

Reported by: iznogood Owned by:
Priority: Should Have Milestone: Alpha 7
Component: Core engine Keywords:
Cc: Jan Wassenberg Patch:

Description

Hi. When I start the game I can see the menu, but when I try to start to play on a map I got an error at the end of the loading.

Attachments (2)

crashlog.txt (27.1 KB ) - added by iznogood 13 years ago.
system_info.txt (2.3 KB ) - added by iznogood 13 years ago.

Download all attachments as: .zip

Change History (9)

by iznogood, 13 years ago

Attachment: crashlog.txt added

by iznogood, 13 years ago

Attachment: system_info.txt added

comment:1 by iznogood, 13 years ago

GDB full bt : http://pastebin.com/Nnq2NMBp

comment:2 by iznogood, 13 years ago

Don't worry about the animation or xml file that are not found, they are not the problem.

Obviously an assert in pool_alloc fails. But I can't say why.

comment:3 by historic_bruno, 13 years ago

Cc: Jan Wassenberg added

comment:4 by Philip Taylor, 13 years ago

Summary: Crash loadAssertion failure on allocating 0 bytes from pool when rendering terrain
#7  0x08335a67 in pool_alloc (p=0xbfec72e0, size=0) at ../../../source/lib/allocators/pool.cpp:96

The size=0 seems to trigger that assertion failure. Not sure why it's allocating 0 bytes, but I suppose there's no reason why the STL implementation shouldn't be allowed to do that.

I assume the solution is to handle size=0 correctly, i.e. return a unique pointer, by clamping size to 1 or something. Should that clamping happen in pool_alloc, or in RawPoolAllocator, or in pool_allocator?

comment:5 by Jan Wassenberg, 13 years ago

Resolution: fixed
Status: newclosed

(In [9944]) pool - safely handle zero-sized allocations (fixes #909) snd_mgr - remove no longer needed hacks for native OpenAL implementations test_wdbg_sym.h - belated commit of warning fix

comment:6 by Jan Wassenberg, 13 years ago

Thanks for the backtrace! I've changed pool_allocator to treat 0 as 1; that'll guarantee a unique address, as required by C++. Please reopen if this did not fix the problem.

comment:7 by Kieran P, 13 years ago

Milestone: BacklogAlpha 7
Note: See TracTickets for help on using tickets.