I wrote a Qt application which runs in Ubuntu Background as a Daemon. This application crashes after a random time, I want to see what error it gives when it crashesh.
I wrote this syntax to see if I can get its output in a text:
dimit@dimit-FX620DX:~$ ./Myapp &> DebugInfo.txt
but it doesn't write anything in the text file. I wrote this simple program to simulate the bigger project
Mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <stdio.h>
#include <iostream>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
std::vector<int> Test;
Test[-1] = 90; //in here it gives segmentation fault error and exits the program
}
MainWindow::~MainWindow()
{
delete ui;
}
here is the output of the terminal when I run this code:
dimit@dimit-FX620DX:~/QtProjects/Test/Test-build-desktop-Qt_4_8_1__System__Debug$ ./Myapp &> DebugInfo.txt
Aborted (core dumped)
I expected to see "Aborted (core dumped)" in the DebugInfo.txt file but nothing were written in it. What should I do ?
I'm using Qt 4.8 under Ubuntu 12.04
2>instead of>