You are not logged in.

1

Thursday, September 1st 2005, 6:03am

Strange error occur after running

Can any one tell me why I have such kind of errors? ?(
When I run my Qt GUI program, it run so slow and then hang up and no response.
the stderr show the below errors (non-stop).........
is it the problem come out from the QTimer?

X Error: BadAlloc (insufficient resources for operation) 11
Major opcode: 53
Minor opcode: 0
Resource id: 0x24002d5
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 62
Minor opcode: 0
Resource id: 0x24002d5
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 70
Minor opcode: 0
Resource id: 0x24002d5
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 154
Minor opcode: 4
Resource id: 0x24002d5
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 70
Minor opcode: 0
Resource id: 0x24002d5
X Error: RenderBadPicture (invalid Picture parameter) 181
Major opcode: 154
Minor opcode: 23
Resource id: 0x24002d6

Please help me
thank you
:(

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

2

Thursday, September 1st 2005, 7:19am

RE: Strange error occur after running

You might be running out of memory.

3

Thursday, September 1st 2005, 7:37am

RE: Strange error occur after running

Thank you for your reply

Why out of memory?
I have already tried to reboot the computer and run it.
It still has the problem.
The problem comes from too many files? (about 200)
or
it comes from two QTimer I use? (but I call the looping timer to display hundreds QLineEdit items)
or
anything else?

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

4

Thursday, September 1st 2005, 8:04am

RE: Strange error occur after running

Too many files? What sort of files? Image files?

If you're creating QPixmaps from 200 large image files, that may indeed be the reason. Don't create so many QPixmaps, use QImage instead.

5

Thursday, September 1st 2005, 9:17am

RE: Strange error occur after running

In fact, my program doesn't has any image.
my program has about 40 dialogs so that the project includes too many files.
It is a MDI program.
It includes several widgets.
One widget calls QTimer to looping display the result of data.
The widget includes about 200 QLineEdit items.
Other one QTimer will call for looping check the main menu item.

chickenblood

Professional

Posts: 657

Location: Mountain View, CA

Occupation: Data Monkey

  • Send private message

6

Thursday, September 1st 2005, 3:53pm

RE: Strange error occur after running

Why are you trying to display 200 line edit items? Does that even fit on the screen?

That will certainly be resource heavy. Try using a QListView or a QTable instead.
I have enough sense to know that "common sense" is an oxymoron.

This post has been edited 2 times, last edit by "chickenblood" (Sep 1st 2005, 6:31pm)


7

Friday, September 23rd 2005, 1:25am

Thanks

I used QTable to solve.

I would like to know if I increace more RAM, can the problem solve?

8

Friday, September 23rd 2005, 8:04am

I have an other error but it seems to be related with this problem (I am not sure)

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
1 Thread 1085670848(LWP 2523)
#0  0x4000c9c0 in _dl_debug_state_internal() from /lib/ld-linux.so.2
#1  0x4110dfb2 in dl_open_worker() from /lib/tls/libc.so.6
#2  0x4000c266 in _dl_catch_error_internal() from /lib/ld-linux.so.2
#3  0x4210da49 in _dl_open() from /lib/tls/libc.so.6
#4  0x40ac5f6b in dlopen_doit() from /lib/libdl.so.2
#5  0x4000c266 in _dl_catch_error_internal () from /lib/ld-linux.so.2
#6  0x40ac6316 in _dlerror_run() from /lib/libdl.so.2
#7  0x40ac5f14 in dlopen@@GLIB_2.1() from /lib/libdl.so.2
#8  0x407d13ea in _XlcAddGB18030 LocaleConverters() from /usr/XllR6/lib/libXll.so.6
#9  0x407d19cd in _XInitDynamicIM() from /usr/XllR6/lib/libXll.so.6
#10 0x407a0e52 in XOpenOM() from /usr/XllR6/lib/libXll.so.6
#11 0x4079ffa9 in XCreateFontSet() from /usr/XllR6/lib/libXll.so.6
#12 0x4028dfe7 in QValueListPrivate<void(*)()>::QValueListPrivate(QCalueListPrivate<void(*)()> const&) () from /usr/lib/qt-3.1/lib/libqt_mt.so.3
#13 0x4028ec70 in QInputContext::QInputContext(QWidget*)() from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#14 0x4020d44c in QWidget::createInputContext()() from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#15 0x402790d5 in QApplication::Xll ProcessEvent(_XEvent*)() from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#16 0x4028dbda in QEventLoop::processEvents(unsigned)() from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#17 0x402e8cf6 in QEventLoop::enterLoop() () from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#18 0x402e8b98 in QEventLoop::exec() () from/usr/lib/libqt-mt.so.3
#19 0x402d5151 in QApplication::exec() () from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#20 0x0807fc5c in main(argc=1,argv=0xbffff674) at main.cpp:29
#21 0x42015574 in __libc_start_main() from /lib/tls/lib.so.6


Why run the exec() with error?
Can any one help me?
thanks

10

Friday, September 23rd 2005, 9:43am

:(
Thank you very much ,wysota.

It is difficult to paste the codes because it is so many and I don't know which part should I paste.

I just paste what I think the problem may come out......... ?(

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
////////////////////////main.cpp
#include <qapplication.h>
#include "MainW.h"
#include "MainA.h"

int main( int argc, char ** argv )
{
    MainApp a( argc, argv );
    a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
    int res = a.exec();
    return res;
}

///////////////////////////MainA.cpp
#include "MainA.h"
#include "MainW.h"
#include <qapplication.h>

MainApp::MainApp( int & argc, char ** argv ) : QApplication( argc, argv )
{
 <do something>
  init();
  t = new QTimer(this);
  connect(t,SIGNAL(timeout()),this,SLOT(OnIdle()));
  t->start(0,false);
}
MainApp::~MainApp
{
  t->stop();
}

void MainApp::init()
{
  <do something>
  MainWnd * mw=new MainWnd();
  setMainWidget(mw);
  mw->show();       
  <do something>  
}

oid MainApp:::OnIdle()
{
  if(qApp->hasPendingEvents())
  {

  }
  else
  {
     <do something>
  }
}


I would like to know my Kdevelop is using gdb for debugging or not?
Where can I learn more for debugging?
and where can I find out more information about debug message?
Thank you very much

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

11

Friday, September 23rd 2005, 10:50am

Do you really need to subclass QApplication? It looks like this causes the problems. This onIdle doesn't do anything serious anyway, because QApplication is the owner of the event loop anyway, so there really is no point in installing such thing. You could just get rid of that timer there. What happens if you use QApplication instead of your subclass?

12

Monday, September 26th 2005, 4:21am

;(
I really have to use QApplication for subclass because I wanna use qApp from other dialogs to call the functions/methods in MainA(application) and MainW(main window of menu).
What is more, I would like to do lots of initization in the application.
If I just use the qapplication then it is difficult for me to restructure and initialize the program.
:(

13

Monday, September 26th 2005, 4:26am

I forgot one thing

Source code

1
2
3
4
5
6
7
8
9
10
11
void MainApp:::OnIdle()
{
  if(qApp->hasPendingEvents())
  {

  }
  else
  {
     <do something about multi-threading>
  }
}


I use the OnIdle to do some multi-threading. Does it also cause problem?

14

Monday, September 26th 2005, 4:35am

Oh..............One more abnormal situation.
When I execute one time of the problem, it seem ok. 2xx/375 memory using in RAM.
Then I execute second time, it cause some errors.
And then I execute third time, it can't open.
When I use the system monitor to see the memory using, 368/375..........I close the program and kdevelop but it still doesn't release the memory. Why it can use up so many memory without release? In fact, I have already increase the memory from 192 to 375.

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

15

Monday, September 26th 2005, 10:05am

Quoted

Originally posted by 111
I use the OnIdle to do some multi-threading. Does it also cause problem?


If we are talking about Qt3, then yes, it might be the source of problems. If you want dialogs to call functions from other dialogs, you don't need to subclass QApplication. It is enough if you make those dialogs children of QApplication object or make one of the windows a main window of the application. Then you'll be able to access the dialogs directly via the QApplication and QObject interfaces. Moreover think about using signals and slots for interwidget communication, because subclassing QApplication for this is not really a good solution. And certainly not the easiest one (the easiest one would be to have global pointers to those dialogs, just like qApp is a global pointer to the application object).

16

Wednesday, September 28th 2005, 2:40pm

I have already changed to use the QApplication instead of sub-classing the QApplication.
I put out the multi-threading and timer.........
It sill has the same problem.
:(

I am using KDevelop 2.1.5 and Qt 3.1.1. I use RedHat 9.0.
I saw that the KDevelop also use up lots of RAM.
Is it the version too old that cause the problem???
?(