[Bug 1042012] Latest gcc 7-1.2 cause crash
http://bugzilla.novell.com/show_bug.cgi?id=1042012 http://bugzilla.novell.com/show_bug.cgi?id=1042012#c8 --- Comment #8 from Richard Biener <rguenther@suse.com> --- (In reply to Dr. Werner Fink from comment #7)
Created attachment 727291 [details] source-luatex.dif
(In reply to Richard Biener from comment #6)
So as I thought GCC is taking advantage of
#ifdef _MSC_VER __declspec(align(16)) #endif struct cdata { const struct ctype type #ifdef __GNUC__ __attribute__ ((aligned(16))) #endif ; };
when loading from cd->type but
cd = (struct cdata*) lua_touserdata(L, idx);
lua_touserdata doesn't honor that alignment. You can probably see that at the point of the crash %eax is not aligned to 16 bytes.
Aha ... thanks, with the attached patch the problem is gone. Maybe gcc7 should throw an error at compile time if the aligment does not fit.
Well, the compiler doesn't know that lua_touserdata doesn't properly align the type. Whatever that function does. Dropping the aligned attribute is a valid fix (the extra NULL check seems unrelated to the issue). Is the aligned attribute new compared to the old sources?
The function lua_touserdata() is from lua52 library
-- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com