[Kde-java] Compressed Icons in Java Apps created with juic

Lukas Molzberger lukas.molzberger at gmx.de
Sat Aug 21 15:25:20 CEST 2004


It seems that I've sent my last email a little too early. There is yet another 
problem with postEvent that causes my program to crash after some time. 
However, I think I know the reason for the problem this time. 

First, here is the output that I get when the app crashes:

Post a custom event!
Received a custom event!
Post a custom event!
Received a custom event!

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x4D0AAAB7
Function=Java_org_kde_qt_QCustomEvent_finalize+0x57
Library=/opt/kde3/lib/libqtjava.so.1.0.0

Current Java thread:
 at org.kde.qt.QCustomEvent.finalize(Native Method)
 at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
 at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
 at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
 at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)

Dynamic libraries:
08048000-0804e000 r-xp 00000000 03:01 
74827      /usr/lib/SunJava2-1.4.2/bin/java
0804e000-0804f000 rw-p 00005000 03:01 
74827      /usr/lib/SunJava2-1.4.2/bin/java
40000000-40016000 r-xp 00000000 03:01 11787      /lib/ld-2.3.3.so
40016000-40017000 rw-p 00015000 03:01 11787      /lib/ld-2.3.3.so
4002f000-4003c000 r-xp 00000000 03:01 11815      /lib/tls/libpthread.so.0
4003c000-4003d000 rw-p 0000d000 03:01 11815      /lib/tls/libpthread.so.0
4003f000-40041000 r-xp 00000000 03:01 11796      /lib/libdl.so.2
40041000-40042000 rw-p 00002000 03:01 11796      /lib/libdl.so.2
40042000-4014c000 r-xp 00000000 03:01 11813      /lib/tls/libc.so.6
4014c000-40154000 rw-p 0010a000 03:01 11813      /lib/tls/libc.so.6
40158000-40552000 r-xp 00000000 03:01 
59563      /usr/lib/SunJava2-1.4.2/jre/lib/i386/client/libjvm.so
40552000-4056e000 rw-p 003f9000 03:01 
59563      /usr/lib/SunJava2-1.4.2/jre/lib/i386/client/libjvm.so
40580000-40588000 r-xp 00000000 03:01 
59591      /usr/lib/SunJava2-1.4.2/jre/lib/i386/native_threads/libhpi.so
40588000-40589000 rw-p 00007000 03:01 
59591      /usr/lib/SunJava2-1.4.2/jre/lib/i386/native_threads/libhpi.so
40589000-4058d000 rw-s 00000000 03:01 172399     /tmp/hsperfdata_root/30286
40597000-405a9000 r-xp 00000000 03:01 11799      /lib/libnsl.so.1
405a9000-405aa000 rw-p 00011000 03:01 11799      /lib/libnsl.so.1
405ac000-405cd000 r-xp 00000000 03:01 11814      /lib/tls/libm.so.6
405cd000-405ce000 rw-p 00020000 03:01 11814      /lib/tls/libm.so.6
405ce000-405de000 r-xp 00000000 03:01 
59588      /usr/lib/SunJava2-1.4.2/jre/lib/i386/libverify.so
405de000-405e0000 rw-p 0000f000 03:01 
59588      /usr/lib/SunJava2-1.4.2/jre/lib/i386/libverify.so
405e0000-40600000 r-xp 00000000 03:01 
59574      /usr/lib/SunJava2-1.4.2/jre/lib/i386/libjava.so
40600000-40602000 rw-p 0001f000 03:01 
59574      /usr/lib/SunJava2-1.4.2/jre/lib/i386/libjava.so
40602000-40616000 r-xp 00000000 03:01 
59589      /usr/lib/SunJava2-1.4.2/jre/lib/i386/libzip.so
40616000-40619000 rw-p 00013000 03:01 
59589      /usr/lib/SunJava2-1.4.2/jre/lib/i386/libzip.so
40619000-41fb1000 r--s 00000000 03:01 
59654      /usr/lib/SunJava2-1.4.2/jre/lib/rt.jar
41ffb000-42011000 r--s 00000000 03:01 
59661      /usr/lib/SunJava2-1.4.2/jre/lib/sunrsasign.jar
42011000-420ec000 r--s 00000000 03:01 
59610      /usr/lib/SunJava2-1.4.2/jre/lib/jsse.jar
420ec000-420fd000 r--s 00000000 03:01 
59609      /usr/lib/SunJava2-1.4.2/jre/lib/jce.jar
420fd000-42656000 r--s 00000000 03:01 
59508      /usr/lib/SunJava2-1.4.2/jre/lib/charsets.jar
4c903000-4c93e000 r--p 00000000 03:01 
15313      /usr/lib/locale/de_DE.utf8/LC_CTYPE
4c93e000-4c944000 r--s 00000000 03:01 
12844      /usr/lib/gconv/gconv-modules.cache
4cb48000-4cb4b000 r--s 00000000 03:01 
59517      /usr/lib/SunJava2-1.4.2/jre/lib/ext/dnsns.jar
4cb4b000-4cb67000 r--s 00000000 03:01 
59520      /usr/lib/SunJava2-1.4.2/jre/lib/ext/sunjce_provider.jar
4cb67000-4cb74000 r--s 00000000 03:01 
59518      /usr/lib/SunJava2-1.4.2/jre/lib/ext/ldapsec.jar
4cb74000-4cc30000 r--s 00000000 03:01 
59519      /usr/lib/SunJava2-1.4.2/jre/lib/ext/localedata.jar
4cc30000-4cc6a000 r--s 00000000 03:01 
195685     /usr/lib/SunJava2-1.4.2/jre/lib/ext/mysql-connector-java-3.0.14-production-bin.jar
4cc6a000-4cce9000 r--s 00000000 03:01 128755     /opt/kde3/lib/java/koala.jar
4cce9000-4cd3f000 r--s 00000000 03:01 128763     /opt/kde3/lib/java/qtjava.jar
4cd3f000-4d0df000 r-xp 00000000 03:01 
128775     /opt/kde3/lib/libqtjava.so.1.0.0
4d0df000-4d0f6000 rw-p 0039f000 03:01 
128775     /opt/kde3/lib/libqtjava.so.1.0.0
4d0f9000-4d85a000 r-xp 00000000 03:01 
21962      /usr/lib/qt3/lib/libqt-mt.so.3.3.3
4d85a000-4d8a0000 rw-p 00761000 03:01 
21962      /usr/lib/qt3/lib/libqt-mt.so.3.3.3
4d8a4000-4d8a5000 r-xp 00000000 03:01 
28132      /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
4d8a5000-4d8a6000 rw-p 00000000 03:01 
28132      /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
4d8bb000-4d8c2000 r-xp 00000000 03:01 28244      /usr/X11R6/lib/libXi.so.6.0
4d8c2000-4d8c3000 rw-p 00006000 03:01 28244      /usr/X11R6/lib/libXi.so.6.0
4d8c3000-4d8ca000 r-xp 00000000 03:01 
28257      /usr/X11R6/lib/libXrender.so.1.2.2
4d8ca000-4d8cb000 rw-p 00006000 03:01 
28257      /usr/X11R6/lib/libXrender.so.1.2.2
4d8cb000-4d8ce000 r-xp 00000000 03:01 
28255      /usr/X11R6/lib/libXrandr.so.2.0
4d8ce000-4d8cf000 rw-p 00002000 03:01 
28255      /usr/X11R6/lib/libXrandr.so.2.0
4d8cf000-4d8e0000 r-xp 00000000 03:01 
28242      /usr/X11R6/lib/libXft.so.2.1.1
4d8e0000-4d8e1000 rw-p 00011000 03:01 
28242      /usr/X11R6/lib/libXft.so.2.1.1
4d8e1000-4d943000 r-xp 00000000 03:01 21180      /usr/lib/libfreetype.so.6.3.5
4d943000-4d94a000 rw-p 00062000 03:01 21180      /usr/lib/libfreetype.so.6.3.5
4d94a000-4d96f000 r-xp 00000000 03:01 
25353      /usr/lib/libfontconfig.so.1.0.4
4d96f000-4d973000 rw-p 00025000 03:01 
25353      /usr/lib/libfontconfig.so.1.0.4
4d974000-4d9a1000 r-xp 00000000 03:01 88508      /usr/lib/libpng.so.3.1.2.5
4d9a1000-4d9a2000 rw-p 0002c000 03:01 88508      /usr/lib/libpng.so.3.1.2.5
4d9a2000-4d9b2000 r-xp 00000000 03:01 12312      /lib/libz.so.1.2.1
4d9b2000-4d9b3000 rw-p 0000f000 03:01 12312      /lib/libz.so.1.2.1
4d9b3000-4d9c1000 r-xp 00000000 03:01 28235      /usr/X11R6/lib/libXext.so.6.4
4d9c1000-4d9c2000 rw-p 0000d000 03:01 28235      /usr/X11R6/lib/libXext.so.6.4
4d9c2000-4daba000 r-xp 00000000 03:01 28224      /usr/X11R6/lib/libX11.so.6.2
4daba000-4dabe000 rw-p 000f7000 03:01 28224      /usr/X11R6/lib/libX11.so.6.2
4dabe000-4dac6000 r-xp 00000000 03:01 28221      /usr/X11R6/lib/libSM.so.6.0
4dac6000-4dac7000 rw-p 00007000 03:01 28221      /usr/X11R6/lib/libSM.so.6.0
4dac7000-4dadc000 r-xp 00000000 03:01 28219      /usr/X11R6/lib/libICE.so.6.3
4dadc000-4dadd000 rw-p 00014000 03:01 28219      /usr/X11R6/lib/libICE.so.6.3
4dadf000-4db80000 r-xp 00000000 03:01 16317      /usr/lib/libstdc++.so.5.0.5
4db80000-4db96000 rw-p 000a0000 03:01 16317      /usr/lib/libstdc++.so.5.0.5
4db9b000-4dba2000 r-xp 00000000 03:01 12340      /lib/libgcc_s.so.1
4dba2000-4dba3000 rw-p 00007000 03:01 12340      /lib/libgcc_s.so.1
4dba3000-4dbab000 r-xp 00000000 03:01 
28233      /usr/X11R6/lib/libXcursor.so.1.0.2
4dbab000-4dbac000 rw-p 00007000 03:01 
28233      /usr/X11R6/lib/libXcursor.so.1.0.2
4dbac000-4dbc8000 r-xp 00000000 03:01 16028      /usr/lib/libexpat.so.0.5.0
4dbc8000-4dbcb000 rw-p 0001c000 03:01 16028      /usr/lib/libexpat.so.0.5.0
4dbcb000-4dbe9000 r-xp 00000000 03:01 
160414     /opt/kde3/lib/kde3/plugins/styles/plastik.so
4dbe9000-4dbea000 rw-p 0001e000 03:01 
160414     /opt/kde3/lib/kde3/plugins/styles/plastik.so
4dbea000-4dc14000 r-xp 00000000 03:01 
94102      /opt/kde3/lib/libkdefx.so.4.2.0
4dc14000-4dc15000 rw-p 0002a000 03:01 
94102      /opt/kde3/lib/libkdefx.so.4.2.0
4dc16000-4dc39000 r--p 00000000 03:01 
220818     /usr/X11R6/lib/X11/fonts/truetype/verdana.ttf

Heap at VM Abort:
Heap
 def new generation   total 576K, used 76K [0x44700000, 0x447a0000, 
0x44be0000)
  eden space 512K,   6% used [0x44700000, 0x447081e8, 0x44780000)
  from space 64K,  68% used [0x44780000, 0x4478b080, 0x44790000)
  to   space 64K,   0% used [0x44790000, 0x44790000, 0x447a0000)
 tenured generation   total 1408K, used 100K [0x44be0000, 0x44d40000, 
0x48700000)
   the space 1408K,   7% used [0x44be0000, 0x44bf9100, 0x44bf9200, 0x44d40000)
 compacting perm gen  total 4096K, used 1663K [0x48700000, 0x48b00000, 
0x4c700000)
   the space 4096K,  40% used [0x48700000, 0x4889fda0, 0x4889fe00, 0x48b00000)

Local Time = Sat Aug 21 14:53:04 2004
Elapsed Time = 12
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)
#
# An error report file has been saved as hs_err_pid30286.log.
# Please refer to the file for further information.
#


The Qt documentation of QApplication::postEvent says something like this:
"The event must be allocated on the heap since the post event queue will take 
ownership of the event and delete it once it has been posted. "

However, the QCustomEvent::finalize Method in QCustomEvent.cpp also tries to 
delete the C++ QCustomEvent object. 

JNIEXPORT void JNICALL
Java_org_kde_qt_QCustomEvent_finalize(JNIEnv* env, jobject obj)
{
 if (QtSupport::allocatedInJavaWorld(env, obj)) {
  delete (QCustomEvent*)QtSupport::getQt(env, obj);
  QtSupport::setQt(env, obj, 0);
 }
 return;
}

Is this possibly the reason for this crash?

Cheers,
Lukas


Am Samstag, 21. August 2004 10:30 schrieb Lukas Molzberger:
> I guess I found the reason why the events haven't been delivered.
> ClassifierThread.FINISHED_IMPORT_CORPUS was set to value 0 and it seems
> that Qt doesn't deliver events of type 0. So basically it had nothing to do
> with QtJava.
>
> Cheers
> Lukas
>
> Am Mittwoch, 18. August 2004 14:04 schrieb Richard Dale:
> > On Wednesday 18 August 2004 12:35, Lukas Molzberger wrote:
> > > Hi,
> > >
> > > > Could you post the .ui file to make it easier to test out the
> > > > problem?
> > >
> > > Sure, I'll send you the .ui file.
> >
> > Yes, thanks for sending me that..
> >
> > > In the meantime I've got yet another problem. Perhaps you know a
> > > solution for that problem too. The app that I'm writing contains a few
> > > operations that may take a long time to process and therefore I had to
> > > use Java threads to keep the ui from blocking.
> >
> > Another way to break up long term operations is to use a single thread
> > with QTimers - each long term operation does something for say 100 ms,
> > then exits setting a QTimer again ready for another 100 ms of processing
> > once the other operations have had a chance. This assumes that the work
> > can be split up into discrete chunks though. Or perhaps just fork() and
> > exec() a subprocess to run in the background.
> >
> > > So I have one thread for the ui and
> > > one thread for the actual processing and I use a working queue to get
> > > the commands from the ui to the processing thread. So far everything
> > > works very well, but what I still need is a way to inform the ui that
> > > processing has finished and that the ui needs to be updated. According
> > > to the Qt docs the way to do this is to call
> > >
> > > QCustomEvent ce = new
> > > QCustomEvent(ClassifierThread.FINISHED_IMPORT_CORPUS);
> > > QApplication.postEvent( qmainwindow, ce );
> > >
> > > in the processing thread and to have a method
> > >
> > >    protected void customEvent(QCustomEvent e) {
> > >      System.exit(0);  // Exit just for testing
> > >    }
> > >
> > > as part of the QMainWindow object. The problem is that while
> > > QApplication.postEvent( qmainwindow, ce ); definitely gets called, the
> > > event handler customEvent however doesn't get called. Do you have any
> > > idea?
> >
> > I'm not sure if you can mix java threads and Qt threads like this. I
> > think that's more likely to be the problem than the
> > QMainWindow.customEvent() method being wrong. Is there a Qt event logging
> > mechanism that could be turned on to track how the custom event gets
> > lost?
> >
> > In QMainWindow.cpp there is a custom event handler for overriding
> > customEvent() and it looks just the same as the other event handlers:
> >
> >  void customEvent(QCustomEvent* arg1) {
> >   if (!QtSupport::eventDelegate(this,"customEvent",
> > (void*)arg1,"org.kde.qt.QCustomEvent")) {
> >    QObject::customEvent(arg1);
> >   }
> >   return;
> >  }
> >
> > -- Richard
> > _______________________________________________
> > Kde-java mailing list
> > Kde-java at kde.org
> > https://mail.kde.org/mailman/listinfo/kde-java
>
> _______________________________________________
> Kde-java mailing list
> Kde-java at kde.org
> https://mail.kde.org/mailman/listinfo/kde-java
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PostEvent.java
Type: text/x-java
Size: 3190 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-java/attachments/20040821/c034bde2/PostEvent.bin


More information about the Kde-java mailing list