Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, April 2008
weired crashes


Message 1 in thread

Hi all,

I discovered something quite weired :

My app works perfectly fine with Linux (Fedora Core6),OS X and Win but lately I have problems running the Linux version with other distros such as older Fedora Core, Ubuntu or Mandriva. 

I'm starting my app via a shell script :

#!/bin/sh
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
./myApp

but every time I get a segault even when I try to start it with the gdb, which makes it hard to debug.

Can anyone give me a hint how to approach this new problem ?

Thanks in advance

-- A l e x



           
-- 
 [ signature omitted ] 

Message 2 in thread

On Thu, 2008-04-03 at 11:55 +0200, "Alexander CarÃt" wrote:
> Hi all,
> 
> I discovered something quite weired :
> 
> My app works perfectly fine with Linux (Fedora Core6),OS X and Win but lately I have problems running the Linux version with other distros such as older Fedora Core, Ubuntu or Mandriva. 

I recently had a similar problem.  I'll describe it below.

> but every time I get a segault even when I try to start it with the gdb, which makes it hard to debug.
> 

What does the backtrace look like after the segfault?

> Can anyone give me a hint how to approach this new problem ?

If the backtrace doesn't give you a clue, then make a copy of your
program and begin gutting it of all functionality.  Since you're
crashing early, almost everything can go.  Once you've boiled it down to
a few hundred lines, the error should be patently obvious.

It's unlikely that you've made the same mistake that I did, but I'll
describe my error just in case.  When I subclassed QApplication, I
inadvertently passed in argc by value instead of by reference in the
constructor.  This worked fine in Qt3 (probably by accident) but if
you're porting to Qt4, it won't work at all. (Okay, sometimes for no
discernible reason it still works.)  Whenever I attempted to "show" my
main window, a function deep in Qt would call XSetWMProperties with a
random value in argc.  Death quickly followed.

Hope this helps.

Fred

--
 [ signature omitted ] 

Message 3 in thread

Quoting Alexander Carôt <alexander_carot@xxxxxxx>:

> Hi all,
>
> I discovered something quite weired :
>
> My app works perfectly fine with Linux (Fedora Core6),OS X and Win but lately
> I have problems running the Linux version with other distros such as older
> Fedora Core, Ubuntu or Mandriva.
>
> I'm starting my app via a shell script :
>
> #!/bin/sh
> export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
> ./myApp
>
> but every time I get a segault even when I try to start it with the gdb,
> which makes it hard to debug.
>
> Can anyone give me a hint how to approach this new problem ?

Do you rebuild the app on each platform?

Paul

--
 [ signature omitted ] 

Message 4 in thread

> Do you rebuild the app on each platform?

Hi Paul,

no - I compiled it on Fedora Core 6 and run the binaries on other distros such as FC4,Mandriva or Ubuntu. So, the compiled version works fine but on some distros it simply crashes at the very beginning without telling me anything.

If you have an idea, just let me know.

Thanks

-- A l e x
-- 
 [ signature omitted ] 

Message 5 in thread

Hello Alexander,


On Thu, 03 Apr 2008 23:33:41 +0200 "Alexander Carôt" <alexander_carot@xxxxxxx> wrote:

> > Do you rebuild the app on each platform?
> 
> Hi Paul,
> 
> no - I compiled it on Fedora Core 6 and run the binaries on other distros such as FC4,Mandriva or Ubuntu. So, the compiled version works fine but on some distros it simply crashes at the very beginning without telling me anything.
> 
> If you have an idea, just let me know.

Ouch. You can't expect a binary compiled on a FC6 to run fine on
various other systems, not just like that. For some systems it will
work, and for some other it won't.

You should care about compatibility towards dependencies (systems libs
like libgcc_s, libstdc++, libc..). Do you link against libqt
statically? You might need to link against some libs dynamically and
some other statically depending on what you want or need, and probably
make several builds to cover the intended systems. And I'm not dealing
w/ 64bit ones or other architectures.


Regards,

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: PGP signature


Message 6 in thread

Quoting Alexander Carôt <alexander_carot@xxxxxxx>:

> > Do you rebuild the app on each platform?
>
> Hi Paul,
>
> no - I compiled it on Fedora Core 6 and run the binaries on other distros
> such as FC4,Mandriva or Ubuntu. So, the compiled version works fine but on
> some distros it simply crashes at the very beginning without telling me
> anything.
>
> If you have an idea, just let me know.

Hi

Generally, you can't do this. You need to compile on the oldest platform, and
deploy on the same or newer platforms. I'm not sure about compatibility between
different distros. Statically linking can help with some problems (but at the
same time may introduce others).

A+
Paul

--
 [ signature omitted ] 

Message 7 in thread

Hello Alexander,


On Thu, 03 Apr 2008 11:55:29 +0200 "Alexander Carôt" <alexander_carot@xxxxxxx> wrote:

> Hi all,
> 
> I discovered something quite weired :
> 
> My app works perfectly fine with Linux (Fedora Core6),OS X and Win but lately I have problems running the Linux version with other distros such as older Fedora Core, Ubuntu or Mandriva. 
> 
> I'm starting my app via a shell script :
> 
> #!/bin/sh
> export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
> ./myApp
> 
> but every time I get a segault even when I try to start it with the gdb, which makes it hard to debug.
> 
> Can anyone give me a hint how to approach this new problem ?

If gdb can't help, try running your application (w/ debug symbols
built in) from within valgrind, might takes ages, but provides a
detailed log.


Regards,

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: PGP signature