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

[regression in 2.5.16] SEGV in mutex lock function #58

Open
yurivict opened this issue Oct 14, 2023 · 1 comment
Open

[regression in 2.5.16] SEGV in mutex lock function #58

yurivict opened this issue Oct 14, 2023 · 1 comment

Comments

@yurivict
Copy link

yurivict commented Oct 14, 2023

2.5.16 SEGVs in TMutex.h in the function Lock:

Thread 1 received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
mutex_lock_common (abstime=0x0, cvattach=false, rb_onlist=false, m=<optimized out>) at /disk-samsung/freebsd-src/lib/libthr/thread/thr_mutex.c:726
726             if (!cvattach && m->m_flags & PMUTEX_FLAG_PRIVATE)
(gdb) bt
#0  mutex_lock_common (abstime=0x0, cvattach=false, rb_onlist=false, m=<optimized out>) at /disk-samsung/freebsd-src/lib/libthr/thread/thr_mutex.c:726
#1  __Tthr_mutex_lock (mutex=<optimized out>) at /disk-samsung/freebsd-src/lib/libthr/thread/thr_mutex.c:755
#2  0x00000000005a66ad in TMutex::Lock() (this=<optimized out>) at /usr/ports/audio/faustlive/work/faustlive-2.5.16/Build/../src/Utilities/TMutex.h:91
#3  FLInterfaceManager::updateAllGuis() (this=<optimized out>) at /usr/ports/audio/faustlive/work/faustlive-2.5.16/src/MainStructure/FLInterfaceManager.cpp:29
#4  0x0000000809136b1f in  () at /usr/local/lib/qt6/libQt6Core.so.6
#5  0x0000000809149eed in QTimer::timerEvent(QTimerEvent*) () at /usr/local/lib/qt6/libQt6Core.so.6
#6  0x000000080912ab4a in QObject::event(QEvent*) () at /usr/local/lib/qt6/libQt6Core.so.6
#7  0x00000008014f224a in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/local/lib/qt6/libQt6Widgets.so.6
#8  0x00000008014f318a in QApplication::notify(QObject*, QEvent*) () at /usr/local/lib/qt6/libQt6Widgets.so.6
#9  0x00000008090e2a10 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/local/lib/qt6/libQt6Core.so.6
#10 0x000000080926b5f1 in QTimerInfoList::activateTimers() () at /usr/local/lib/qt6/libQt6Core.so.6
#11 0x0000000809354901 in  () at /usr/local/lib/qt6/libQt6Core.so.6
#12 0x000000080a66cc54 in g_main_context_dispatch () at /usr/local/lib/libglib-2.0.so.0
#13 0x000000080a66cf8c in  () at /usr/local/lib/libglib-2.0.so.0
#14 0x000000080a66d038 in g_main_context_iteration () at /usr/local/lib/libglib-2.0.so.0
#15 0x0000000809353e59 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/local/lib/qt6/libQt6Core.so.6
#16 0x00000008090ebb87 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/local/lib/qt6/libQt6Core.so.6
#17 0x00000008090e3161 in QCoreApplication::exec() () at /usr/local/lib/qt6/libQt6Core.so.6
#18 0x0000000000621e05 in main(int, char**) (argc=<optimized out>, argv=0x7fffffffe6c0) at /usr/ports/audio/faustlive/work/faustlive-2.5.16/src/Utilities/main.cpp:116
(gdb) 
 79│                         pthread_mutexattr_t mutex_attr;
 80│                         assert(pthread_mutexattr_init(&mutex_attr) == 0);
 81│                         assert(pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE) == 0);
 82│                         assert(pthread_mutex_init(&fMutex, &mutex_attr) == 0);
 83│                 }
 84│                 virtual ~TMutex()
 85│                 {
 86│                         pthread_mutex_destroy(&fMutex);
 87│                 }
 88│
 89│                 bool Lock()
 90│                 {
 91├───────────> return (pthread_mutex_lock(&fMutex) == 0);
 92│                 }
 93│
 94│                 bool TryLock()
 95│                 {
 96│                         return (pthread_mutex_trylock(&fMutex) == 0);
 97│                 }
 98│
 99│                 void Unlock()
100│                 {
101│                         pthread_mutex_unlock(&fMutex);
102│                 }

The debug build doesn't crash.

clang-16
FreeBSD 13.2

@ghost
Copy link

ghost commented Jan 25, 2024

fixed in #59

can't put code inside asserts.

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

No branches or pull requests

1 participant