Comments (6)
Not sure why this happens but basically in util/Mutex.cpp#186 CriticalSection::lock
is called with true as errorCheck
and pthread_mutex_lock
returns EINVAL
from virtualgl.
There seem to be a certain class of issues that occur in Arch Linux and nothing else. As with the VLC issue, I am unable to reproduce this on any of the O/S's I have installed, and I am not in a good position to support Arch Linux, because none of my paying customers use it (and frankly, Arch is not the easiest thing in the world to install.)
from virtualgl.
I mean, you can look at the code in faker.cpp and see clearly that CriticalSection::lock() is called with errorCheck=false. I can see no rational explanation for this. It would help if you built VirtualGL with debugging symbols and posted a backtrace with line numbers.
from virtualgl.
I was looking into this and I really didn't understood why pthread_mutex_lock
fails so I gave up.
#0 0x00007f43de52e5f8 in raise () from /usr/lib/libc.so.6
#1 0x00007f43de52fa7a in abort () from /usr/lib/libc.so.6
#2 0x00007f43de900f1d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libvglfaker.so
#3 0x00007f43de900316 in __cxxabiv1::__terminate(void (*)()) () from /usr/lib/libvglfaker.so
#4 0x00007f43de900361 in std::terminate() () from /usr/lib/libvglfaker.so
#5 0x00007f43de900468 in __cxa_throw () from /usr/lib/libvglfaker.so
#6 0x00007f43de8fe8bc in vglutil::CriticalSection::lock (this=this@entry=0x7f43deb4ca20 <vglfaker::GlobalCriticalSection::instanceMutex>, errorCheck=errorCheck@entry=true)
at /mnt/GitHub/virtualgl/util/Mutex.cpp:187
#7 0x00007f43de8af234 in vglutil::CriticalSection::SafeLock::SafeLock (errorCheck_=true, cs_=..., this=<synthetic pointer>)
at /mnt/GitHub/virtualgl/include/Mutex.h:68
#8 vglfaker::GlobalCriticalSection::getInstance () at /mnt/GitHub/virtualgl/server/GlobalCriticalSection.h:42
#9 vglfaker::GlobalCleanup::~GlobalCleanup (this=<optimized out>, __in_chrg=<optimized out>) at /mnt/GitHub/virtualgl/server/faker.cpp:86
#10 0x00007f43de5312ef in __cxa_finalize () from /usr/lib/libc.so.6
#11 0x00007f43de8ad743 in __do_global_dtors_aux () from /usr/lib/libvglfaker.so
#12 0x00007fff75a59990 in ?? ()
#13 0x00007f43ded6a867 in _dl_fini () from /lib64/ld-linux-x86-64.so.2
Backtrace stopped: frame did not save the PC
Basically in globalMutex.lock(false)
it first calls vglfaker::GlobalCriticalSection::getInstance()
and there vglutil::CriticalSection::SafeLock l(instanceMutex)
is executed because instance
is NULL
next
SafeLock(CriticalSection &cs_, bool errorCheck_=true) : cs(cs_),
errorCheck(errorCheck_)
{
cs.lock(errorCheck);
}
can see that errorCheck=true
.
this patch prevents crash, but doesn't solve why locking fails...
diff --git a/server/GlobalCriticalSection.h b/server/GlobalCriticalSection.h
index 32d0149..0fac747 100644
--- a/server/GlobalCriticalSection.h
+++ b/server/GlobalCriticalSection.h
@@ -39,7 +39,7 @@ namespace vglfaker
{
if(instance==NULL)
{
- vglutil::CriticalSection::SafeLock l(instanceMutex);
+ vglutil::CriticalSection::SafeLock l(instanceMutex, false);
if(instance==NULL) instance=new GlobalCriticalSection;
}
return instance;
ArchLinux isn't that different from other distributions, but it always have latest libraries (there are updates daily) and thus issues (and other library bugs) there show up sooner than elsewhere.
Currently all Arch Linux libraries are compiled with GCC > 5.0 (it uses new ABI) and newest glibc.
So this bug it might be related to GCC version and optimization/compile flags.
I'm building like this
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=/usr/share \
-DTJPEG_INCLUDE_DIR=/usr/include \
-DTJPEG_LIBRARY=/usr/lib/libturbojpeg.so \
-DVGL_LIBDIR=/usr/lib \
-DVGL_BINDIR=/usr/bin \
-DVGL_DOCDIR=/usr/share/doc/virtualgl
and example of compile command
/usr/bin/c++ -DFAKEXCB -DUSEXV -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__APPNAME=\"VirtualGL\" -D__BUILD=\"20151202d\" -D__VERSION=\"2.4.91\" -Dvglfaker_EXPORTS -I/mnt/GitHub/virtualgl/include -I/mnt/GitHub/virtualgl/build/src/build/server -I/mnt/GitHub/virtualgl/server -I/mnt/GitHub/virtualgl/server/../common -I/mnt/GitHub/virtualgl/server/fltk -march=native -O2 -pipe -fstack-protector-strong -g -fvar-tracking-assignments -g -fPIC -static-libgcc -fPIC -o CMakeFiles/vglfaker.dir/faker.cpp.o -c /mnt/GitHub/virtualgl/server/faker.cpp
from virtualgl.
I just checked in a commit that should fix this. I don't know why pthread_mutex_lock() fails in the global destructor under these circumstances, but I have seen that issue before, which is why the calls to globalMutex.lock()/unlock() in GlobalCleanup::~GlobalCleanup() specify errorCheck=false. The SafeLock instance in GlobalCriticalSection doesn't do that (oversight on my part), which is the source of the error. I think the correct course of action is to simply ignore globalMutex in ~GlobalCleanup() if it hasn't been instantiated yet (if that mutex hasn't been used by the time the global destructor is called, then VirtualGL hasn't started any threads, so there is no need for a global mutex at all.)
from virtualgl.
awesome 👍 , works fine, thanks.
from virtualgl.
Related Issues (20)
- vgl 3.0.90-20221122 crashing torch on ubuntu 22.04 HOT 11
- WebGL not working with 3.0.90-20230201 HOT 15
- Latest Google Chrome 112 not working with EGL HOT 23
- vglrun --help HOT 1
- Support for additional video codecs HOT 9
- VirtualGL and Cinnamon WM crash when window unmaximize HOT 18
- No stereo=1 in glxinfo and slower performance with vglrun than without HOT 3
- help with VirtualGL in docker HOT 5
- VirtualGL sometimes does not work HOT 2
- VirtualGL segfaults when using OpenGL software render HOT 3
- Migrate file releases to GitHub HOT 3
- Problem running GL applications on the discrete GPU HOT 2
- virtualgl : Depends: libegl1-mesa:amd64 but it is not installable HOT 6
- 480: Could not read Pixels with Nvidia RTX A6000 HOT 3
- egl backend: FPS limitation no longer works after commit 21cc496 HOT 4
- [Question] Mouse very slow on sddm (Plasma KDE display and login manager) HOT 3
- After logging into the gdm3 desktop session, /tmp/.X11-unix/X0 disappears HOT 1
- `vglrun` does not use my nvidia graphic card HOT 6
- The OpenGL renderer in VMware Workstation 16.2.x+ no longer works with VirtualGL
- VirtualGL 3.1.1/egl only shows up to GLES 3.0 support HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from virtualgl.