Qt/OpenGL/Ubuntu Bug

This is a discussion on Qt/OpenGL/Ubuntu Bug within the Tech Board forums, part of the Community Boards category; I've been working on a program for a few days and making very little headway. I'm writing it in C++ ...

  1. #1
    Registered User
    Join Date
    Jul 2007
    Location
    Kansas, USA
    Posts
    12

    Qt/OpenGL/Ubuntu Bug

    I've been working on a program for a few days and making very little headway. I'm writing it in C++ with Qt and OpenGL on Ubuntu Linux. I have basically taken two programs and tied them together, so there is some code in there I didn't write. The problem is that every so often the program completely freezes up the computer such that I have to hard kill the computer. I don't even know how to approach solving the bug because I can't find what makes the computer freeze for sure. It seems to freeze in a different place every time. Plus, the debugger I have is a piece of crap.

    I don't think it's a memory issue (the program is fairly memory and CPU intensive.) It may be that my machine doesn't have the required hardware (it's not exactly what you'd call "state-of-the-art",) but I don't think that's it either.

    So my question is has anybody ever had anything like this before? What was the fix?

    I can't post any code for two reasons. The first is that it's not on this computer, and I can't get to the computer it's on right now. The second is that, not knowing where to begin, I'd have to post the majority of the program to help much, and nobody wants to have to read through that much code.

    I'm sorry the question is so vague, but I'm really stumped, and I really don't even know where to begin. And if this isn't in the right forum, I'll move it.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    You could try using memtest86 to check the memory. Also, are you sure that the machine is actually frozen, and not just that it appears unresponsive due to your program hogging resources?

  3. #3
    Registered User
    Join Date
    Jul 2007
    Location
    Kansas, USA
    Posts
    12
    I've tried using CTRL + ALT + F1 (kind of like Linux CTRL + ALT + DELETE), but it doesn't do anything. I've also had others try to ssh to my computer to kill off the program, but they can't connect.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    Which OS is it actually running on? You could try running it on another machine with the same OS (or compiling for a different OS if the code is portable). It sounds like a hardware problem to me since any decent OS should prevent a program from freezing the machine (of course Windows may not qualify).

    Edit: BTW, you posted twice. You may be able to delete the other thread yourself, or ask a moderator to do it.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Location
    Kansas, USA
    Posts
    12
    The program is on Ubuntu Linux, and I think tomorrow one of the guys I'm working with is going to go through my code. Another guy I'm working with ran it on his computer (not sure what OS, probably Linux) and he said it gave a segmentation fault, but he didn't remember where (better than completely freezing the computer.)

    Yeah, I know I posted twice. I'm new, and I can't figure out how to delete it.

  6. #6
    Massively Single Player AverageSoftware's Avatar
    Join Date
    May 2007
    Location
    Buffalo, NY
    Posts
    141
    I had a similar issue with an OpenGL program I was writing. In my case I'm using GTK+ and Slackware 11.0.

    I had the exact same symptoms, but mine would always occur when I closed the program, seemingly at random. I have since upgraded to Slackware 12.0, and I haven't done any work with that program on my machine yet, so I'm not sure if the issue has been resolved.

    I remember that I was convinced that it had something to do with the shutdown code I was using for OpenAL, but I can't remember why I thought that.
    There is no greater sign that a computing technology is worthless than the association of the word "solution" with it.

  7. #7
    Registered User
    Join Date
    Jul 2007
    Location
    Kansas, USA
    Posts
    12
    Yeah, I've tried looking at all the code, and couldn't figure out what would be the issue with it (there wasn't any pointers in there or anything.) It occurs in the middle of the program.

  8. #8
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    You could use the nice command to give your program a very low priority. This way, it cannot lock up your computer - it would have to be some other component. (Then, while your program may well have a bug in that it uses the API of that component incorrectly, at least you know it's also a bug in the other component because nothing should ever freeze the computer, no matter how badly it's misused.)
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  9. #9
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    This may sound stupid, but have you enabled 3d acceleration for your graphics card - ie installed drivers. It's not uncommon for these things to happen if you haven't

  10. #10
    Registered User
    Join Date
    Jul 2007
    Location
    Kansas, USA
    Posts
    12
    To CornedBee: I'll try that, thanks.

    To zacs7: I'm fairly sure all the required drivers are there. We had to get a new graphics card because the first one in the computer didn't support vertex buffer objects with OpenGL. It works basically fine, except for the fact that it freezes up the computer every so often.

    Thanks for all your replies.

  11. #11
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    What do you mean with "freeze"?
    The input devices doesn't react?
    does the machine react to ssh logins?
    does the magic-sys-key combination work? (it can be used to regain keyboard control too or too kill the x server)

  12. #12
    Registered User
    Join Date
    Jul 2007
    Location
    Kansas, USA
    Posts
    12
    Near as I can tell, the machine stops completely. The cursor won't respond to mouse movement and all motion on the screen stops. Some of the guys I'm working with have tried to ssh to the computer, but their machine can't connect.

    What is the magic-sys-key combination? (I'm relatively new to Linux.) I tried using CTRL + ALT + F1, but it wouldn't respond to that, either.

    EDIT: I used the nice command, but it didn't change anything, the computer still froze up.
    Last edited by aprescott_27; 07-11-2007 at 09:03 AM.

  13. #13
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Then you've stumbled upon a driver bug. Only kernel-level stuff can lock up a machine so completely. Sorry, out of my depth here.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  14. #14
    Registered User
    Join Date
    Nov 2006
    Posts
    519

  15. #15
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    What is the magic-sys-key combination? (I'm relatively new to Linux.) I tried using CTRL + ALT + F1, but it wouldn't respond to that, either.
    CTRL-ALT-F1 through CTRL-ALT-F6 usually give you different full-screen command-line terminals. CTRL-ALT-F7 usually switches you back to your X login. CTRL-ALT-F8 and so on access the new X sessions that you may have started (run gdmflexiserver or use the GUI command for it). That's for Debian systems -- I'm pretty sure that most other Linux distros use the same combinations.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Kernel bug? (attn matsp)
    By brewbuck in forum Linux Programming
    Replies: 7
    Last Post: 04-13-2009, 10:31 AM
  2. gaks bug?
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-31-2008, 02:47 PM
  3. Debugging a rare / unreproducible bug..
    By g4j31a5 in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 08-05-2008, 12:56 PM
  4. ATL bug of CComPtr?
    By George2 in forum Windows Programming
    Replies: 6
    Last Post: 04-07-2008, 07:52 AM
  5. What is year 2038 bug?
    By year2038bug in forum A Brief History of Cprogramming.com
    Replies: 67
    Last Post: 09-04-2005, 06:25 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21