Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 05-06-03, 10:32 AM   #1
axeljaeger
Registered User
 
Join Date: May 2003
Location: Frankfurt/Germany
Posts: 8
Send a message via ICQ to axeljaeger
Default I think I found a bug. Small sample includet (requires Qt)

Yesterday I played a bit around with the QGLWidget from the Qt Toolkit from Trolltech. This widget allows it to embed an opengl context into a GUI-Application. There is a funktion renderText to render some text into the widget. But this function does not work together with my nVidia-Card. I'm very sure that the problem is in the nvidia-code and not in Trolltech's, because the same programm is working on ATI hardware. Im using Mandrake Linux 9.1 together with the newest nVidia-drivers (that one with installer). I have a Geforce 2 MX 200 with 64 MB SDRAM. I use an Pentium II on a mainboard with Intel chipset.

Here's the source:

Code:
#include <qgl.h>
#include <qapplication.h>

class W : public QGLWidget
{
 public:
  W() : QGLWidget(0,0) {}
  void paintGL();

};

void W::paintGL()
{
 glClearColor(0.0f,0.0f,0.0f,1.0f);
 glClear(GL_COLOR_BUFFER_BIT);
  renderText(0,0, "Kashmere");
}

int main(int argc, char ** argv)
{
 QApplication app(argc, argv);
 W w;
 app.setMainWidget(&w);
 w.show();
 return app.exec();
}
Attached Files
File Type: txt xf86config-4.txt (2.7 KB, 235 views)

Last edited by axeljaeger; 05-06-03 at 10:51 AM.
axeljaeger is offline   Reply With Quote
Old 05-06-03, 10:33 AM   #2
axeljaeger
Registered User
 
Join Date: May 2003
Location: Frankfurt/Germany
Posts: 8
Send a message via ICQ to axeljaeger
Default

And here is what gdb says:
Code:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 9345)]
0x408cf654 in __nvsym17602 () from /usr/lib/libGL.so.1
Current language:  auto; currently c
And here is my logfile:
Attached Files
File Type: log xfree86.0.log (22.2 KB, 174 views)

Last edited by axeljaeger; 05-06-03 at 10:51 AM.
axeljaeger is offline   Reply With Quote
Old 05-06-03, 11:44 AM   #3
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

I don't get a segfault with copied-and-pasted code.

I also don't get any text, but I have a feeling this is because you never set up your GL matrices properly (or at all).

Have you looked in the README where it talks about segfaults in GL programs?
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 05-06-03, 12:53 PM   #4
axeljaeger
Registered User
 
Join Date: May 2003
Location: Frankfurt/Germany
Posts: 8
Send a message via ICQ to axeljaeger
Default

Now it should work as exspected, but it still crashes. I also can't find any usefull informations about segfaults in the Readme file included with the driver. But programms shouldn't crash when the programmer forgot to set a correct matrix.

Here is the new code:
Code:
#include <qgl.h>
#include <qapplication.h>
#include <GL/glu.h>

class W : public QGLWidget
{
 public:
  W() : QGLWidget(0,0) {}
  void paintGL();
  void resizeGL(int w, int h);
};

void W::resizeGL(int w, int h)
{
 glViewport( 0, 0, w, h );
 glMatrixMode( GL_PROJECTION );
 glLoadIdentity( );
 gluOrtho2D( -w/2, w/2, -h/2, h/2 );
 glMatrixMode( GL_MODELVIEW );
 glLoadIdentity( );
}

void W::paintGL()
{
 glClearColor(0.0f,0.0f,0.0f,1.0f);
 glClear(GL_COLOR_BUFFER_BIT);
 glLoadIdentity();
 renderText(0,0, "Kashmere");
}

int main(int argc, char ** argv)
{
 QApplication app(argc, argv);
 W w;
 app.setMainWidget(&w);
 w.show();
 return app.exec();
}
axeljaeger is offline   Reply With Quote
Old 05-06-03, 04:45 PM   #5
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

I was thinking about the wrong problem when I said that last bit. I was thinking that Qt was calling dlopen() on the GL library -- and the README does cover problems with this -- but that's not the case, I don't think.

In any case, it still doesn't crash for me, and I still don't get text. Maybe my version of renderText wasn't defined in properly? Hmm...

Well, it does work (show up, that is) if I change the renderText call to renderText(0,0,0, "Kashmere"); instead. But since the problem is a segfault, and not "the text isn't showing up", ... hmm. When you're in gdb, after catching the signal, what does bt print?
__________________
Registered Linux User #219692

Last edited by bwkaz; 05-06-03 at 04:49 PM.
bwkaz is offline   Reply With Quote
Old 05-07-03, 09:43 AM   #6
axeljaeger
Registered User
 
Join Date: May 2003
Location: Frankfurt/Germany
Posts: 8
Send a message via ICQ to axeljaeger
Default

bt says nothing more than
Code:
0x408cf654 in __nvsym17602 () from /usr/lib/libGL.so.1
I think, the Qt Library from Mandrake was compiled without debugging symbols. I thought about to write to Trolltech, but they will not catch a bug in software without having the source. On the other hand, nVidia has the source from Qt. I think it's their task. The text should be shown in the first version, if you resize your window verticaly. I think, the text is not affected by any transformationmatrix, because I think its printed using XFree fontredering. We are also discussing this problem in our german linux developer board at http://www.mrunix.de/forums/showthre...threadid=31896

There is one other people who had the crash with my programm one who get this programm fine working on an ATI card
axeljaeger is offline   Reply With Quote
Old 05-07-03, 04:53 PM   #7
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

Well, I'm not sure what to tell you, other than "it works for me"...

Maybe try single-stepping the code under gdb? That would at least tell you which function call is segfaulting (it may not be happening in renderText). Or, you could compile Qt yourself, with debugging symbols, and install it somewhere obscure (like /opt/qt), then explicitly link against the debug version. That'd allow you to trace into renderText...
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 05-08-03, 09:27 AM   #8
axeljaeger
Registered User
 
Join Date: May 2003
Location: Frankfurt/Germany
Posts: 8
Send a message via ICQ to axeljaeger
Default

H, compiling Qt myself will cost me one day (PII 266 Mhz). Isn't there somebody from the nvidia-team who can help?
axeljaeger is offline   Reply With Quote

Old 05-09-03, 01:14 AM   #9
dahunt
Registered User
 
Join Date: May 2003
Posts: 2
Default

same here... works fine... had to maximize the window to see it tho.... here's my compile line:

gcc test.cpp -I /usr/lib/qt3/include/ -L /usr/lib/qt3/lib/ -lqt-mt


later
dahunt is offline   Reply With Quote
Old 05-09-03, 07:52 AM   #10
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

Oooh, that is a difference. I used -lqt on my link line, but I only have one Qt library installed, the qt-mt one (libqt.so is a symlink to libqt-mt.so), so I ended up using the multithreaded Qt library anyway.

So if you are linking against -lqt, and libqt.so is not a symlink to libqt-mt, then that might be the difference. I don't see why, but it might be. Try -lqt-mt and see if that helps, if this is the case.
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 05-09-03, 08:43 AM   #11
axeljaeger
Registered User
 
Join Date: May 2003
Location: Frankfurt/Germany
Posts: 8
Send a message via ICQ to axeljaeger
Default

I use mandrake linux 9.1. MDK 9.1 comes with qt 3 compiled as multi threaded library. I have no single threaded version of qt here
axeljaeger is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:48 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.