lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Many thanks to Michal Kottman for his gdb helpers (https://github.com/mkottman/lua-gdb-helper).

With the "luastack" debugging macro from these helpers, I discovered that the thread which I was running had been garbage collected at the time it was run due to a bug in my LuaCallback code not properly retaining the thread.

Michal, you are the man !

Gaspard

On Sun, Feb 13, 2011 at 2:20 PM, Gaspard Bucher <gaspard@teti.ch> wrote:
Sorry for the confusing title, it's not about OS threads but changing running thread from C which from my understanding should be fine but doesn't look ok or maybe the bug is somewhere else but initializeGL is an empty function ..?

Gaspard

On Sun, Feb 13, 2011 at 1:21 PM, Gaspard Bucher <gaspard@teti.ch> wrote:
Hi there,

I am experimenting a bug when this call chain occurs:

Lua1 and Lua2 are two different lua threads.

Lua1 ---> GLWindow::show() ---> [... Qt stuff ...] ---> GLWindow:: initializeGL() ---> Lua2 ---> pcall: BANG!

Any idea ?

Gaspard

Call stack is :
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000493b3c440
#0  0x000000010000ff9d in luaT_gettmbyobj ()
#1  0x00000001000109be in call_binTM ()
#2  0x0000000100011228 in luaV_concat ()
#3  0x000000010000b893 in luaO_pushvfstring ()
#4  0x0000000100006345 in luaG_runerror ()
#5  0x00000001000066ac in luaG_typeerror ()
#6  0x00000001000078ee in luaD_precall ()
#7  0x0000000100007e1e in luaD_call ()
#8  0x0000000100007527 in luaD_rawrunprotected ()
#9  0x00000001000075a0 in luaD_pcall ()
#10 0x0000000100002fc7 in lua_pcall ()
#11 0x00000001000b6e9f in mimas::GLWindow::initializeGL (this=0x101d520a0) at GLWindow.h:178
#12 0x000000010020a3a4 in QGLWidget::glInit ()
#13 0x000000010020658c in QGLWidget::resizeEvent ()
#14 0x00000001010db2dc in QWidget::event ()
#15 0x000000010020d2d2 in QGLWidget::event ()
#16 0x00000001010847cd in QApplicationPrivate::notify_helper ()
#17 0x000000010108b23d in QApplication::notify ()
#18 0x000000010035997c in QCoreApplication::notifyInternal ()
#19 0x00000001010d83f7 in QWidgetPrivate::sendPendingMoveAndResizeEvents ()
#20 0x00000001010ddf38 in QWidgetPrivate::show_helper ()
#21 0x00000001010df60f in QWidget::setVisible ()
#22 0x00000001000ab97d in QWidget::show (this=0x101d520a0) at qwidget.h:487
#23 0x00000001000abba5 in mimas::GLWindow::show (this=0x101d520a0, L=0x100100080) at GLWindow.h:130
#24 0x00000001000aab0c in GLWindow_show (L=0x100100080) at /Users/gaspard/git/lubyk/modules/mimas/sub/GLWindow.cpp:261
#25 0x00000001000079e2 in luaD_precall ()
#26 0x00000001000125d5 in luaV_execute ()
#27 0x0000000100007e7d in luaD_call ()
#28 0x0000000100007527 in luaD_rawrunprotected ()
#29 0x00000001000075a0 in luaD_pcall ()
#30 0x0000000100002fc7 in lua_pcall ()
#31 0x00000001000016da in docall ()
#32 0x0000000100002150 in pmain ()