-
Notifications
You must be signed in to change notification settings - Fork 20
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
CS GO crash every time it exits #166
Comments
Please also show the console output if there's something else apart of What is your distribution and libc version? Please run the game with |
There's nothing else than Segmentation fault. I'm on ArchLinux 64bit with libc 2.21. It created 4 /tmp/ld-debug.txt.XXX files with different PIDs. Do you have an email where I can send them? |
My email is username |
I've sent them.
|
From the (privately sent) log it looks like glibc decides to run both nVidia and Mesa libGL destructors before primus. I suspect that is not supposed to happen. I'll try to look if anything goes wrong in glibc. |
Have you had time to look? |
ping |
possibly related:
http://us.download.nvidia.com/XFree86/Linux-x86_64/352.09/README/knownissues.html |
Many thanks, this seem to fix the issue. Should this be included in primus by default? |
Same here. Any elegant way to solve this ? |
I now understand the issue: primus cannot expect that it can invoke functions from a shared library it dlopen'ed from its own destructors; since nVidia's constructors run after primus' (due to dlopen), it's actually natural that destructors are run before (i.e. in reverse order of constructors). Even though primus still has a handle to nVidia's dlopen'ed libGL, it doesn't "count" when destructors are run at exit. Can you please test the following patch, ideally on multiple games, not just CS:GO? Sorry for taking so long, and thanks for your patience. diff --git a/libglfork.cpp b/libglfork.cpp
index 03f514f..bb42f0d 100644
--- a/libglfork.cpp
+++ b/libglfork.cpp
@@ -259,6 +259,22 @@ static struct PrimusInfo {
}
} primus;
+static void cleanup()
+{
+ primus.drawables.clear();
+}
+
+static void register_cleanup_1()
+{
+ atexit(cleanup);
+}
+
+static void register_cleanup()
+{
+ static pthread_once_t once = PTHREAD_ONCE_INIT;
+ pthread_once(&once, register_cleanup_1);
+}
+
// Thread-specific data
static __thread struct {
Display *dpy;
@@ -622,11 +638,6 @@ GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXConte
void glXDestroyContext(Display *dpy, GLXContext ctx)
{
primus.contexts.erase(ctx);
- // kludge: reap background tasks when deleting the last context
- // otherwise something will deadlock during unloading the library
- if (primus.contexts.empty())
- for (DrawablesInfo::iterator i = primus.drawables.begin(); i != primus.drawables.end(); i++)
- i->second.reap_workers();
primus.afns.glXDestroyContext(primus.adpy, ctx);
}
@@ -720,6 +731,7 @@ void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
di.actx = ctx;
di.d.spawn_worker(drawable, display_work);
di.r.spawn_worker(drawable, readback_work);
+ register_cleanup();
}
// Readback thread needs a sync object to avoid reading an incomplete frame
di.sync = primus.afns.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); |
@amonakov Thank you for the work you have done. Unfortunately I can't build pathced version of primus under Fedora 22. Can you guide me how to do it? Best Regards, |
This patch works fine on CS GO, CS 1.6 and TF2. |
Hi, any tips how to build patched primus on Fedora 22 ? |
No, I'm on Arch Linux. |
So It should basically the same. Just point me the steps you follow to patch it. Thank you in advance. |
Well, not really, Arch Linux uses PKGBUILD. I don't know Fedora build system, but you need to use the patch command anyway:
|
Yep, I'm familiar with the patching proccess. I can't build the patched version. But no problem, they should roll it out soon or later... Cheers ;) |
for fedora 22 patched version see: http://people.engr.ncsu.edu/gsgatlin/primus-1.1.03282015-2.fc22.src.rpm link to specfile showing added patch. http://fpaste.org/233006/42994143/ This package was build using "mock" on fedora 21 for fedora 22. Hope that helps out your testing of this problem. |
@gsgatlin @amonakov rpm -qa | grep primus |
If CS:GO is a 32-bit executable, you need new i686.rpm as well. |
Just to follow up, I tested the patched primus rpm with Minecraft, FEZ, Cogs, and dolphin-emu and did not see any problems. |
@amonakov : can you please merge the fix? |
did anybody test it out with other games so far? Not that this one will break others. |
Tested on Plague:Inc, CS:GO, Dota 2 Source 1/2. Everything looks fine to me. |
Anything new about this? |
@amonakov Do you need more testing (I can try SuperTux kart on my setup for instance) or could this be merged? |
It's been more than 6 months now...and there have been no commits since March 2015, it doesn't look like this project is still maintained :/ |
I added this patch into the fedora rpm package back in July (I think) and it did not seem to cause any problems that I know about. |
yeah, no issues on my side either. |
I guess it's time for somebody like @karolherbst to fork it and become new de-facto maintainer. |
nah I would rather spend time to improve nouveau, because prime offloading is the superior solution anyway. |
@karolherbst guessed as much by looking at your nouveau commits and mailing list jitter. |
Yes, but in the meantime, it’s nice to have a temporary working solution. But I agree @karolherbst is doing a great job on reclocking, plus OpenGL going well in mesa lately, I might be able to drop the proprietary driver soon. @amonakov I’ve seen from you GitHub page that you’re still around. ;) Could you consider merging this and cleaning a bit the issue tracker? Or, in the event you’re not interesting in it anymore, which I can understand, could you envisage to transfer the repo to the Bumblebee Project organization? Thanks alot! |
Since CS GO has been ported to linux, I've been running it through primusrun and always had a very annoying issue: it crashes every time I quit the game, which produces a core dump and freeze my laptop for up to 30s every time the game is exited.
I can't disable core dumps because I need them to debug crashes in applications I develop.
The backtrace (which doesn't have symbols) is the following:
The text was updated successfully, but these errors were encountered: