LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 04-02-2015, 08:53 AM   #1
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Rep: Reputation: Disabled
SEGV error when running an application made in qt on arm


Hi,

I am trying to run a little application on my target (simply a window, no button, no text, just a window) but when i try to run it like :
./app -qws

Nothing appear on screen and i get a "SEGV" message on the terminal.
After searching for this kind of error i often read that i could happen because a program try to have acces to a part of the memory who either don't exist on which it don't have the right to use. (i chmod 777 the program to give it all rights)

I know the compiler is working because i can generate a little .c file which will make a print 'hello world' on the terminal but now i would like to use the screen with my board

In Qt creator the files are :
mainwindow.h :
Code:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
A main.cpp:
Code:
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
and a mainwindow.cpp
Code:
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
 
Old 04-03-2015, 07:22 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
When you perform your compilation, you can add "-ggdb" to the compile line and this will add debug symbols for GDB debugging. You can then run your program using GDB and when it hits the segment violation you can view the state of variables as well as the backtrace to assist you in diagnosing where your problem lies.

Where's the definition of the function setupUi()?
 
Old 04-03-2015, 08:17 AM   #3
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
When you perform your compilation, you can add "-ggdb" to the compile line and this will add debug symbols for GDB debugging. You can then run your program using GDB and when it hits the segment violation you can view the state of variables as well as the backtrace to assist you in diagnosing where your problem lies.

Where's the definition of the function setupUi()?
I don't have a debugger currently on the board, i try to use the debugger of qt creator(which i use to make the application) but for it to work it must connect to the board, but it can't because the board don't have a ssh server running right now.

I am trying to cross compile openssh and dropbear for my board, but no luck for now i always have an error :
configure: error: *** zlib.h missing - please install first or check config.log ***

I check if the zlib.h file is in the path i give either openssh or dropbear in their configuration and it exist there.

to cross compile openssh i do this :

Code:
Build Zlib:

cd zlib-1.2.7
CC=arm-linux-gcc
./configure --prefix=$HOME/zlibArm
make 
make install

Build OpenSSL:

export cross=arm-linux-
cd openssl-1.0.1c
./Configure dist --prefix=$HOME/opensslArm
make CC="${cross}gcc" AR="${cross}ar r" RANLIB="${cross}ranlib"
make install

Build OpenSSH:

./configure --host=arm-linux --with-libs --with-zlib=$HOME/zlibArm --with-ssl-dir=$HOME/opensslArm --disable-etc-default-login CC=arm-linux-gcc AR=arm-linux-ar --prefix=$HOME/cross
And for dropbear :
Code:
export PATH=/home/spi/installQt/arm-linux-comp/bin:$PATH

./configure --prefix=$HOME/cross CC=arm-linux-gcc --host=arm-linux --with-zlib=$HOME/zlibArm/
Always have this error.
 
Old 04-03-2015, 08:24 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Two options then, you can debug remotely using GDBSERVER or you can add a bunch of printf() calls or issue logs sequentially through the progression of your program's initialization.
 
Old 04-03-2015, 08:52 AM   #5
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
Two options then, you can debug remotely using GDBSERVER or you can add a bunch of printf() calls or issue logs sequentially through the progression of your program's initialization.
I will take a look at GDBSERVER and if this don't work again then i will try the printf() solution (kind of cheap but if it works to at least understand when it bugs...)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CONFIG_FILTER error while running ISC dhcpd daemon on arm-linux mukundsagar Linux - Networking 0 11-24-2011 06:45 AM
Error while signing a compiled code for Exadigm PoS running Arm-Linux sunnyben Linux - Newbie 0 05-02-2010 01:29 PM
error running java application alee Linux - Newbie 2 02-09-2009 12:29 AM
shared library error while running gdbserver on target with arm-926ejs processor amit123solanki Linux - Software 0 07-08-2008 12:55 AM
Error-triggering on Embedded (ARM) running PostgreSQL billygotee Linux - Networking 0 10-19-2006 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 08:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration