I have the following Qt class:
class GLWidget : public QGLWidget
{
Q_OBJECT
public:
GLWidget(QWidget *parent = 0);
private:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
double posX;
double posY;
double posZ;
};
When I put this in the constructor, my program produces a SIGABRT during GLWidget::~GLWidget:
this->posX = 0.0;
this->posY = 0.0;
this->posZ = 1.0;
These member variables aren’t used anywhere else in the class. If I don’t initialize the member variables, the program doesn’t fail. How can this lead to a SIGABRT?
Stack trace

Did you check the core file to see where it died?
That said, the most likely scenario is division by zero and/or assertion that X and Y are not zero.
EDIT: Also it seems likely that when you don’t initialize the values the program is behaving wrong but it just appears to work correctly/better.
EDIT2 in response to comment: You can configure unix/linux systems (with
coreadm) to leave a “core” file behind when you program crashes or aborts. It contains information about the call stack, registers, memory, etc. It does appear that you found it (or something similar). The line that saysactually makes me change my mind. It looks like your heap is corrupted, and the deletion is causing that to become visible. One possibility is that you deleted the object twice. If you’re on Linux, valgrind will probably be your best way to figure out what happened.