[Kde-java] Bug in KFileDialog

Richard Dale kde-java@kde.org
Tue, 25 Feb 2003 11:36:58 +0000


On Sunday 23 February 2003 11:31 pm, Felix Rodriguez wrote:
>   I think I might have discovered a bug in the KFileDialog getOpenFileName
> method. I am using QFileDialog instead and this seems to be working fine.
> KFileDialog is supposed to be a dropin replacement for QFileDialog.
The problem is that dynamic casts don't appear to work properly when kdelibs 
is linked with a java app. I changed four dynamic casts in the dialog code to 
use qt_cast() instead and that worked (eg one in KComboBox::setLineEdit() 
caused the crash below). 

But when the code got as far as displaying the dialog, it crashed in the 
QDialog::exec() call to handle the modal dialog. I would expect QFileDialog 
to also use the exec() method, so I've no idea why that works fine.

I'm using gcc 2.95 and glibc 2.2.5, I don't know if a newer compiler and 
associated libs would work ok - which version are you using? Perhaps if the 
app was compiled with gcj, rather than run under a jvm, it might work 
properly. 

However, I couldn't switch from gcc 2.95 to gcc 3.2.2 to use gcj because 
dynamic casts appeared to be crashing when I built KDE with it, and KDE 
wouldn't start properly - and that was nothing to do with java. So I'm 
feeling a bit stuck at the moment..

-- Richard

>  Here is the backtrace that is generated from gdb.
>
> #0  0x40511829 in wait4 () from /lib/libc.so.6
> #1  0x4058da24 in __DTOR_END__ () from /lib/libc.so.6
> #2  0x400308e3 in waitpid () from /lib/libpthread.so.0
> #3  0x4c93401e in KCrash::defaultCrashHandler(int) ()
>    from /usr/kde/3.1/lib/libkdecore.so.4
> #4  <signal handler called>
> #5  0x0820e610 in ?? ()
> #6  0x4c77e52b in KComboBox::setLineEdit(QLineEdit*) ()
>    from /usr/kde/3.1/lib/libkdeui.so.4
> #7  0x4c77d93d in KComboBox::KComboBox(bool, QWidget*, char const*) ()
>    from /usr/kde/3.1/lib/libkdeui.so.4
> #8  0x4c50c91b in KURLComboBox::KURLComboBox(KURLComboBox::Mode, bool,
> QWidget*, char const*) () from /usr/kde/3.1/lib/libkio.so.4
> #9  0x4c4ed880 in KFileDialog::init(QString const&, QString const&,
> QWidget*) () from /usr/kde/3.1/lib/libkio.so.4
> #10 0x4c4f1dd0 in KFileDialog::getOpenFileName(QString const&, QString
> const&, QWidget*, QString const&) () from /usr/kde/3.1/lib/libkio.so.4
> #11 0x4be1b3c0 in
> Java_org_kde_koala_KFileDialog_getOpenFileName__Ljava_lang_String_2Ljava_la
>ng_String_2Lorg_kde_qt_QWidget_2Ljava_lang_String_2 ()
>    from /usr/kde/3.1/lib/libkdejava.so.1.0.0
> #12 0x0806254d in ?? ()
> #13 0x0805fb29 in ?? ()
> #14 0x4045a9de in StubRoutines::_code1 ()
>
> _______________________________________________
> Kde-java mailing list
> Kde-java@mail.kde.org
> http://mail.kde.org/mailman/listinfo/kde-java