#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)
Change History (9)
by , 13 years ago
Attachment: | crashlog.txt added |
---|
by , 13 years ago
Attachment: | system_info.txt added |
---|
comment:1 by , 13 years ago
comment:2 by , 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 , 13 years ago
Cc: | added |
---|
comment:4 by , 13 years ago
Summary: | Crash load → 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 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 by , 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 , 13 years ago
Milestone: | Backlog → Alpha 7 |
---|
GDB full bt : http://pastebin.com/Nnq2NMBp