nVidia proprietary driver segfaults unless run with gdb [C++]
Hiya,
I'm trying to track down a bug in one of my C++ programmes - it has all the classic symptoms which I associate with memory errors (the key one is that moving my debug output code around changes whether or not it segfaults) but valgrind doesn't complain about my program at all. When run on its own we get: Code:
$ make && ./duel Code:
$ gdb duel Code:
$ valgrind --tool=memcheck duel Now, the last time I ran valgrind over my code (a week or so ago) I got nothing from it at all. From my pacman log, it appears I upgraded to glibc 2.16.0-2 and nvidia 302.17-2 yesterday (15th of July), so I'm guessing this is stemming from these updates. I can't construct a simple, self-contained code snippet because the error only appears if certain output statements are there (just redirecting things to std::cout), and so I can't really track the error down to a particular line or code block - though I know which routine seems to be causing the problem. Is there any way I can resolve this problem? Is it a bug which needs reporting, and if so, to Arch, nVidia (hah), or the maintainers of glibc? As always, if there's any information I can provide, just let me know. Thanks! |
Hey Snark,
would you care to share your source code (plus Makefile or such)? Maybe you're just initializing the libraries (or related objects) in a way they don't expect, and so the error shows its puny head long after the actual cause has taken place? Cheers, dmdeb |
Well, the source code's massive and split over several files. I don't think I'm initialising anything incorrectly because it all worked fine until recently, but it's entirely possible you're correct. I'll create a github repository for it tomorrow and link to that from here (I don't want to spam the thread with all the code...)
Cheers for the response |
Right, I've created the github repository, it's https://github.com/Snark1994/newton-duel/. The 'master' branch is fine, the problem's in the 'devel' branch. The problem emerged after writing the code for the AI ships (aiship.cpp, the function "void AIShip::update(void);"). If I remove all the 'cout <<' statements in the function, then it runs without a problem, and as stated previously it runs fine under gdb...
EDIT: if it makes any odds, it also runs find under windows with mingw Thanks, |
Hi.
Cool! On my onboard Intel 4500MHD there are no segfaults. It would be great if you keep github repository up-to-date. |
Quote:
thanks for sharing. Unfortunately (in a way), both the master and the devel branch work perfectly fine on my system (nvidia x86_64-295.40). Valgrind did not report any errors either. So much for the quick shot... I'll try to have a deeper look now. Best regards dmdeb |
@firstfire: I will try my best to do so! And if you're interested in the project (especially the graphics side - I've never done any of that before) you're more than welcome to contribute :)
@dmdeb: Thanks for trying it, what's your glibc version? If I can find or create a system with glibc 2.16.0-2 with an earlier version of nvidia, then install the newest nvidia version, then we've narrowed it down to a nvidia bug... |
Quote:
my libc says "GNU C Library (Debian EGLIBC 2.11.3-3) stable release version 2.11.3". Way old, as usual for a Debian stable system... I sent an email with details to your gmail address in order not to stress this thread too much. Cheers dmdeb |
Right, got it fixed with the help of dmdeb (wish I could give you more reputation for that, but LQ tells me to 'spread it around' and I feel marking your previous post as helpful would be slightly misleading...).
The suggestion which worked was the following: Quote:
Thank you very much, dmdeb! |
All times are GMT -5. The time now is 02:07 PM. |