On 30.11.2012 11:15, Daniel wrote:
> On 2012-08-22, Uli Schlachter <[email protected]> wrote:
>> Hm, I guess this should crash awesome. :-)
>>
>> Try this instead:
>>
>> local do_not_ever_touch_this_variable =
>> cairo.ImageSurface.create_from_png("/tmp/Applications-mplayer.png")
>>
>> { rule_any = { class = { "MPlayer" } },
>> properties = { icon = do_not_ever_touch_this_variable._native }
>> },
>
> This now crashes awesome (current git). Not often, and unpredictably, but
> perhaps every 15 times I run mplayer. Been happening for a couple of weeks or
> so. I thought it was mplayer or the X server, but finally remembered this
> entry, removed it, and crashes were gone...
Seems like it crashes as soon as the garbage collector is done once (see
attached patch). Just removing the "local" makes the crash go away here. I
didn't know that lua is this smart...
> #0 0xb72dc58d in cairo_image_surface_get_height () from
> /usr/lib/libcairo.so.2
> #1 0x080559ff in draw_dup_image_surface (surface=surface@entry=0x95bb300)
> at /home/quite/src/aur/awesome-git/src/awesome-build/draw.c:202
Attached is the patch that I tested this with. The error message on stderr was:
awesome: cairo-surface.c:905: cairo_surface_reference: Assertion
`((*&(&surface->ref_count)->ref_count) > 0)' failed.
In other words "this surface was already destroyed".
Hey Arnaud, do you have anything which is remotely similar to this issue in your
config? Could this explain your random crashes?
Uli
--
"In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move."
diff --git a/awesomerc.lua.in b/awesomerc.lua.in
index 440bf76..9f1e6a6 100644
--- a/awesomerc.lua.in
+++ b/awesomerc.lua.in
@@ -341,6 +341,10 @@ root.keys(globalkeys)
-- }}}
-- {{{ Rules
+local do_not_ever_touch_this_variable =
require("lgi").cairo.ImageSurface.create_from_png("/home/psychon/Wallpaper/barcode.png")
+local t = timer({timeout=1})
+t:connect_signal("timeout", function() collectgarbage("collect") end)
+t:start()
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
@@ -348,6 +352,7 @@ awful.rules.rules = {
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
keys = clientkeys,
+ icon = do_not_ever_touch_this_variable._native,
buttons = clientbuttons } },
{ rule = { class = "MPlayer" },
properties = { floating = true } },