Ticket #909 (closed defect: fixed)

Opened 22 months ago

Last modified 22 months ago

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

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

crashlog.txt (27.1 KB) - added by iznogood 22 months ago.
system_info.txt (2.3 KB) - added by iznogood 22 months ago.

Change History

Changed 22 months ago by iznogood

Changed 22 months ago by iznogood

comment:1 Changed 22 months ago by iznogood

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

comment:2 Changed 22 months ago by iznogood

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 Changed 22 months ago by historic_bruno

  • Cc jan added

comment:4 Changed 22 months ago by Philip

  • Summary changed from Crash load to Assertion 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 Changed 22 months ago by jan

  • Status changed from new to closed
  • Resolution set to fixed

(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 Changed 22 months ago by jan

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 Changed 22 months ago by k776

  • Milestone changed from Backlog to Alpha 7
Note: See TracTickets for help on using tickets.