Open Elv13 opened 5 years ago
==1298== Invalid read of size 8
==1298== at 0x4885623: lgi_object_2lua (object.c:353)
Uhm. In my version, that line of code is
*(gpointer *) lua_newuserdata (L, sizeof (obj)) = obj;
Oh, wait. You are saying that this happens with version 0.9.0. Why are you using this particular version? The code is:
object_type (L, G_TYPE_FROM_INSTANCE (obj));
So, apparently G_TYPE_FROM_INSTANCE
is being called on a null pointer.
I really recommend checking with a newer LGI version first (nothing can be done to change old versions), but then: Could you build LGI with debug symbols and perhaps without optimisations? I can look up how to do that (and how to run a Lua script against an uninstalled LGI version) later if you want.
For your Lua code: attempt to index global 'swindow' (a nil value)
Could you fix that? (well, the fix itself is quite obvious, but could you double-check the new code crashes for you?)
After the fix, this does not crash here for me (of course it does not).
Uhm... you seem to have older versions of things.
FYI: I just got back from vacation.
So, apparently G_TYPE_FROM_INSTANCE is being called on a null pointer.
...which is impossible, because the function actually checks if obj
is NULL first. So... either there is some memory corruption that breaks the underlying (((GTypeClass*) ((((GTypeInstance*) (obj))->g_class)))->g_type)
that this macro expands to, or we have misleading debug information due to compiler optimisations, or... something else.
For a while less and less of the AwesomeWM have been working for me. I am not totally sure what the issue is since it involve casting pointers to random (lua held) places and at some point things become invalid. I didn't investigate much either.
Lua 5.1, GTK3 3.24.10, GObject Introspection 1.58.3 and LGI 0.9.0
It works fine with a "pure luarocks" stack created with the Lua 5.3 slot (+ LGI 0.9.2). Re-installing the system LGI (0.9.0) with the 5.1 slot brings the breakages back. It used to work fine on 5.1. I always try to use 5.1 because it is the less problematic for development (beside missing
unpack
declaration). Is .9 the cause or "something changed" in GObject Introspection?