Opened 13 years ago

Closed 13 years ago

#860 closed defect (fixed)

Crash upon exiting the game

Reported by: Magne Djupvik Owned by:
Priority: Release Blocker Milestone: Alpha 7
Component: Core engine Keywords:
Cc: Patch:

Description

Operating System : Debian GNU/Linux 6.0.1

Kernel : Linux 2.6.32-5-amd64 (x86_64) C

Library : GNU C Library version 2.11.2 (stable)

Default C Compiler: GNU C Compiler version 4.4.5 (Debian 4.4.5-8)

Processor : 4x Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz

Memory : 2025MB (1445MB used)

OpenGL Renderer : GeForce GTS 250/PCI/SSE2

Resolution : 1920x1080 pixels

h_mgr.cpp(659): Function call failed: return value was -100022 (Invalid handle)
Function call failed: return value was -100022 (Invalid handle)
Location: h_mgr.cpp:659 (h_free)

Call stack:

(0x7013bd) ./pyrogenesis() [0x7013bd]
(0x6aa114) ./pyrogenesis() [0x6aa114]
(0x6aa816) ./pyrogenesis() [0x6aa816]
(0x6aa999) ./pyrogenesis() [0x6aa999]
(0x6d13a4) ./pyrogenesis() [0x6d13a4]
(0x6d3499) ./pyrogenesis() [0x6d3499]
(0x6d0b5d) ./pyrogenesis() [0x6d0b5d]
(0x6d0ddf) ./pyrogenesis() [0x6d0ddf]
(0x708303) ./pyrogenesis() [0x708303]
(0x513186) ./pyrogenesis() [0x513186]
(0x414df5) ./pyrogenesis() [0x414df5]
(0x415b13) ./pyrogenesis() [0x415b13]
(0x7f58d18efc4d) /lib/libc.so.6(__libc_start_main+0xfd) [0x7f58d18efc4d]
(0x4134c9) ./pyrogenesis() [0x4134c9]

errno = 0 (?)
OS error = ?


0x00007f58d197178d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
82	../sysdeps/unix/syscall-template.S: Ingen slik fil eller filkatalog.
	in ../sysdeps/unix/syscall-template.S
(gdb) bt
#0  0x00007f58d197178d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f58d1971600 in __sleep (seconds=<value optimized out>)
    at ../sysdeps/unix/sysv/linux/sleep.c:138
#2  0x0000000000705ad9 in udbg_launch_debugger ()
    at ../../../source/lib/sysdep/os/unix/udbg.cpp:76
#3  0x0000000000706b23 in try_gui_display_error (text=<value optimized out>, 
    manual_break=<value optimized out>, allow_suppress=true, no_continue=false)
    at ../../../source/lib/sysdep/os/unix/unix.cpp:173
#4  0x0000000000706c7c in sys_display_error (
    text=0x7f58cb61f000 L"Function call failed: return value was -100022 (Invalid handle)\r\nLocation: h_mgr.cpp:659 (h_free)\r\n\r\nCall stack:\r\n\r\n(0x7013bd) ./pyrogenesis() [0x7013bd]\n(0x6aa114) ./pyrogenesis() [0x6aa114]\n(0x6aa81"..., flags=<value optimized out>)
    at ../../../source/lib/sysdep/os/unix/unix.cpp:214
#5  0x00000000006aa82c in debug_DisplayError (
    description=<value optimized out>, flags=6, 
    lastFuncToSkip=<value optimized out>, pathname=<value optimized out>, 
    line=659, func=<value optimized out>, suppress=0xa0cf08, 
    context=<value optimized out>) at ../../../source/lib/debug.cpp:466
#6  0x00000000006aa999 in debug_OnError (err=-100022, suppress=0xa0cf08, 
    file=0x76c318 L"../../../source/lib/res/h_mgr.cpp", line=659, 
    func=0x76c8f6 "h_free") at ../../../source/lib/debug.cpp:541
#7  0x00000000006d13a4 in h_free (h=@0x7f5881fd7c10, type=0x9fee60)
---Type <return> to continue, or q <return> to quit---
    at ../../../source/lib/res/h_mgr.cpp:659
#8  0x00000000006d3499 in GLCursor::destroy (c=0x7f5881fd7c00)
    at ../../../source/lib/res/graphics/cursor.cpp:110
#9  Cursor_dtor (c=0x7f5881fd7c00)
    at ../../../source/lib/res/graphics/cursor.cpp:178
#10 0x00000000006d0b5d in h_free_idx (idx=646, hd=0x7f5881fd7bd0)
    at ../../../source/lib/res/h_mgr.cpp:615
#11 0x00000000006d0ddf in Shutdown () at ../../../source/lib/res/h_mgr.cpp:840
#12 0x0000000000708303 in ModuleShutdown (initState=0xa07cb8, 
    shutdown=0x6d0d20 <Shutdown>) at ../../../source/lib/module_init.cpp:71
#13 0x0000000000513186 in Shutdown ()
    at ../../../source/ps/GameSetup/GameSetup.cpp:657
#14 0x0000000000414df5 in RunGameOrAtlas (argc=<value optimized out>, 
    argv=<value optimized out>) at ../../../source/main.cpp:493
#15 0x0000000000415b13 in main (argc=1, argv=0x7fff3d752d38)
    at ../../../source/main.cpp:511
Current language:  auto
The current source language is "auto; currently asm".

Change History (5)

comment:1 by Jan Wassenberg, 13 years ago

(In [9961]) cleanup and simplification of the really old h_mgr code. replace array-of-pages data structure with demand-committed VM => allows simple allocation of new resources without having to search for the first free index. I suspect the cause of multiple reported bugs (refs #860, #899, #915) was a race. Most issues are fixed, but the pool's freelist also needs to be made thread-safe and lock-free. this has performance and 64-bit portability implications, so I'll leave it for later (Pool is due for some serious refactoring anyway).

please post a comment if this or similar issues persist.

comment:2 by Kieran P, 13 years ago

Milestone: BacklogAlpha 7

comment:3 by historic_bruno, 13 years ago

Probably the same as #915.

comment:4 by Kieran P, 13 years ago

Priority: Should HaveRelease Blocker

comment:5 by Jan Wassenberg, 13 years ago

Resolution: fixed
Status: newclosed

(In [10243]) h_mgr: fix simple double-free warning triggered at shutdown when an object's child was freed AND the all objects were forcibly freed (complicated by the fact that the pool allocator overwrites freed storage, which made this appear to be a tag conflict). fixes #860, #915, #920

Note: See TracTickets for help on using tickets.