You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, August 27th 2008, 9:13am

segmentation fault!help

i have been stucked one whole day on this "segmentation fault"! And i still can not figure that out!! I hope someone who ever met this problem before can give me some suggestion.i will appreciate that very much.

i am doing some QTE stuff. i cross compile the example "progressbar" in the '$QTEDIR/examples/progressbar/' just fine. but when i copied that excutable file to my s3c2410 board, run it , i got 'segmentation fault' message. i don't how that happen! first i thought it may be caused by some lib version problem, but it's not. All libX.so in my filesystem is from my cross complier. the libqte is from the qt-embedded-2.3.10/lib. My cross compiler version is 3.4.1.my kernel is linux2.6.14.1 and i use cramfs+yaffs2 as root file system.

so i do some test. i compile some simple c and c++ programs, move them to board and run just fine. just the qt program don't run well.i have no idea what's going on! can anyone help me to fix it up?

thanks.
regards.

2

Wednesday, August 27th 2008, 9:29am

"segmentation fault" is a bit vague, can be memory curruption from writing out of bounds, deleting a dangling pointer,... Impossible to tell without code/stacktrace
madinsjamania

3

Wednesday, August 27th 2008, 9:38am

"segmentation fault" is a bit vague, can be memory curruption from writing out of bounds, deleting a dangling pointer,... Impossible to tell without code/stacktrace
thx for your reply..
i compile the qt program on PC side and it run well on qvfb. but not well for the board.

segmentation fault can be caused by using illegal pointer or some other problems.but i am not sure which one makes the segfault happen.the simple qt program source is following:
#include <qapplication.h>
#include <qlabel.h>

int main(int argc, char **argv)
{

QApplication app (argc, argv);

QLabel *hello = new QLabel("Hello Qt/Embedded!", 0);

app.setMainWidget(hello);

hello->show();

return app.exec();

return 0;
}
it's quite simple, isn't it? but it doesn't work on my board.