From: Matthieu M. <Mat...@gr...> - 2014-05-04 18:16:18
|
Hi, I'm using notion from Debian, and collapse.lua from here: https://github.com/dkogan/notion-scripts/blob/master/scripts/collapse.lua (move all clients to the same frame and close all other frames, like C-x 1 in Emacs) The last upgrade broke collapse.lua: using it now causes notion to segfault. Below is a valgrind trace. It seems notion doesn't like ioncore.defer( rqclose ) and ioncore.defer( move the managed clients) being called concurrently (my guess is that the order in which ioncore executes stuff changed, and it now tries to close the region before or concurrently to moving clients). I managed to somehow fix detach.lua like this: collapse={} function win_goto(w) return w['goto'](w) end function collapse.take_frame_to_here (region, current) if region ~= current then close_requested = false region:managed_i(function (cwin) io.stderr:write("attach " .. cwin:name() .. " to " .. current:name() .. "\n") ioncore.defer(function() current:attach(cwin) ioncore.defer(function () io.stderr:write("close " .. region:name() .. ".\n") region:rqclose() end) close_requested = true end) return true end) if not close_requested then ioncore.defer(function () io.stderr:write("close empty " .. region:name() .. ".\n") region:rqclose() end) end end return true end function collapse.collapse(ws) local current = ws:current() ws:managed_i (function (region) return collapse.take_frame_to_here(region, current) end) win_goto(current) end (not really happy with my nested ioncore.defer() ...) Can notion be fixed not to segfault in this case? Any lua/notion guru to help me do a cleaner fix? Or is it already the less ugly possible? Or is there a simpler way to achieve the same result? Thanks, And the valgrind trace: ==7319== Conditional jump or move depends on uninitialised value(s) ==7319== at 0x427147: frame_size_hints (in /usr/bin/notion) ==7319== by 0x422332: region_size_hints (in /usr/bin/notion) ==7319== by 0x4229D8: region_size_hints_correct (in /usr/bin/notion) ==7319== by 0x431BC6: sizepolicy (in /usr/bin/notion) ==7319== by 0x433A5F: group_do_attach_final (in /usr/bin/notion) ==7319== by 0x422021: ??? (in /usr/bin/notion) ==7319== by 0x434F06: group_do_load (in /usr/bin/notion) ==7319== by 0x436C1E: groupws_load (in /usr/bin/notion) ==7319== by 0x426534: create_region_load (in /usr/bin/notion) ==7319== by 0x42200D: ??? (in /usr/bin/notion) ==7319== by 0x42C282: mplex_load_contents (in /usr/bin/notion) ==7319== by 0x41B301: screen_init_layout (in /usr/bin/notion) ==7319== ==7319== Conditional jump or move depends on uninitialised value(s) ==7319== at 0x427157: frame_size_hints (in /usr/bin/notion) ==7319== by 0x422332: region_size_hints (in /usr/bin/notion) ==7319== by 0x4229D8: region_size_hints_correct (in /usr/bin/notion) ==7319== by 0x431BC6: sizepolicy (in /usr/bin/notion) ==7319== by 0x433A5F: group_do_attach_final (in /usr/bin/notion) ==7319== by 0x422021: ??? (in /usr/bin/notion) ==7319== by 0x434F06: group_do_load (in /usr/bin/notion) ==7319== by 0x436C1E: groupws_load (in /usr/bin/notion) ==7319== by 0x426534: create_region_load (in /usr/bin/notion) ==7319== by 0x42200D: ??? (in /usr/bin/notion) ==7319== by 0x42C282: mplex_load_contents (in /usr/bin/notion) ==7319== by 0x41B301: screen_init_layout (in /usr/bin/notion) ==7319== ==7319== Conditional jump or move depends on uninitialised value(s) ==7319== at 0x427147: frame_size_hints (in /usr/bin/notion) ==7319== by 0x422332: region_size_hints (in /usr/bin/notion) ==7319== by 0x433DEC: group_size_hints (in /usr/bin/notion) ==7319== by 0x422332: region_size_hints (in /usr/bin/notion) ==7319== by 0x4229D8: region_size_hints_correct (in /usr/bin/notion) ==7319== by 0x431806: ??? (in /usr/bin/notion) ==7319== by 0x431D67: sizepolicy (in /usr/bin/notion) ==7319== by 0x42B303: mplex_do_attach_final (in /usr/bin/notion) ==7319== by 0x422021: ??? (in /usr/bin/notion) ==7319== by 0x42C282: mplex_load_contents (in /usr/bin/notion) ==7319== by 0x41B301: screen_init_layout (in /usr/bin/notion) ==7319== by 0x42674C: ioncore_init_layout (in /usr/bin/notion) ==7319== ==7319== Conditional jump or move depends on uninitialised value(s) ==7319== at 0x427157: frame_size_hints (in /usr/bin/notion) ==7319== by 0x422332: region_size_hints (in /usr/bin/notion) ==7319== by 0x433DEC: group_size_hints (in /usr/bin/notion) ==7319== by 0x422332: region_size_hints (in /usr/bin/notion) ==7319== by 0x4229D8: region_size_hints_correct (in /usr/bin/notion) ==7319== by 0x431806: ??? (in /usr/bin/notion) ==7319== by 0x431D67: sizepolicy (in /usr/bin/notion) ==7319== by 0x42B303: mplex_do_attach_final (in /usr/bin/notion) ==7319== by 0x422021: ??? (in /usr/bin/notion) ==7319== by 0x42C282: mplex_load_contents (in /usr/bin/notion) ==7319== by 0x41B301: screen_init_layout (in /usr/bin/notion) ==7319== by 0x42674C: ioncore_init_layout (in /usr/bin/notion) ==7319== attach WGroupCW<1> to WFrame<5> attach WGroupCW<2> to WFrame<5> ==7319== Conditional jump or move depends on uninitialised value(s) ==7319== at 0x4204F5: region_may_dispose (in /usr/bin/notion) ==7319== by 0x420A78: region_rqdispose (in /usr/bin/notion) ==7319== by 0x43B874: mainloop_execute_deferred_on_list (in /usr/bin/notion) ==7319== by 0x4172EA: ioncore_mainloop (in /usr/bin/notion) ==7319== by 0x414F12: main (in /usr/bin/notion) ==7319== ==7319== Jump to the invalid address stated on the next line ==7319== at 0x0: ??? ==7319== by 0x4204FD: region_may_dispose (in /usr/bin/notion) ==7319== by 0x420A78: region_rqdispose (in /usr/bin/notion) ==7319== by 0x43B874: mainloop_execute_deferred_on_list (in /usr/bin/notion) ==7319== by 0x4172EA: ioncore_mainloop (in /usr/bin/notion) ==7319== by 0x414F12: main (in /usr/bin/notion) ==7319== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==7319== notion: Caught fatal signal 11. Dying without deinit. p==7319== ==7319== HEAP SUMMARY: ==7319== in use at exit: 1,781,500 bytes in 14,449 blocks ==7319== total heap usage: 43,029 allocs, 28,580 frees, 5,543,173 bytes allocated ==7319== ==7319== LEAK SUMMARY: ==7319== definitely lost: 224 bytes in 1 blocks ==7319== indirectly lost: 176 bytes in 2 blocks ==7319== possibly lost: 0 bytes in 0 blocks ==7319== still reachable: 1,781,100 bytes in 14,446 blocks ==7319== suppressed: 0 bytes in 0 blocks ==7319== Rerun with --leak-check=full to see details of leaked memory ==7319== ==7319== For counts of detected and suppressed errors, rerun with: -v ==7319== Use --track-origins=yes to see where uninitialised values come from ==7319== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 10 from 3) -- Matthieu Moy http://www-verimag.imag.fr/~moy/ |