Chumby, lua and segmentation fault

I’ve been digging through some of my older projects (read abandoned) and I came across a small lua library I had started writing to interface with the frame buffer on the Chumby, source available:

If I remember correctly the library works and allows you to draw to the screen using lua however it produces a segmentation fault I tracked the error down to the setup method that gets called when the library is first loaded.

int luaopen_screen(lua_State *L) {
    luaL_newmetatable(L, SCREENMETA);
    luaL_register(L, "screen", screenLib);
    
    return 1;
}

I believe it’s line 2 that’s seg faulting, it’s trying to set a meta table for the screen type so that eventually with a few updates to the library it can be used in an object oriented fashion in lua. If anyone has any ideas feel free to comment, and like always code is free to use it might help to give a head start if you were thinking of developing lua apps for the chumby.

David Roberts

Read more posts by this author.

Newcastle upon Tyne, UK https://davidatroberts.github.io/