Giter VIP home page Giter VIP logo

Comments (28)

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024 1

Try now, the flags are back.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024 1

I can confirm now that it works, it don't crash anymore.

from gemrb.

bsdcode avatar bsdcode commented on June 12, 2024

This seems like the same bogus segfault I encountered in #2004 (comment). Because you are using OpenAL and not SDLAudio for audio support you can probably circumvent the segfault if you don't compile SDLAudio support in (-DUSE_SDLMIXER=OFF via CMake).

What causes it in the first place ... I have no idea.

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

The *** stuff is unrelated, just a useless lookup that I'll fix.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

This seems like the same bogus segfault I encountered in #2004 (comment). Because you are using OpenAL and not SDLAudio for audio support you can probably circumvent the segfault if you don't compile SDLAudio support in (-DUSE_SDLMIXER=OFF via CMake).

What causes it in the first place ... I have no idea.

Sorry the delay but been a busy week, this is what I was using until now for compiling:

cmake .. -DCMAKE_BUILD_TYPE=Debug -DSDL_BACKEND=SDL2 -DPYTHON_VERSION=3.11

This will not work anymore if I have libsdl2-mixer-dev and libopenal-dev packages installed ? I have to choose one or another now ? Or always have the sefgault ?

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

You shouldn't get the segfault anymore regardless how you compile.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

You shouldn't get the segfault anymore regardless how you compile.

I'm still having the segfault on there. Don't know how to take a better trace.

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

You did update and recompile, right? Make sure it's the same segfault then (a backtrace would be helpful).

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

You did update and recompile, right? Make sure it's the same segfault then (a backtrace would be helpful).

Yes, I delete everything just in case and start from scratch.
I will try to get a trace of it.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

This is the call stack:


SDLAudio.so!GemRB::CacheEntry::~CacheEntry(GemRB::CacheEntry * const this) (~/bg2/gemrb//gemrb/plugins/SDLAudio/SDLAudio.h:89)
OpenALAudio.so!GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem::~CacheItem(GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem * const this) (~/bg2/gemrb//gemrb/core/LRUCache.h:57)
OpenALAudio.so!std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>::~pair(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> * const this) (/usr/include/c++/12/bits/stl_pair.h:185)
OpenALAudio.so!std::__new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, true> >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >(std::__new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, true> > * const this, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> * __p) (/usr/include/c++/12/bits/new_allocator.h:181)
OpenALAudio.so!std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, true> > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >(std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, true> > >::allocator_type & __a, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> * __p) (/usr/include/c++/12/bits/alloc_traits.h:535)
OpenALAudio.so!std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, true> > >::_M_deallocate_node(std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, true> > > * const this, std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, true> > >::__node_ptr __n) (/usr/include/c++/12/bits/hashtable_policy.h:1984)
OpenALAudio.so!std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_erase(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> > * const this, std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::size_type __bkt, std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::__node_base_ptr __prev_n, std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::__node_ptr __n) (/usr/include/c++/12/bits/hashtable.h:2329)
OpenALAudio.so!std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::erase(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> > * const this, std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::const_iterator __it) (/usr/include/c++/12/bits/hashtable.h:2304)
OpenALAudio.so!std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::erase(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> > * const this, std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::iterator __it) (/usr/include/c++/12/bits/hashtable.h:969)
OpenALAudio.so!std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> > >::erase(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> > > * const this, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::CacheItem> > >::iterator __position) (/usr/include/c++/12/bits/unordered_map.h:746)
OpenALAudio.so!GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::evict(GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying> * const this) (~/bg2/gemrb//gemrb/core/LRUCache.h:160)
OpenALAudio.so!GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::SetAt<unsigned int&, unsigned long&>(GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying> * const this, const GemRB::LRUCache<GemRB::CacheEntry, GemRB::OpenALPlaying>::public_key_t & key) (~/bg2/gemrb//gemrb/core/LRUCache.h:87)
OpenALAudio.so!GemRB::OpenALAudioDriver::loadSound(GemRB::OpenALAudioDriver * const this, GemRB::StringView ResRef, GemRB::tick_t & time_length) (~/bg2/gemrb//gemrb/plugins/OpenALAudio/OpenALAudio.cpp:422)
OpenALAudio.so!GemRB::OpenALAudioDriver::QueueAmbient(GemRB::OpenALAudioDriver * const this, int stream, const GemRB::ResRef & sound) (~/bg2/gemrb//gemrb/plugins/OpenALAudio/OpenALAudio.cpp:773)
libgemrb_core.so.0.9.2-git!GemRB::AmbientMgr::AmbientSource::Enqueue(const GemRB::AmbientMgr::AmbientSource * const this) (~/bg2/gemrb//gemrb/core/AmbientMgr.cpp:317)
libgemrb_core.so.0.9.2-git!GemRB::AmbientMgr::AmbientSource::Tick(GemRB::AmbientMgr::AmbientSource * const this, GemRB::tick_t ticks, GemRB::Point listener, GemRB::ieDword timeslice) (~/bg2/gemrb//gemrb/core/AmbientMgr.cpp:303)
libgemrb_core.so.0.9.2-git!GemRB::AmbientMgr::Tick(const GemRB::AmbientMgr * const this, GemRB::tick_t ticks) (~/bg2/gemrb//gemrb/core/AmbientMgr.cpp:213)
libgemrb_core.so.0.9.2-git!GemRB::AmbientMgr::Play(GemRB::AmbientMgr * const this) (~/bg2/gemrb//gemrb/core/AmbientMgr.cpp:188)
libgemrb_core.so.0.9.2-git!std::__invoke_impl<int, int (GemRB::AmbientMgr::*)(), GemRB::AmbientMgr*>(int (GemRB::AmbientMgr::*&&)(GemRB::AmbientMgr * const) __f, GemRB::AmbientMgr *&& __t) (/usr/include/c++/12/bits/invoke.h:74)
libgemrb_core.so.0.9.2-git!std::__invoke<int (GemRB::AmbientMgr::*)(), GemRB::AmbientMgr*>(int (GemRB::AmbientMgr::*&&)(GemRB::AmbientMgr * const) __fn) (/usr/include/c++/12/bits/invoke.h:96)

This time it happend when walking around.

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

Whaaat? Again code seemingly running in both plugins somehow, but I guess that's more of a symbol mixup in whatever interpreted the crash.

It crashed when you moved, since you moved into a part of the area with a new ambient sound. The buffer was full already, so when trying to remove the least recently used cached ambient, it went boom.

Try a few times — do you always get the same call stack?
Then retry with first adding SkipPlugin = SDLAudio.so to your gemrb cfg.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

@lynxlynxlynx I added SkipPlugin = SDLAudio.so and still have a segfault.

I have 3 call stacks (lot of crashes).
Number 1 and 2 is without that option on the cfg and 3 is with the option on the file.

Number 1 and 2 are equals number 3 is totally different.

1.txt
2.txt
3.txt

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

Ok, but 3 was on exit, the rest not. Still all the same underlying problem.
And I guess you do get Loading "SDLAudio.so" skipped in the log?
Then try deleting the file and retrying.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

Ok, but 3 was on exit, the rest not. Still all the same underlying problem. And I guess you do get Loading "SDLAudio.so" skipped in the log? Then try deleting the file and retrying.

No, 3 wasn't on exit, I was standing around.
It's still loaded with the config on cfg:
[PluginLoader]: Loaded plugin "SDL Audio Driver" (./gemrb/plugins/SDLAudio.so).

I deleted the file and starting it again and has been 20 minutes without a segfault.

Don't know what more info I can give to narrow it down.

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

It starts with the destructor of Interface::~Interface, not something that happens during the game.

I see we don't even read those two plugin config options any more, which I'll fix. But one shouldn't be forced to disable plugins in the first place.

What you can do is try to bisect to when this problem started happening.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

I just run the first bisect.

553ecf48f27d03b42420dfd0efd4efb96e51aa26 is the first bad commit
commit 553ecf48f27d03b42420dfd0efd4efb96e51aa26
Author: czarny247 <[email protected]>
Date:   Mon Dec 18 21:06:26 2023 +0100

    Cleanup of the top-level CMakeLists.txt
    
    Parts of this cmake has been moved to
    other cmake files which are included in
    the main cmake.
    
    - Validations.cmake for critical validations,
    resulting in cmake failures if not passed
    
    - FindDependencies.cmake for 3rd party depencencies
    of which I wasn't sure how to extract them into
    functions (e.g. too many variables to retain)
    
    - IncludeBeforeProject.cmake for everything that
    needs to be done before calling the project command
    
    Other pieces has been refactored into functions
    which can be found in Helpers.cmake.
    
    Further refactor might be needed but for now
    it looks little bit less messy than before.

 CMakeLists.txt                   | 713 +++------------------------------------
 cmake/FindDependencies.cmake     |  76 +++++
 cmake/Helpers.cmake              | 682 +++++++++++++++++++++++++++++++++++++
 cmake/IncludeBeforeProject.cmake |   6 +
 cmake/Validations.cmake          |  16 +
 gemrb/CMakeLists.txt             |   6 +-
 6 files changed, 834 insertions(+), 665 deletions(-)
 create mode 100644 cmake/FindDependencies.cmake
 create mode 100644 cmake/Helpers.cmake
 create mode 100644 cmake/IncludeBeforeProject.cmake
 create mode 100644 cmake/Validations.cmake

And this is the first culprit, but I think I mess up because I marked that is bad one because I couldn't compile.

-- Found SDL2_mixer: /usr/lib/x86_64-linux-gnu/libSDL2_mixer.so (found version "2.6.2") 
CMake Warning at cmake/Helpers.cmake:219 (MESSAGE):
  Looking for SDL: not found!
Call Stack (most recent call first):
  CMakeLists.txt:96 (CONFIGURE_SDL)


CMake Error at cmake/Helpers.cmake:220 (MESSAGE):
  Please get SDL from www.libsdl.org
Call Stack (most recent call first):
  CMakeLists.txt:96 (CONFIGURE_SDL)


-- Configuring incomplete, errors occurred!
See also "CMakeFiles/CMakeOutput.log".
See also "CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found.  Stop.

I will start another one with the first commit that I can compile after that one and see if the problem is really there.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

After further testing I found out that the last good commit is this one: 2619a1e

And the first one that I can compile that is broken is this one: 9d9c237

I did a git diff between the two of them and all the changes are related with cmake changes, I don't have a lot of knowledge about that.

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

That's interesting! The code didn't directly touch the plugin. I'm none the wiser, so I suggest bruteforcing it.
Create an extra build dir, so you have both the working and the broken available. Then diff their CMakeCache.txt. The broken one probably has a bunch more cmake variables, but what you're looking for is any non-obvious changes to the existing ones.

If that's futile, then comparing the results would be the next step. Diff files in CMakeFiles dirs, which should tell you if we're passing the same build commands etc.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

Comparing the CMakeCache.txt I see that on the good one has all the SDL stuff that on the bad one don't.

diff bad-build/CMakeCache.txt good-build/CMakeCache.txt 
50,51c50,51
< //Choose the type of build, options are: None Debug Release RelWithDebInfo
< // MinSizeRel.
---
> //Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
> // CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
493,494d492
< BAKE_ICON:INTERNAL=1
< BIN_DIR:INTERNAL=/usr/local/bin
636d633
< CMAKE_THREAD_PREFER_PTHREAD:INTERNAL=true
641,643c638,641
< DATA_DIR:INTERNAL=/usr/local/share/gemrb
< DOC_DIR:INTERNAL=/usr/local/share/doc/gemrb
< EXAMPLE_CONF_DIR:INTERNAL=/usr/local/etc/gemrb
---
> //Test FALLTHROUGH
> FALLTHROUGH:INTERNAL=1
> //Test FILE_PREFIX_MAP
> FILE_PREFIX_MAP:INTERNAL=1
668d665
< GEMRB_VERSION:INTERNAL=0.9.2-git
699,700d695
< ICON_DIR:INTERNAL=/usr/local/share/pixmaps
< IS_RELEASE_VERSION:INTERNAL=0
703,706c698,701
< LIB_DIR:INTERNAL=/usr/local/lib/gemrb
< MAN_DIR:INTERNAL=/usr/local/share/man/man6
< MENU_DIR:INTERNAL=/usr/local/share/applications
< METAINFO_DIR:INTERNAL=/usr/local/share/metainfo
---
> //Test NO_STRINGOP_OVERREAD
> NO_STRINGOP_OVERREAD:INTERNAL=1
> //Test NO_STRINGOP_TRUNCATION
> NO_STRINGOP_TRUNCATION:INTERNAL=1
715d709
< PLUGIN_DIR:INTERNAL=/usr/local/lib/gemrb/plugins
724d717
< PYTHON_LIBRARIES:INTERNAL=/usr/lib/x86_64-linux-gnu/libpython3.11.so
735,741c728,729
< SDL_FOUND:INTERNAL=1
< SDL_INCLUDE_DIR:INTERNAL=/usr/include;/usr/include/SDL2
< SDL_LIBRARY:INTERNAL=SDL2::SDL2
< SDL_MIXER_INCLUDE_DIR:INTERNAL=/usr/include/SDL2
< SDL_MIXER_LIBRARIES:INTERNAL=/usr/lib/x86_64-linux-gnu/libSDL2_mixer.so
< SVG_DIR:INTERNAL=/usr/local/share/icons/hicolor/scalable/apps
< SYSCONF_DIR:INTERNAL=/usr/local/etc/gemrb
---
> //Test VISIBILITY_HIDDEN
> VISIBILITY_HIDDEN:INTERNAL=1
750,757d737
< //Test _ffast_math
< _ffast_math:INTERNAL=1
< //Test _frounding_math
< _frounding_math:INTERNAL=1
< //Test _fsigned_char
< _fsigned_char:INTERNAL=1
< //Test _fvisibility_hidden
< _fvisibility_hidden:INTERNAL=1


The whole folder diff is really huge, I don't know how to tackle it.

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

What about CMakeFiles/CMakeOutput.log ? This should show if the compiler and linker used the same flags.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

The result of this:

diff bad-build/CMakeFiles/CMakeOutput.log good-build/CMakeFiles/CMakeOutput.log > CMakeOutput.diff

Is this file:
CMakeOutput.txt

Change it to txt to be able to uploaded.

Don't know really what to look because is a lot of data there, I will try to change the names of the directories to see if the diff is smaller.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

I don't know if this is the important part, but are all the arg:
GOOD

    arg [/usr/lib/gcc/x86_64-linux-gnu/12/collect2] ==> ignore
    arg [-plugin] ==> ignore
    arg [/usr/lib/gcc/x86_64-linux-gnu/12/liblto_plugin.so] ==> ignore
    arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper] ==> ignore
    arg [-plugin-opt=-fresolution=/tmp/-] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
    arg [-plugin-opt=-pass-through=-lc] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
    arg [--build-id] ==> ignore
    arg [--eh-frame-hdr] ==> ignore
    arg [-m] ==> ignore
    arg [elf_x86_64] ==> ignore
    arg [--hash-style=gnu] ==> ignore
    arg [--as-needed] ==> ignore
    arg [-dynamic-linker] ==> ignore
    arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
    arg [-pie] ==> ignore
    arg [-o] ==> ignore
    arg [-] ==> ignore
    arg [/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o]
    arg [/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o]
    arg [/usr/lib/gcc/x86_64-linux-gnu/12/crtbeginS.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/12/crtbeginS.o]
    arg [-L/usr/lib/gcc/x86_64-linux-gnu/12] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/12]
    arg [-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu]
    arg [-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib]
    arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
    arg [-L/lib/../lib] ==> dir [/lib/../lib]
    arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
    arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
    arg [-L/usr/lib/gcc/x86_64-linux-gnu/12/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/12/../../..]
    arg [CMakeFiles/-/CMakeCCompilerABI.c.o] ==> ignore
    arg [-lgcc] ==> lib [gcc]
    arg [--push-state] ==> ignore
    arg [--as-needed] ==> ignore
    arg [-lgcc_s] ==> lib [gcc_s]
    arg [--pop-state] ==> ignore
    arg [-lc] ==> lib [c]
    arg [-lgcc] ==> lib [gcc]
    arg [--push-state] ==> ignore
    arg [--as-needed] ==> ignore
    arg [-lgcc_s] ==> lib [gcc_s]
    arg [--pop-state] ==> ignore
    arg [/usr/lib/gcc/x86_64-linux-gnu/12/crtendS.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/12/crtendS.o]
    arg [/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crtn.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crtn.o]

BAD

	arg [/usr/lib/gcc/x86_64-linux-gnu/12/collect2] ==> ignore arg 
	[-plugin] ==> ignore arg 
	[/usr/lib/gcc/x86_64-linux-gnu/12/liblto_plugin.so] ==> ignore arg 
	[-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper] ==> 
	ignore arg [-plugin-opt=-fresolution=/tmp/-] ==> ignore arg 
	[-plugin-opt=-pass-through=-lgcc] ==> ignore arg 
	[-plugin-opt=-pass-through=-lgcc_s] ==> ignore arg 
	[-plugin-opt=-pass-through=-lc] ==> ignore arg 
	[-plugin-opt=-pass-through=-lgcc] ==> ignore arg 
	[-plugin-opt=-pass-through=-lgcc_s] ==> ignore arg [--build-id] ==> 
	ignore arg [--eh-frame-hdr] ==> ignore arg [-m] ==> ignore arg 
	[elf_x86_64] ==> ignore arg [--hash-style=gnu] ==> ignore arg 
	[--as-needed] ==> ignore arg [-dynamic-linker] ==> ignore arg 
	[/lib64/ld-linux-x86-64.so.2] ==> ignore arg [-pie] ==> ignore arg 
	[-o] ==> ignore arg [-] ==> ignore arg 
	[/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o] 
	==> obj 
	[/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o] 
	arg 
	[/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o] 
	==> obj 
	[/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o] 
	arg [/usr/lib/gcc/x86_64-linux-gnu/12/crtbeginS.o] ==> obj 
	[/usr/lib/gcc/x86_64-linux-gnu/12/crtbeginS.o] arg 
	[-L/usr/lib/gcc/x86_64-linux-gnu/12] ==> dir 
	[/usr/lib/gcc/x86_64-linux-gnu/12] arg 
	[-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu] ==> 
	dir [/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu] 
	arg [-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib] ==> dir 
	[/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib] arg 
	[-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] arg 
	[-L/lib/../lib] ==> dir [/lib/../lib] arg 
	[-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] 
	arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] arg 
	[-L/usr/lib/gcc/x86_64-linux-gnu/12/../../..] ==> dir 
	[/usr/lib/gcc/x86_64-linux-gnu/12/../../..] arg 
	[CMakeFiles/-/CMakeCCompilerABI.c.o] ==> ignore arg [-lgcc] ==> lib 
	[gcc] arg [--push-state] ==> ignore arg [--as-needed] ==> ignore 
	arg [-lgcc_s] ==> lib [gcc_s] arg [--pop-state] ==> ignore arg 
	[-lc] ==> lib [c] arg [-lgcc] ==> lib [gcc] arg [--push-state] ==> 
	ignore arg [--as-needed] ==> ignore arg [-lgcc_s] ==> lib [gcc_s] 
	arg [--pop-state] ==> ignore arg 
	[/usr/lib/gcc/x86_64-linux-gnu/12/crtendS.o] ==> obj 
	[/usr/lib/gcc/x86_64-linux-gnu/12/crtendS.o] arg 
	[/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crtn.o] 
	==> obj 
	[/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crtn.o]

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

Ah, I see now the file just has the flags from the functionality checks, when it tries to compile a bunch of stuff.
The easier way to compare is to look at these files in both versions, let's say for SDLAudio:

  • gemrb/plugins/SDLVideo/CMakeFiles/SDLAudio.dir/build.make
  • gemrb/plugins/SDLVideo/CMakeFiles/SDLAudio.dir/flags.make

Since we're trying to figure out what is the difference in the final compiler and linker invocations.

from gemrb.

rsantellan avatar rsantellan commented on June 12, 2024

They don't use the same flags:

diff good-build/gemrb/plugins/SDLAudio/CMakeFiles/SDLAudio.dir/flags.make bad-build/gemrb/plugins/SDLAudio/CMakeFiles/SDLAudio.dir/flags.make
7c7
< CXX_INCLUDES = -I/~/gemrb/build -I/~/gemrb/gemrb/includes -I/~/gemrb/gemrb/core -I/~/gemrb/platforms/Linux -isystem /usr/include/SDL2
---
> CXX_INCLUDES = -I/~/gemrb/build -I/~/gemrb/gemrb/includes -I/~/gemrb/gemrb/core -I/~/gemrb/platforms/Linux -isystem /usr/include/python3.11 -isystem /~/gemrb/includes/fmt -isystem /usr/include/SDL2
9c9
< CXX_FLAGS =  -Werror -Wno-inline -Wno-error=cast-align -Wmissing-declarations -Wcast-align -Wno-error=stringop-truncation -Wno-error=stringop-overflow -Wno-error=stringop-overread -Wall -W -Wpointer-arith -pedantic -Wno-format-y2k -Wno-long-long -fsigned-char -fvisibility=hidden -Wimplicit-fallthrough=2 -ffast-math -frounding-math -g -fPIC   -DFMT_HEADER_ONLY -DFMT_EXCEPTIONS=0 -std=gnu++14
---
> CXX_FLAGS = -g -fPIC   -DFMT_HEADER_ONLY -DFMT_EXCEPTIONS=0 -std=gnu++14


Also the path is not there, is on SDLAudio.

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

Ok, that's terrible then. All the special care take constructing the flags gets ignored. I can easily verify myself, by just doing make VERBOSE=1 and not seeing them either. Or doing something stupid in the code that should trigger warnings and -Werror. CC @czarny247 — I guess now CONFIGURE_COMPILER is creating a function local variable, not affecting the one used elsewhere?

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

Now I just wonder if this is also the underlying reason for @bsdcode's problems. If reverting #2048 wouldn't change anything now.

from gemrb.

bsdcode avatar bsdcode commented on June 12, 2024

Reverting #2048 brings back the segmentation fault on shutdown for me.

from gemrb.

lynxlynxlynx avatar lynxlynxlynx commented on June 12, 2024

Thanks, good to know!

from gemrb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.