Re: [bugle-devel] Windows NULL ptr issue resulting from bugle_thread_lock_lock call
Status: Inactive
Brought to you by:
bmerry
From: Bruce M. <bm...@gm...> - 2011-04-10 13:01:31
|
Hi Bryce This sounds like a new one to me - please do file it in trac. Unfortunately I'm in the process of moving jobs (and countries), so I have almost zero time to maintain bugle at the moment. Based on the stack trace, here's my best guess as to what is happening. The call to bugle_object_get_current_data is to extract data about objects stored in the namespace. To determine that, it first needs to find the current namespace (which is the innermost call in your trace). That information is stored in the current context (although a context never changes namespaces, it seems I found it easier just to have an idea of a current namespace for each context). The variable ans should point to the piece of the context storage that holds a pointer to the namespace for that context. Without being able to attach a debugger myself I think that's about all I can figure out, but I can guess that the most likely cause will be that bugle is getting confused about what the current context is - either because it's not intercepting the WGL calls (entirely possible - Windows support is nowhere near as tested as GLX), or because the app isn't making a context current (although I'd expect the app not to work in that case). > The data stored in ans comes from obj->views[view] in the > bugle_object_get_data function. > The views array contains data initialised by bugle_object_new via the line > (*info->constructor)(key, obj->views[j]); > The constructor function pointer is pointing to the globjects_data_init > function, which initialises globjects_data structs in some memory location > given a pointer. This pointer is from obj->views[j] in the case above. > This is where I fear I've made an error, as if the above is correct it would > mean that ans = bugle_object_get_current_data(klass->parent, > klass->parent_view); is a void* pointing to a globjects_data. As such the > *(object **)ans cast doesn't make sense (as far as I can tell). What I suspect you're missing is that when bugle_object_get_current calls bugle_object_get_current_data, it passes klass->parent, not klass. The view it gets back is initialized in bugle_object_class_new. Regards Bruce -- Dr Bruce Merry bmerry <@> gmail <.> com http://www.brucemerry.org.za/ http://blog.brucemerry.org.za/ |