Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfaults when fonts aren't found #28

Open
stainless81 opened this issue Apr 22, 2020 · 0 comments
Open

segfaults when fonts aren't found #28

stainless81 opened this issue Apr 22, 2020 · 0 comments
Labels
bug The issue exposes a bug.

Comments

@stainless81
Copy link

Please forgive me if my github etiquette is lacking. This is my first time filing an issue.

With version 0.76 there seems to be some problems if fonts are missing.

In Font.cc on lines 450 and 462, if the font specified in the style file is not found, NULL pointers are dereferenced causing segfaults. Wrapping those and returning 0 if the pointers are NULL leads to another segfault.

#0 0x00007effcf9671b0 in XmbTextExtents () from /usr/lib64/libX11.so.6
#1 0x00000000004443b0 in bt::textRect (screen=, font=...,
text="m\000\000\000:\000\000\000m\000\000\000m\000\000\000m\000\000\000m\000\000\000 \000\000\000 \000\000\000 \000\000\000 \000\000\000m\000\000\000:\000\000\000m\000\000\000m\000\000\000m\000\000\000m\000\000\000") at Font.cc:398
#2 0x0000000000414374 in BScreen::updateGeomWindow (this=0x1e8a6c0) at ../lib/Display.hh:84
#3 0x000000000041ba24 in BScreen::reconfigure (this=0x1e8a6c0) at Screen.cc:522
#4 0x000000000043aea0 in std::mem_fun_t<void, BScreen>::operator() (__p=, this=) at /usr/include/c++/9.3.0/bits/stl_function.h:1211
#5 std::for_each<BScreen**, std::mem_fun_t<void, BScreen> > (__f=..., __last=0x1ea1d18, __first=0x1ea1d10) at /usr/include/c++/9.3.0/bits/stl_algo.h:3876
#6 Blackbox::timeout (this=0x7ffc6f775460) at blackbox.cc:402
#7 0x000000000043e457 in bt::Application::run (this=0x7ffc6f775460) at Application.cc:300
#8 0x000000000040a0f8 in main (argc=1, argv=0x7ffc6f7758e8) at main.cc:167
(gdb)

The Font.cc:398 might be off a little, as I had been editing that file to check for NULL pointers, but those /should/ all be after that line leaving this one unaffected.

I was going to debug it further and hopefully be able to submit a patch, but that may be a few days off; I haven't really dug into the blackbox source since 0.65. Right now it's easier for me to make sure the right fonts are present.

@bbidulock bbidulock added the bug The issue exposes a bug. label Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue exposes a bug.
Projects
None yet
Development

No branches or pull requests

2 participants