natemaia / dk

X11 window manager
MIT License
20 stars 0 forks source link

Crash when I try to do dkcmd restart #11

Closed TAforever closed 1 month ago

TAforever commented 2 months ago

If I run this command in the terminal, then the restart occurs without problems, but if I call this command using a hotkey (sxhkd), it leads to dk crash

natemaia commented 2 months ago

I'll check it out as soon as I can, very busy with life and work right now so please forgive some delays.

Cheers

TAforever commented 2 months ago

I did git bisect on the two issues I opened and this is the result I got:

f1f40844da5039ac83a52964d5b7bca54167f364 is the first bad commit commit f1f40844da5039ac83a52964d5b7bca54167f364 Author: natemaia natemaia10@gmail.com Date: Tue Jan 23 18:34:31 2024 -0800

Various fixes and changes

- Always flush after property changes via PROP macro (should fix issues
  with EWMH atoms not being updated immediately).
- Ignore some events and calls on startup (may fix/help with flicker).
- General cleanup and style, switch unsigned int/short to uint32_t/uint8_t.
natemaia commented 1 month ago

Hmm I'm not getting this and I'm not sure how this would happen. Is there something specific about your setup that might cause this?

TAforever commented 1 month ago

This doesn't happen every time. Here is my config dkrc.txt sxhkdrc.txt

natemaia commented 1 month ago

Try it without the autostart section of your dkrc, I'm not sure what it is but we can start there and see what is causing it. Things that should not be reloaded every time dk restarts shouldn't be in the dkrc or they should be wrapped with a pkill to avoid duplicate processes being opened e.g.

picom &

# could become

pgrep picom || picom &

I would suggest moving them to ~/.xinitc that way they only run once when you start X, then dk restarts have nothing to do with it. Just a suggestion.

I'll keep looking into the bisect changes but I'm not seeing much that would cause a crash.

Failing that you could run it in heavy debug mode and dump the output to a log. Once it crashes copy the log somewhere and upload it to pastebin or similar to post here. That will give me an idea of where exactly the crash is happening.

To do this you need to rebuild dk but don't install it

make clean && make fdebug

Now you have a dk executable that you need to use (assuming you're using startx, if not we can do this with a DM too) so edit your ~/.xinitrc to run that and output the info somewhere

exec /PATH/TO/dk/dk > ~/.dk.log 2>&1

Reboot or log out and back in, now cause the crash to occur and move the log somewhere so it isn't overwritten when you log back in

cp ~/.dk.log ~/dk.log

The bottom of the log will give me the last lines that were executing before the crash.

Don't run this build for any use other than this because it generates a TON of data and the logfile can quickly grow, don't want that kind of wear on your drive all the time.

TAforever commented 1 month ago

I realized that for some reason the crash is due to polybar, but this problem does not exist in bspwm and did not exist in dk before commit f1f4084. I also attach the log dk.log

natemaia commented 1 month ago

Thanks, give me a few minutes to check the log out and see if I can find anything.

Also thanks a lot for the help and being so patient :)

natemaia commented 1 month ago

@TAforever can you try the latest commits and let me know if it still happens, another log could be helpful if it is.

natemaia commented 1 month ago

Can I see your polybar script as well, might help in me reproducing it myself and not needing to get you running debug :D

TAforever commented 1 month ago

Great! The last commit fixed the problem, thanks!

TAforever commented 1 month ago

Would you like to release a new version so that people who don't use the git version have a better experience?

natemaia commented 1 month ago

Yea I think that's a good idea, I'll bump the version shortly!

natemaia commented 1 month ago

Can you test one last commit so I can see what exactly was the fix? I just pushed it, I don't want to waste the performance if it wasn't a part of the issue so I want to verify

TAforever commented 1 month ago

Tested it, everything works without problems

natemaia commented 1 month ago

Awesome, new version incoming

natemaia commented 1 month ago

2.3 is in the AUR now, I'll let the void packager know to update his as well, thanks for the help and bringing issues like this to light, I really appreciate it!!!

Cheers, Nathaniel

TAforever commented 1 month ago

Good!