GNOME Bugzilla – Bug 750955
CRITICAL **: grl_l_callback: assertion 'os != NULL' failed
Last modified: 2015-07-08 08:27:27 UTC
It's possible to throw this error when doing something like: count = grl.get_options("count") for i, item in pairs(json) do count = count - 1 grl.callback(media, count) end grl.callback() The last grl.callback will throw a "system" error, instead of telling the developer about the broken script.
+ Trace 235166
Should we keep track of recent completed operations, and throw an error if the last item was already sent?
On grl_lua_library_set_current_operation we throw a warning with good information about the problem that just happened: "Source '%s' is broken, as there are no pending operations and grl.callback() was not called" I think a good warning should be enough in this case, pointing to where in Lua source code the grl.callback was trigger which luaL_error provides http://www.lua.org/manual/5.3/manual.html#luaL_error If not good enough, we can improve in the future.
Created attachment 307025 [details] [review] lua-factory: throw error on bad grl.callback Throw luaL_error instead of system error on broken sources. This facilitate the developer to find bad usage of grl.callback on lua sources.
Example of error from last patch by breaking grl-metrolyrics when including another grl.callback() in fetch_page_cb function: /lua_factory/sources/metrolyrics: (test_lua_metrolyrics:5080): Grilo-WARNING **: [lua-library] grl-lua-library.c:423: calling source callback function fail (fetch_page_cb) '/home/vtosodec/jhbuild/src/grilo-plugins/src/lua-factory/sources/grl-metrolyrics.lua:86: Source is broken as grl.callback() was called after last operation has been finalized' Trace/breakpoint trap (core dumped)
Review of attachment 307025 [details] [review]: Looks good.
The following fix has been pushed: fe1a534 lua-factory: throw error on bad grl.callback
Created attachment 307054 [details] [review] lua-factory: throw error on bad grl.callback Throw luaL_error instead of system error on broken sources. This facilitate the developer to find bad usage of grl.callback on lua sources.