|
I'm writing a client/server pair in LuaJIT + ffi + enet in Windows 7 and am running into some issues which I cannot seem to pinpoint. Shortly after sending a packet from server to client, I'm faced with weird out-of-memory errors and stalls. Additionally, even though I have both enet and LuaJIT compiled with debug symbols, when I run GDB on it, I get this oddity:(gdb) set debug jit 1(gdb) target exec luajit.exejit_inferior_init(gdb) run src/main_server.luajit_inferior_initStarting program: c:\...\luajit.exe src/main_server.lua[New Thread 224.0x11c8]jit_inferior_initjit_inferior_init, descriptor_addr = 0x66dd1004jit_breakpoint_re_set_internal, breakpoint_addr = 0x66db2120jit_inferior_initjit_inferior_initjit_inferior_init, descriptor_addr = 0x66dd1004jit_breakpoint_re_set_internal, breakpoint_addr = 0x66db2120jit_inferior_init, descriptor_addr = 0x66dd1004... some server output ...04/23/12 20:22:16 Info - main: Server starting, press 'q' to stop.jit_register_code, symfile_addr = 0x3802f4, symfile_size = 310955632230404/23/12 20:22:26 Info - server: 127.0.0.1 connecting... some more server loading / output ...jit_register_code, symfile_addr = 0x39bcec, symfile_size = 3092376453120jit_register_code, symfile_addr = 0x36f704, symfile_size = 3126739678536jit_register_code, symfile_addr = 0x3548bc, symfile_size = 3161099416904jit_register_code, symfile_addr = 0x36a324, symfile_size = 3109559809352jit_register_code, symfile_addr = 0x3452c4, symfile_size = 309237994016804/23/12 20:22:26 Debug - server: Sending data to 127.0.0.104/23/12 20:22:26 Debug - server: Data sentwarning: HEAP[luajit.exe]:warning: Heap block at 003ABBF8 modified at 003ABC6E past requested size of 6eProgram received signal SIGTRAP, Trace/breakpoint trap.0x776204e5 in ntdll!TpWaitForAlpcCompletion () from C:\windows\system32\ntdll.dll(gdb) backtrace#0 0x776204e5 in ntdll!TpWaitForAlpcCompletion () from C:\windows\system32\ntdll.dll#1 0x0028f900 in ?? ()#2 0x77605732 in ntdll!RtlLargeIntegerDivide () from C:\windows\system32\ntdll.dll#3 0x003abbf8 in ?? ()#4 0x775e29fa in ntdll!RtlCopyExtendedContext () from C:\windows\system32\ntdll.dll#5 0x00000000 in ?? ()(gdb) killKill the program being debugged? (y or n) yjit_inferior_initjit_inferior_initjit_inferior_init, descriptor_addr = 0x66dd1004jit_breakpoint_re_set_internal, breakpoint_addr = 0x66db2120jit_inferior_init, descriptor_addr = 0x66dd1004(gdb) quitI'm not quite sure if this is an error inside of enet or my ffi code, and every time I debug LuaJIT in GDB I always get these unhelpful backtraces. How would I get some useful info about where this issue is occurring, aside from adding print()s everywhere?Thanks, Alex.