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

Segfault when clicking on music/sound #1759

Open
jiffygist opened this issue Dec 24, 2024 · 4 comments
Open

Segfault when clicking on music/sound #1759

jiffygist opened this issue Dec 24, 2024 · 4 comments

Comments

@jiffygist
Copy link

jiffygist commented Dec 24, 2024

SLADE Version

be9fb02

OS

Linux

Editor

Resource editor

Steps to Reproduce

I compiled SLADE on Chimera Linux on Raspberry Pi against latest SFML from git (3.1.0). It crashes when I click on any music or sound.

Crash Information

Thread 1 "slade" received signal SIGSEGV, Segmentation fault.
0x0000fffff2fc596c in std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<sf::Sound*, void*>*>, bool> std::__1::__hash_table<sf::Sound*, std::__1::hash<sf::Sound*>, std::__1::equal_to<sf::Sound*>, std::__1::allocator<sf::Sound*> >::__emplace_unique_key_args<sf::Sound*, sf::Sound* const&>(sf::Sound* const&, sf::Sound* const&) () from /usr/local/lib/libsfml-audio.so.3.1
(gdb) bt
#0  0x0000fffff2fc596c in std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<sf::Sound*, void*>*>, bool> std::__1::__hash_table<sf::Sound*, std::__1::hash<sf::Sound*>, std::__1::equal_to<sf::Sound*>, std::__1::allocator<sf::Sound*> >::__emplace_unique_key_args<sf::Sound*, sf::Sound* const&>(sf::Sound* const&, sf::Sound* const&) () at /usr/local/lib/libsfml-audio.so.3.1
#1  0x0000fffff2fc4f48 in sf::SoundBuffer::attachSound(sf::Sound*) const () at /usr/local/lib/libsfml-audio.so.3.1
#2  0x0000fffff2fc286c in sf::Sound::Sound(sf::SoundBuffer const&) () at /usr/local/lib/libsfml-audio.so.3.1
#3  0x0000aaaaab0775e4 in slade::AudioEntryPanel::AudioEntryPanel(wxWindow*) ()
#4  0x0000aaaaab06c314 in slade::ArchivePanel::audioArea() ()
#5  0x0000aaaaab066184 in slade::ArchivePanel::openEntry(slade::ArchiveEntry*, bool) ()
#6  0x0000aaaaab05e77c in slade::ArchivePanel::selectionChanged() ()
#7  0x0000aaaaab059b08 in slade::ArchivePanel::onEntryListSelectionChange(wxDataViewEvent&) ()
#8  0x0000fffff2dea5a0 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () at /lib/libwx_baseu-3.2.so.0
#9  0x0000fffff2dea230 in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /lib/libwx_baseu-3.2.so.0
#10 0x0000fffff2dea03c in wxEvtHandler::ProcessEvent(wxEvent&) () at /lib/libwx_baseu-3.2.so.0
#11 0x0000fffff2de9ed8 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () at /lib/libwx_baseu-3.2.so.0
#12 0x0000fffff36bd1fc in ??? () at /lib/libwx_gtk3u_core-3.2.so.0
#13 0x0000fffff15a22a8 in ??? () at /lib/libgobject-2.0.so.0
#14 0x0000fffff15c3f28 in ??? () at /lib/libgobject-2.0.so.0
#15 0x0000fffff15c4a84 in g_signal_emit () at /lib/libgobject-2.0.so.0
#16 0x0000fffff1d86e90 in ??? () at /lib/libgtk-3.so.0
#17 0x0000fffff1da37bc in ??? () at /lib/libgtk-3.so.0
#18 0x0000fffff1a37008 in ??? () at /lib/libgtk-3.so.0
#19 0x0000fffff15a22a8 in ??? () at /lib/libgobject-2.0.so.0
#20 0x0000fffff15c3f28 in ??? () at /lib/libgobject-2.0.so.0
#21 0x0000fffff15c4a84 in g_signal_emit () at /lib/libgobject-2.0.so.0
#22 0x0000fffff1b9a948 in ??? () at /lib/libgtk-3.so.0
#23 0x0000fffff15a78f0 in g_cclosure_marshal_VOID__BOXEDv () at /lib/libgobject-2.0.so.0
#24 0x0000fffff15a2bac in ??? () at /lib/libgobject-2.0.so.0
#25 0x0000fffff15a22a8 in ??? () at /lib/libgobject-2.0.so.0
#26 0x0000fffff15c3f28 in ??? () at /lib/libgobject-2.0.so.0
#27 0x0000fffff15c4a84 in g_signal_emit () at /lib/libgobject-2.0.so.0
#28 0x0000fffff1b98700 in ??? () at /lib/libgtk-3.so.0
#29 0x0000fffff1b9cc70 in ??? () at /lib/libgtk-3.so.0
#30 0x0000fffff1b4fa48 in gtk_event_controller_handle_event () at /lib/libgtk-3.so.0
#31 0x0000fffff1db84b4 in ??? () at /lib/libgtk-3.so.0
#32 0x0000fffff1a32d80 in ??? () at /lib/libgtk-3.so.0
#33 0x0000fffff15a2014 in g_closure_invoke () at /lib/libgobject-2.0.so.0
#34 0x0000fffff15c594c in ??? () at /lib/libgobject-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#35 0x0000fffff15c45f0 in ??? () at /lib/libgobject-2.0.so.0
#36 0x0000fffff15c4a84 in g_signal_emit () at /lib/libgobject-2.0.so.0
#37 0x0000fffff1db81d0 in ??? () at /lib/libgtk-3.so.0
#38 0x0000fffff1bfa844 in gtk_propagate_event () at /lib/libgtk-3.so.0
#39 0x0000fffff1bfa160 in gtk_main_do_event () at /lib/libgtk-3.so.0
#40 0x0000fffff1ff71ec in ??? () at /lib/libgdk-3.so.0
#41 0x0000fffff0d58afc in ??? () at /lib/libglib-2.0.so.0
#42 0x0000fffff0d5935c in ??? () at /lib/libglib-2.0.so.0
#43 0x0000fffff0d599e4 in g_main_loop_run () at /lib/libglib-2.0.so.0
#44 0x0000fffff1bf9650 in gtk_main () at /lib/libgtk-3.so.0
#45 0x0000fffff3617000 in wxGUIEventLoop::DoRun() () at /lib/libwx_gtk3u_core-3.2.so.0
#46 0x0000fffff2d180b0 in wxEventLoopBase::Run() () at /lib/libwx_baseu-3.2.so.0
#47 0x0000fffff2cdce28 in wxAppConsoleBase::MainLoop() () at /lib/libwx_baseu-3.2.so.0
#48 0x0000fffff2d5b078 in wxEntry(int&, wchar_t**) () at /lib/libwx_baseu-3.2.so.0
#49 0x0000aaaaaaec4250 in main ()

Screenshots

No response

@sirjuddington
Copy link
Owner

Does it still happen with SFML 2.6 or 3.0? Looks like an SFML issue to me

@jiffygist
Copy link
Author

jiffygist commented Dec 24, 2024

I compiled against SFML 3.1 on another machine running gentoo and it also crashes, it works if compiled against SFML 2.6. It is problematic for me to compile SFML 2.6 on chimera because they only provide libcxx 19 in their repos and SFML 2.6 doesn't compile with it.

(In the meantime found minor problem when making cmake use sfml installed in non-standard path, slade has e.g. #include <SFML/Audio.hpp> but cmake already has SFML directory in its include path, so it falls back to system-installed headers and errors during linking. I had to adjust CMakeCache.txt manually to use correct header path.)

@Blzut3
Copy link
Collaborator

Blzut3 commented Dec 24, 2024

It's probably time to retire the FindSFML.cmake module. Since SFML 2.5 they've been shipping CMake config files so find_package just works. Ubuntu 20.04+ and Debian 10+ include the module in their libsfml-dev package. That said it looks like there needs to be some normalization between SFML 2 and 3's usage. I can make a PR. Should solve the issue of falling back to the system headers.

@Blzut3
Copy link
Collaborator

Blzut3 commented Dec 24, 2024

I'm able to reproduce the crash building with the released SFML 3.0 code, so this is probably a porting issue. @jopadan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants