Game freezes after upgrading harfbuzz 14.4.0-1 => 14.5.0-1
Author: ApstolCreated Sep 27, 2026Updated Sep 27, 2026
Labelsbugm:sfml-graphics
Prerequisite Checklist
- I searched for existing issues to prevent duplicates
- I searched for existing discussions on the forum to prevent duplicates
- I am here to report an issue and not to just ask a question or look for help (use the forum or Discord instead)
Describe your issue here
After updating the system packages (harfbuzz 14.4.0-1 => 14.5.0-1), the game started freezing on state changes (MenuState => GameState) probably because of some deadlock issues while trying to free sf::Text. Downgrading manually harfbuzz 14.5.0-1 => 14.4.0-1 fixes the issue. Below is the debug info:
~/Projects/temp > gdb ./build/bin/Match3 λ:master [ ]
GNU gdb (GDB) 17.2
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/bin/Match3...
This GDB supports auto-downloading debuginfo from the following URLs:
<https://debuginfod.archlinux.org>
Enable debuginfod for this session? (y or [n])
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
(No debugging symbols found in ./build/bin/Match3)
(gdb)
(gdb) run
Starting program: /home/dima/Projects/temp/build/bin/Match3
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe6bff6c0 (LWP 34323)]
[New Thread 0x7fffe5fff6c0 (LWP 34324)]
[New Thread 0x7fffe57fe6c0 (LWP 34325)]
[New Thread 0x7fffe4ffd6c0 (LWP 34326)]
[New Thread 0x7fffd7fff6c0 (LWP 34327)]
[New Thread 0x7fffd77fe6c0 (LWP 34328)]
[New Thread 0x7fffd6ffd6c0 (LWP 34329)]
[New Thread 0x7fffd67fc6c0 (LWP 34330)]
[New Thread 0x7fffd5bff6c0 (LWP 34331)]
[New Thread 0x7fffd53fe6c0 (LWP 34332)]
[New Thread 0x7fffd4bfd6c0 (LWP 34333)]
Applying action:0
Applying state id:1
MenuState::MenuState
[New Thread 0x7fffb3fff6c0 (LWP 34334)]
[New Thread 0x7fffb37fe6c0 (LWP 34335)]
Applying action:1
Applying state id:0
MenuState::~MenuState
^C
Thread 1 "Match3" received signal SIGINT, Interrupt.
0x00007ffff7494efe in ?? () from /usr/lib/libc.so.6
(gdb) bt full
#0 0x00007ffff7494efe in ?? () from /usr/lib/libc.so.6
No symbol table info available.
#1 0x00007ffff749b9e4 in pthread_mutex_lock () from /usr/lib/libc.so.6
No symbol table info available.
#2 0x00007ffff7c1bd8a in ?? () from /usr/lib/libharfbuzz.so.0
No symbol table info available.
#3 0x00007ffff7b3823f in ?? () from /usr/lib/libharfbuzz.so.0
No symbol table info available.
#4 0x00007ffff7b4b768 in hb_blob_destroy () from /usr/lib/libharfbuzz.so.0
No symbol table info available.
#5 0x00007ffff7c66eae in ?? () from /usr/lib/libfreetype.so.6
No symbol table info available.
#6 0x00007ffff7c66f96 in FT_Done_Face () from /usr/lib/libfreetype.so.6
No symbol table info available.
#7 0x00007ffff7c1bcc3 in ?? () from /usr/lib/libharfbuzz.so.0
No symbol table info available.
#8 0x00007ffff7c0d635 in ?? () from /usr/lib/libharfbuzz.so.0
No symbol table info available.
#9 0x00007ffff7b70d46 in hb_font_destroy () from /usr/lib/libharfbuzz.so.0
No symbol table info available.
#10 0x00005555555f37b9 in sf::Text::ShaperImpl::ShaperDeleter::operator()(hb_font_t*) const ()
No symbol table info available.
#11 0x00005555555f329f in std::unique_ptr<hb_font_t, sf::Text::ShaperImpl::ShaperDeleter>::~unique_ptr() ()
No symbol table info available.
#12 0x00005555555f38ca in sf::Text::ShaperImpl::~ShaperImpl() ()
No symbol table info available.
#13 0x00005555555f3895 in void std::_Destroy<sf::Text::ShaperImpl>(sf::Text::ShaperImpl*) ()
No symbol table info available.
#14 0x00005555555f2f4f in std::_Sp_counted_ptr_inplace<sf::Text::ShaperImpl, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
No symbol table info available.
#15 0x000055555558e5ea in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use() ()
No symbol table info available.
#16 0x000055555558e5c5 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold() ()
No symbol table info available.
#17 0x000055555558e59e in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
No symbol table info available.
#18 0x000055555558e476 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() ()
No symbol table info available.
#19 0x000055555558e449 in std::__shared_ptr<sf::Text::ShaperImpl, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() ()
No symbol table info available.
#20 0x000055555558e345 in std::shared_ptr<sf::Text::ShaperImpl>::~shared_ptr() ()
No symbol table info available.
#21 0x000055555558e13d in sf::Text::~Text() ()
No symbol table info available.
#22 0x000055555558e206 in MenuState::~MenuState() ()
No symbol table info available.
#23 0x000055555558e239 in MenuState::~MenuState() ()
No symbol table info available.
#24 0x0000555555590348 in std::default_delete<State>::operator()(State*) const ()
No symbol table info available.
#25 0x00005555555902bf in std::unique_ptr<State, std::default_delete<State> >::~unique_ptr() ()
No symbol table info available.
#26 0x0000555555590275 in void std::destroy_at<std::unique_ptr<State, std::default_delete<State> > >(std::unique_ptr<State, std::default_delete<State> >*) ()
No symbol table info available.
#27 0x00005555555920af in std::vector<std::unique_ptr<State, std::default_delete<State> >, std::allocator<std::unique_ptr<State, std::default_delete<State> > > >::pop_back() ()
No symbol table info available.
#28 0x0000555555591c38 in StateStack::applyPendingChanges() ()
No symbol table info available.
#29 0x00005555555917ea in StateStack::handleEvent(sf::Event const&) ()
No symbol table info available.
#30 0x0000555555591370 in Game::handleInput() ()Your Environment
- OS: Arch Linux x86_64. Kernel: 6.18.53-1-lts. Window manager: i3
- SFML version: 3.1.0
- Compiler / toolchain: Clang 22.1.8, CMake
Steps to reproduce
- Create main.cpp file in src directory with the contents below (change path to your font in Game constructor).
#include <exception>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <stdexcept>
#include <SFML/Graphics.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/System/Time.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/Window/VideoMode.hpp>
namespace States {
enum ID { None,
Menu,
Game };
}
class StateStack;
class State {
public:
typedef std::unique_ptr<State> Ptr;
struct Context {
explicit Context(sf::RenderWindow& window, sf::Font& font);
sf::RenderWindow& window;
sf::Font& font;
};
State(StateStack& stack, Context context);
virtual ~State();
virtual bool handleEvent(const sf::Event& event) = 0;
virtual bool update(sf::Time elapsedTime) = 0;
virtual void draw() = 0;
protected:
void requestStackPush(States::ID stateID);
void requestStackPop();
void requestStateClear();
Context& getContext();
private:
StateStack& stack;
Context context;
};
class StateStack {
public:
enum Action { Push,
Pop,
Clear };
explicit StateStack(State::Context context)
: stack {}
, pendingList {}
, context { context }
, factories {}
{
}
template <typename T>
void registerState(States::ID stateId);
void handleEvent(const sf::Event& event)
{
for (auto itr = this->stack.rbegin(); itr != this->stack.rend(); ++itr) {
if (!(*itr)->handleEvent(event)) {
break;
}
}
applyPendingChanges();
}
void update(sf::Time elapsedTime)
{
for (auto itr = this->stack.rbegin(); itr != this->stack.rend(); ++itr) {
if (!(*itr)->update(elapsedTime)) {
break;
}
}
applyPendingChanges();
}
void draw()
{
for (State::Ptr& state : this->stack) {
state->draw();
}
}
void pushState(States::ID stateId)
{
pendingList.push_back(PendingChange(Push, stateId));
}
void popState()
{
pendingList.push_back(PendingChange(Pop));
}
void clearStates()
{
pendingList.push_back(PendingChange(Clear));
}
bool isEmpty() const
{
return this->stack.empty();
}
private:
State::Ptr createState(States::ID stateId)
{
auto found = factories.find(stateId);
assert(found != factories.end());
return found->second();
}
void applyPendingChanges()
{
for (PendingChange& change : this->pendingList) {
std::cout << "Applying action:" << change.action << std::endl;
std::cout << "Applying state id:" << change.stateId << std::endl;
switch (change.action) {
case Push:
this->stack.push_back(createState(change.stateId));
break;
case Pop:
this->stack.pop_back();
break;
case Clear:
this->stack.clear();
break;
}
}
this->pendingList.clear();
}
struct PendingChange {
explicit PendingChange(Action action, States::ID stateId = States::None)
: action { action }
, stateId { stateId }
{
}
Action action;
States::ID stateId;
};
std::vector<State::Ptr> stack;
std::vector<PendingChange> pendingList;
State::Context context;
std::map<States::ID, std::function<State::Ptr()>> factories;
};
template <typename T>
void StateStack::registerState(States::ID stateId)
{
this->factories[stateId] = [this]() {
return State::Ptr(std::make_unique<T>(*this, this->context));
};
}
State::Context::Context(sf::RenderWindow& window, sf::Font& font)
: window { window }
, font { font }
{
}
State::~State() { }
State::State(StateStack& stack, Context context)
: stack { stack }
, context { context }
{
}
void State::requestStackPush(States::ID stateID) { stack.pushState(stateID); }
void State::requestStackPop() { stack.popState(); }
void State::requestStateClear() { stack.clearStates(); }
State::Context& State::getContext() { return context; }
class MenuState : public State {
public:
MenuState(StateStack& stack, Context context)
: State(stack, context)
, newGameButton { context.font, "Play", 100 }
{
std::cout << "MenuState::MenuState" << std::endl;
this->newGameButton.setFillColor(sf::Color::White);
this->newGameButton.setPosition({ 0.f, 0.f });
}
~MenuState()
{
std::cout << "MenuState::~MenuState" << std::endl;
}
virtual bool handleEvent(const sf::Event& event)
{
if (const auto* mouseButtonPressed = event.getIf<sf::Event::MouseButtonPressed>()) {
if (mouseButtonPressed->button == sf::Mouse::Button::Left) {
this->requestStackPop();
this->requestStackPush(States::Game);
}
}
return true;
}
virtual bool update(sf::Time elapsedTime)
{
return true;
}
virtual void draw()
{
this->getContext().window.draw(this->newGameButton);
}
private:
sf::Text newGameButton;
};
class GameState : public State {
public:
GameState(StateStack& stateStack, Context context)
: State { stateStack, context }
{
std::cout << "GameState::GameState" << std::endl;
}
~GameState()
{
std::cout << "GameState::~GameState" << std::endl;
}
virtual bool handleEvent(const sf::Event& event)
{
return true;
}
virtual bool update(sf::Time elapsedTime)
{
return true;
}
virtual void draw()
{
this->getContext().window.clear(sf::Color::Green);
}
};
class Game {
public:
explicit Game(sf::Vector2u screenResolution, sf::Time timePerFrame)
: window { sf::VideoMode { screenResolution }, "Match 3" }
, font {}
, timePerFrame { timePerFrame }
, stateStack(State::Context { this->window, this->font })
{
this->window.setVerticalSyncEnabled(true);
// PATH TO YOUR FONT
std::filesystem::path fontPath = "/usr/share/fonts/TTF/DejaVuSansMono.ttf";
if (!this->font.openFromFile(fontPath)) {
throw std::runtime_error("ERROR: Unable to load font");
}
this->registerStates();
this->stateStack.pushState(States::ID::Menu);
}
Game(const Game& other) = delete;
Game& operator=(const Game& rhs) = delete;
void run()
{
sf::Clock elapsedTime;
sf::Time timeSinceLastUpdate;
while (this->window.isOpen()) {
timeSinceLastUpdate += elapsedTime.restart();
this->handleInput();
while (timeSinceLastUpdate > this->timePerFrame) {
timeSinceLastUpdate -= this->timePerFrame;
this->update(this->timePerFrame);
}
this->render();
}
}
void handleInput()
{
while (const std::optional event = this->window.pollEvent()) {
this->stateStack.handleEvent(event.value());
if (event->is<sf::Event::Closed>()) {
this->window.close();
}
}
}
void update(sf::Time elapsedTime)
{
this->stateStack.update(elapsedTime);
}
void render()
{
this->window.clear();
this->stateStack.draw();
this->window.display();
}
private:
void registerStates()
{
this->stateStack.registerState<MenuState>(States::ID::Menu);
this->stateStack.registerState<GameState>(States::ID::Game);
}
sf::RenderWindow window;
sf::Font font;
const sf::Time timePerFrame;
StateStack stateStack;
};
int main()
{
try {
constexpr sf::Vector2u screenResolution { 1920, 1600 };
sf::Time timePerFrame { sf::seconds(1.f / 60.f) };
Game game { screenResolution, timePerFrame };
game.run();
} catch (std::exception& e) {
std::cout << "Error: " << e.what() << std::endl;
return 1;
}
return 0;
}- Create CMakeLists.txt in a root project directory with the contents below.
cmake_minimum_required(VERSION 3.28)
project(Match3 LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 3.1.0
GIT_SHALLOW ON
EXCLUDE_FROM_ALL
SYSTEM)
FetchContent_MakeAvailable(SFML)
add_executable(
Match3
src/main.cpp
)
target_link_libraries(Match3 PRIVATE SFML::Graphics SFML::System)
set_target_properties(
Match3 PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
)Configure and build the project:
cmake -S . -B build/cmake --build build/Run the binary
./build/bin/match3Press left mouse button
Expected behavior
The screen turns green.
Actual behavior
Game freezes. Nothing happens.
Source: SFML/SFML