Skip to content
New issue

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

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

Already on GitHub? # to your account

one assert about context ? #680

Open
xuandu opened this issue Apr 7, 2022 · 1 comment
Open

one assert about context ? #680

xuandu opened this issue Apr 7, 2022 · 1 comment

Comments

@xuandu
Copy link

xuandu commented Apr 7, 2022

hello:

I use openal on linux ubuntu 16 ,Gcc4.7; and play file use it ,use context,use default device, But when I destroy my app, I call that :
alcMakecurrentContext(null), if(my_context != null){destroyContext(my_context)} ;closeDevice(Device);

when the app is over ,I catch that :
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://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 ./filedemo...(no debugging symbols found)...done.

warning: exec file is newer than core file.
[New LWP 4172]
[New LWP 4181]
[New LWP 4182]

warning: .dynamic section for "./libAudiocom.so" is not at the expected address (wrong library or version mismatch?)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./filedemo'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007fd4e876f438 in __GI_raise (sig=sig@entry=6)
at ../sysdeps/unix/sysv/linux/raise.c:54
54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7fd4e945a740 (LWP 4172))]
(gdb) bt
#0 0x00007fd4e876f438 in __GI_raise (sig=sig@entry=6)
at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007fd4e877103a in __GI_abort () at abort.c:89
#2 0x00007fd4e8767be7 in __assert_fail_base (fmt=,
assertion=assertion@entry=0x7fd4e7baff7b "lockret == althrd_success",
file=file@entry=0x7fd4e7bb2be8 "/openal-soft-1.17.2/Alc/ALc.c", line=line@entry=776,
function=function@entry=0x7fd4e7bb215c <PRETTY_FUNCTION.8059> "LockLists") at assert.c:92
#3 0x00007fd4e8767c92 in __GI___assert_fail (
assertion=0x7fd4e7baff7b "lockret == althrd_success",
file=0x7fd4e7bb2be8 "/openal-soft-1.17.2/Alc/ALc.c", line=776,
function=0x7fd4e7bb215c <PRETTY_FUNCTION.8059> "LockLists")
at assert.c:101
#4 0x00007fd4e7b87858 in LockLists ()
at /openal-soft-1.17.2/Alc/ALc.c:776
#5 alcDestroyContext (context=0x1ad3c40)
at /openal-soft-1.17.2/Alc/ALc.c:3196
#6 0x00007fd4e7754fec in CInit::~Init() () from ./libAuRend.so
#7 0x00007fd4e877437a in __cxa_finalize (d=0x7fd4e7957c00)
at cxa_finalize.c:56
#8 0x00007fd4e7753bd3 in ?? () from ./libAuRend.so
---Type to continue, or q to quit---Quit

thanks you !

@kcat
Copy link
Owner

kcat commented Apr 8, 2022

It's unsafe to call OpenAL functions in global destructors and exit handlers. In this case, it looks like some global mutexes have either been destroyed, or the system otherwise isn't allowing it to be locked, and asserts when it fails to lock.

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

No branches or pull requests

2 participants