taffybar / taffybar

A gtk based status bar for tiling window managers such as XMonad
BSD 3-Clause "New" or "Revised" License
696 stars 136 forks source link

WSHUD crashes and WSS doesnt #235

Closed teleshoes closed 6 years ago

teleshoes commented 7 years ago

@IvanMalison im adding this separately from the 'repainting' bug because that one is actually fixed for me, and so the overall crashing is MUCH reduced.

however, its still true that WSHUD crashes about once a day, and WSS doesnt

im reaaaallly sorry to say this, believe me :(

teleshoes commented 7 years ago

the errors i get are similar to the crashes from other issues, e.g.: #231

the reason i posted a separate issue is to track crashes that only affect WSHUD for me.

here is the one i just got a few min ago:

*** Error in `/home/wolke/.cache/taffybar/taffybar-linux-x86_64': realloc(): invalid next size: 0x0000000003406d50 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f72ca873bfb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f72ca879fc6]
/lib/x86_64-linux-gnu/libc.so.6(+0x7a13c)[0x7f72ca87d13c]
/lib/x86_64-linux-gnu/libc.so.6(realloc+0x159)[0x7f72ca87e719]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_realloc+0x20)[0x7f72cd66c5e0]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x31115)[0x7f72ced1e115]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x3258a)[0x7f72ced1f58a]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(gdk_region_intersect+0x72)[0x7f72ced1fb42]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x3e347)[0x7f72ced2b347]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(gdk_window_process_all_updates+0x118)[0x7f72ced2bed8]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x3ef39)[0x7f72ced2bf39]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x1dd37)[0x7f72ced0ad37]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x155)[0x7f72cd666dd5]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4b1a0)[0x7f72cd6671a0]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_loop_run+0xc2)[0x7f72cd6674b2]
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_main+0xb7)[0x7f72cf0d13b7]
/home/wolke/.cache/taffybar/taffybar-linux-x86_64[0x47b414]
======= Memory map: ========
teleshoes commented 7 years ago

@IvanMalison WSS still doesnt crash, but after the recent changes, it DOES pause taffybar painting if many icons update (rapidly switch between windows). this is probably because of all the calls being funneled through one thread to solve the low-level haskell-x11 concurrency bug.

=> i cant actually use WSS anymore, either. oh well

teleshoes commented 7 years ago

(ironically, this is the identical problem i had with WSHUD in the very beginning)

colonelpanic8 commented 7 years ago

@IvanMalison WSS still doesnt crash, but after the recent changes, it DOES pause taffybar painting if many icons update (rapidly switch between windows). this is probably because of all the calls being funneled through one thread to solve the low-level haskell-x11 concurrency bug.

@teleshoes Hmmmm. This could probably be fixed in WSS if we grouped all of the calls to get x11 information together, so that it didnt end up making separate asynchronous request to the thread for each piece of information.

The other reason you might be getting the slowdown in WSS and not WSHUD is because WSHUD has a rate limiter, so that rapid update triggering events wont cause the ui thread to hang. I imagine that it would be relatively easy to do the same for WSS.

colonelpanic8 commented 7 years ago

WSS still doesnt crash,

You've only been running it for a day. Is that really enough time to be sure of that? Lets wait a little longer. I'm really only getting the memory crash about once a day as it is right now. I thought you said you were getting something similar.

teleshoes commented 7 years ago

You've only been running it for a day. Is that really enough time to be sure of that?

i was just trying to be clear that it hasnt crashed yet, despite the icon-switching slowdown. im still on WSS, though i might have to switch eventually if the slowdown gets too painful

colonelpanic8 commented 6 years ago

@teleshoes does this issue persist for you on the latest versions? I still haven't really seen anything like this.

teleshoes commented 6 years ago

this is unchanged. my taffybar crashes literally every day, though i havent tried WSS in awhile to compare

colonelpanic8 commented 6 years ago

WSS doesn't exist any more, and there are a bunch of really significant changes in the latest version wrt how events are processed. Are you on 2.0.0?

teleshoes commented 6 years ago

im on 1d089ea. i tried to build against master yday in fact, but i couldnt get haskell-gi to build for some reason. cabal install fails with a compilation error. havent looked into it too closely yet

teleshoes commented 6 years ago

this is what i get when i try to simply build it from pkg-config:

wolke:~/Code/taffybar$ cabal install
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: taffybar-2.0.0 (user goal)
next goal: haskell-gi (dependency of taffybar-2.0.0)
rejecting: haskell-gi-0.21.2 (conflict: requires pkg-config package
gobject-introspection-1.0>=1.32, not found in the pkg-config database)
rejecting: haskell-gi-0.21.1, haskell-gi-0.21.0, haskell-gi-0.20.3,
haskell-gi-0.20.2, haskell-gi-0.20.1, haskell-gi-0.20, haskell-gi-0.18,
haskell-gi-0.17.4, haskell-gi-0.17.3, haskell-gi-0.17.2, haskell-gi-0.17.1,
haskell-gi-0.17, haskell-gi-0.15, haskell-gi-0.14, haskell-gi-0.13,
haskell-gi-0.12, haskell-gi-0.11, haskell-gi-0.10.2, haskell-gi-0.10.1,
haskell-gi-0.10, haskell-gi-0.9, haskell-gi-0.8 (conflict: taffybar =>
haskell-gi>=0.21.2)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: taffybar, haskell-gi

this is what i get when i try to build gi-gtk binding explicitly:

wolke:~/Code/haskell-gi$ cabal install gi-gtk
Resolving dependencies...
Downloading haskell-gi-base-0.17...
Configuring haskell-gi-base-0.17...
Building haskell-gi-base-0.17...
Failed to install haskell-gi-base-0.17
Build log ( /home/wolke/.cabal/logs/ghc-8.2.2/haskell-gi-base-0.17-5m4A9m7lzaiDpRqURw4hFA.log ):
cabal: Entering directory '/tmp/cabal-tmp-17394/haskell-gi-base-0.17'
Configuring haskell-gi-base-0.17...
Preprocessing library for haskell-gi-base-0.17..
Building library for haskell-gi-base-0.17..
[ 1 of 18] Compiling Data.GI.Base.BasicTypes ( dist/build/Data/GI/Base/BasicTypes.hs, dist/build/Data/GI/Base/BasicTypes.o )
[ 2 of 18] Compiling Data.GI.Base.GHashTable ( dist/build/Data/GI/Base/GHashTable.hs, dist/build/Data/GI/Base/GHashTable.o )
[ 3 of 18] Compiling Data.GI.Base.GParamSpec ( dist/build/Data/GI/Base/GParamSpec.hs, dist/build/Data/GI/Base/GParamSpec.o )
[ 4 of 18] Compiling Data.GI.Base.Overloading ( src/Data/GI/Base/Overloading.hs, dist/build/Data/GI/Base/Overloading.o )
[ 5 of 18] Compiling Data.GI.Base.Utils ( dist/build/Data/GI/Base/Utils.hs, dist/build/Data/GI/Base/Utils.o )
[ 6 of 18] Compiling Data.GI.Base.ManagedPtr ( src/Data/GI/Base/ManagedPtr.hs, dist/build/Data/GI/Base/ManagedPtr.o )
[ 7 of 18] Compiling Data.GI.Base.Closure ( src/Data/GI/Base/Closure.hs, dist/build/Data/GI/Base/Closure.o )
[ 8 of 18] Compiling Data.GI.Base.BasicConversions ( dist/build/Data/GI/Base/BasicConversions.hs, dist/build/Data/GI/Base/BasicConversions.o )
[ 9 of 18] Compiling Data.GI.Base.GVariant ( dist/build/Data/GI/Base/GVariant.hs, dist/build/Data/GI/Base/GVariant.o )
[10 of 18] Compiling Data.GI.Base.GValue ( dist/build/Data/GI/Base/GValue.hs, dist/build/Data/GI/Base/GValue.o )
[11 of 18] Compiling Data.GI.Base.Properties ( dist/build/Data/GI/Base/Properties.hs, dist/build/Data/GI/Base/Properties.o )
[12 of 18] Compiling Data.GI.Base.Attributes ( src/Data/GI/Base/Attributes.hs, dist/build/Data/GI/Base/Attributes.o )

src/Data/GI/Base/Attributes.hs:160:5: error:
    • Couldn't match type ‘p0 -> AttrLabelProxy a0’
                     with ‘AttrLabelProxy x’
      Expected type: AttrLabelProxy a
        Actual type: p0 -> AttrLabelProxy a0
    • The equation(s) for ‘fromLabel’ have one argument,
      but its type ‘AttrLabelProxy a’ has none
      In the instance declaration for ‘IsLabel x (AttrLabelProxy a)’
    |
160 |     fromLabel _ = AttrLabelProxy
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
teleshoes commented 6 years ago

yea nevermind, was missing the devel header for libgirepository... sry! lll try to build now

colonelpanic8 commented 6 years ago

@teleshoes are you on debian? if so, what version of gtk are you using?

Looking at the traceback above, I suspect that this could have to do with the gtk version that you have installed.

teleshoes commented 6 years ago

now an actual problem i dont know how to instantly solve:

wolke:~/Code/taffybar$ cabal install
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: gtk-sni-tray-0.1.2.0 (dependency of taffybar-2.0.0)
next goal: gi-dbusmenugtk3 (dependency of gtk-sni-tray-0.1.2.0)
rejecting: gi-dbusmenugtk3-0.4.1 (conflict: requires pkg-config package
dbusmenu-gtk3-0.4-any, not found in the pkg-config database)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: taffybar, gtk-sni-tray,
gi-dbusmenugtk3
teleshoes commented 6 years ago

yea, good call. i added , haskell-gi-overloading == 0.0.* to my cabal and it went away

teleshoes commented 6 years ago

FINALLY got it to work. 1) in addition to what devel headers they say you need for haskell-gi, you ALSO need libdbusmenu-gtk3-dev and libgirepository1.0-dev. if thats in the docs, i couldnt find it 2) i needed to install c2hs as well, but cabal is nice enough to tell you this explicitly 3) im on ghc 8.2 and had to add haskell-gi-overloading=0.0 to my build depends 4) widget renames and other cleanups were easy, but a lot of the stuff i use from Pager i need to figure out. will take me a bit

after i get my taffybar building against my newly installed 2.0, i will let you know if the problem vanishes

colonelpanic8 commented 6 years ago

widget renames and other cleanups were easy, but a lot of the stuff i use from Pager i need to figure out. will take me a bit

There's no more need for explicit dependency on pager. You can simply run subscribeToEvents if you actually have a need for something pager like.

Or do you mean the stuff that was in PagerConfig that affected ui? All of that has basically moved to its own config object for each widget.

The pager data type was trying to do way too many things. It was a config holder, registration handler, event loop etc etc.

teleshoes commented 6 years ago

yea, i agree with all the changes ive seen so far; its just a LOT of changes (and i do not need a pager)

teleshoes commented 6 years ago

@IvanMalison took me 4 full hours, but i am FINALLY on taffybar 2.0.0! gotta say, the code is much nicer, some really necessary cleanups. also, icons are MUCH MUCH faster, especially now that i can skip parsing EWMH icons when i have a custom icon override. otherwise, i have the identical set up, to the pixel.

well almost; the Windows widget appears to be completely broken, displays nothing at all even with default config. i replaced it with a simple polling-label with getActiveWindowTitle for now

colonelpanic8 commented 6 years ago

took me 4 full hours, but i am FINALLY on taffybar 2.0.0! Glad to hear it. Sorry that it took so long/there were so many changes, but I figured that doing all of the backwards incompatible stuff was probably the best way to approach this. The good news is that there shouldn't be tons more of these sorts of changes in the near future (other than the migration to gi-gtk for the core, which is actually already taking place).

also, icons are MUCH MUCH faster, especially now that i can skip parsing EWMH icons when i have a custom icon override.

Yeah, and they should get EVEN faster when we do #279 to more intelligently fetch icons.

well almost; the Windows widget appears to be completely broken, displays nothing at all even with default config. i replaced it with a simple polling-label with getActiveWindowTitle for now

@teleshoes oh that's weird. Might be that a widgetShowAll was forgotten somewhere. It does work for me, but I wrap it with a buildPadBox, which might be why it is visible.

teleshoes commented 6 years ago

@IvanMalison yep, just a missing widgetShowAll ;)

colonelpanic8 commented 6 years ago

Filed #313

teleshoes commented 6 years ago

@IvanMalison thanks ok, i will leave this setup alone for awhile, remove my auto-restart, and see how often i have to manually restart taffybar. heres hoping you murdered this issue while refactoring icons. thanks again!

colonelpanic8 commented 6 years ago

@teleshoes you never told me which gtk version you are using. Are you on a version that is < 3.22?

teleshoes commented 6 years ago

sorry i forgot: yes, im on debian. no, my gtk3 version is 3.22.30

teleshoes commented 6 years ago

btw, im optimistic about this issue being fixed; it already didnt crash today, though im not certain i didnt recompile midday

teleshoes commented 6 years ago

i am SOLD. 4 machines running for 3 days without a single taffybar crash. i will re-open this if it happens again, but im pretty sure this is fixed in 2.0.0. :D

colonelpanic8 commented 6 years ago

@teleshoes that's awesome to hear!