|
> 1. Comment out lines 106,107,108 the ones with the string concatenationLooks to me like a basic buffer overrun, clobbering something that is required by lua_close - hence the crash on lua_close.
Adding a new line 109:
printf("\n\n ***strlen of fullerr: %d ***\n\n", strlen(fullerr));
You should see that you overrun the length of buffer by 28 bytes (strlen does't include terminating zero).
Replace your strcpy/strcat with strncpy/strncat, or use a luaL_Buffer to construct the error, or use your platform's equivalent of open_memstream along with fprintf.
Thanks,
Kevin