Active Topics

 


Reply
Thread Tools
Posts: 26 | Thanked: 34 times | Joined on Apr 2010
#1
Hi, I spent most of today setting up the maemo sdk/dev environment and managed to get an existing Qt app to build and run nicely in the emulator on Xephyr. However, when I transfer the executable onto my n900, it segfaults. Just that - "segmentation fault", with no additional details.

I'm somewhat baffled I tried again with a simple "Hello world" qt app and that one works flawlessly, so I must be doing at least most of the building/deploying procedures right. And the offending application works nicely on the emulator so the code should be mostly alright too(?). Any idea what might be the cause of the segfault? How different is the emulator environment from the one in the actual n900?
 
Posts: 102 | Thanked: 22 times | Joined on Oct 2009
#2
Are you compiling for the right target?

What is the command you are using to compile?
 
Posts: 26 | Thanked: 34 times | Joined on Apr 2010
#3
Thanks for the reply. I compile for X86 when testing on the emulator, then compile for Armel to transfer onto my device. I've done this for a 'hello world' qt app and it seems to work, so I think that's the correct way to do it?

I'm using the standard qt commands qmake, then make. I left out qmake -project because the app already had a .pro file. Could this be a problem?
 
Posts: 3 | Thanked: 0 times | Joined on May 2010
#4
Originally Posted by moofang View Post
Hi, I spent most of today setting up the maemo sdk/dev environment and managed to get an existing Qt app to build and run nicely in the emulator on Xephyr. However, when I transfer the executable onto my n900, it segfaults. Just that - "segmentation fault", with no additional details.

I'm somewhat baffled I tried again with a simple "Hello world" qt app and that one works flawlessly, so I must be doing at least most of the building/deploying procedures right. And the offending application works nicely on the emulator so the code should be mostly alright too(?). Any idea what might be the cause of the segfault? How different is the emulator environment from the one in the actual n900?
Hi,

I'm experiencing the same problem. I'm using the latest Maemo SDK and qthelloworld runs fine on the emulator, but segfaults on my N900. Any pointers are really appreciated!

_steve.
 
Posts: 26 | Thanked: 34 times | Joined on Apr 2010
#5
obvyst: I didn't have a problem with a hello world app. As above noted you need to make sure you compile for the right target. There should be two possible targets - X86, which runs on the emulator but not the n900, and Armel which works on the n900 but not the emulator. So after testing on the emulator, you need to compile the same code for Armel and transfer that result to the n900.
 
slobodsky's Avatar
Posts: 63 | Thanked: 41 times | Joined on Feb 2010 @ Moscow
#6
Do you "make distclean" before changing targets?
Do you have right Qt on your device? SDK uses 4.6.2, but there is only 4.5.3 in repos. Try libqt4-maemo5 and qmake from its directory (somewhere in /opt) for Armel target.
Do you have any odd things in your program? For example:
Code:
char Buff[3];
short Num = *(short*)(Buff+1);
will work fine on X86 processors but will crash on ARM.
__________________
Sorry for bad English. If you can point out mistakes in this post, send me a private message.

Last edited by slobodsky; 2010-05-21 at 11:09.
 
Andre Klapper's Avatar
Posts: 1,665 | Thanked: 1,649 times | Joined on Jun 2008 @ Praha, Czech Republic
#7
SDK is not an emulator.
SDK is not an emulator.
SDK is not an emulator.
SDK is not an emulator.
SDK is not an emulator.

Thanks.
__________________
maemo.org Bugmaster
 
Posts: 3 | Thanked: 0 times | Joined on May 2010
#8
Originally Posted by slobodsky View Post
Do you "make distclean" before changing targets?
Do you have right Qt on your device? SDK uses 4.6.2, but there is only 4.5.3 in repos. Try libqt4-maemo5 and qmake from its directory (somewhere in /opt) for Armel target.
Do you have any odd things in your program? For example:
Code:
char Buff[3];
short Num = *(short*)(Buff+1);
will work fine on X86 processors but will crash on ARM.
@moofang: I did deploy the ARMEL target. Also, gtkhelloworld works fine on my n900.

@slobodsky: Thanks. I'm a newbie, so forgive the ignorance:
1. How do I determine which version of QT is on my device?
2. Which is the standard version of QT that's distributed with the latest Fremantle image?
3. Is there a compatibility flag on qmake that I can use to generate binaries that link with earlier versions of QT?

Thanks in advance!

@andre: I thought the meaning of what I said was implied, but thanks for pointing it out anyways.

_steve.
 
Posts: 195 | Thanked: 108 times | Joined on Feb 2010 @ SF Bay Area, United States
#9
Originally Posted by obvyst View Post
3. Is there a compatibility flag on qmake that I can use to generate binaries that link with earlier versions of QT?
I had the same issue that you mentioned, and this is what I did to solve it.

1) Installed Qt4.6 libraries on the device.
2) In the scratchbox, switched to ARMEL target and then used these commands to link the correct version of libaries.

Code:
[sbox-FREMANTLE_ARMEL: ~] > /opt/qt4-maemo5/bin/qmake 
[sbox-FREMANTLE_ARMEL: ~] > make

AFAIK "qmake" will use Qt4.5 libraries and "/opt/qt4-maemo5/bin/qmake" will use Qt4.6.2.

P.S: For segmentation fault issues, using GDB debugger on your device will help alot in identifying the actual problem.
__________________
Maintainer of VICaR - Value International Call Router (a helper app for routing calls via calling card/skype-out/google voice)

Maintainer of Markets Today (Yahoo Finance based desktop widget/app)

Last edited by scifi.guy; 2010-05-22 at 04:26. Reason: Code tags
 
Posts: 3 | Thanked: 0 times | Joined on May 2010
#10
PR 1.2 solves this - woohoo! Hopefully Qt 4.6 will be (binary) backward compatible with 4.5.x in all cases, as promised.

_steve.
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:57.