segfault when selecting multiple fixtures - my buggy script?

Report problems here (or use the built-in feedback dialog in the editor)
Post Reply
nazgee
Posts: 7
Joined: Mon Sep 30, 2013 8:44 pm

segfault when selecting multiple fixtures - my buggy script?

Post by nazgee » Tue Oct 01, 2013 10:29 pm

Scenario: open scene, and select one by one multiple fixtures (Polygons and Loops)

Stack trace below is reproducible, as well as this issue- I've seen it few times so far. I think that commenting out both of my filtering and labeling scripts helped.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000569300 in MetaFixture::getShapeChildIndex(Shape*) ()
(gdb) bt
#0 0x0000000000569300 in MetaFixture::getShapeChildIndex(Shape*) ()
#1 0x00000000005e62e9 in EditorView::getPropertyValueDisplay(QModelIndex const&, bool) ()
#2 0x00000000005da9da in ItemPropertiesModel::data(QModelIndex const&, int) const ()
#3 0x00000000005daacd in ItemPropertiesModel::data(QModelIndex const&, int) const ()
#4 0x00007ffff6d23a37 in QStyledItemDelegate::initStyleOption(QStyleOptionViewItem*, QModelIndex const&) const () from ./lib/libQtGui.so.4
#5 0x00007ffff6d251c1 in QStyledItemDelegate::updateEditorGeometry(QWidget*, QStyleOptionViewItem const&, QModelIndex const&) const () from ./lib/libQtGui.so.4
#6 0x00007ffff6c85b67 in QAbstractItemView::updateEditorGeometries() () from ./lib/libQtGui.so.4
#7 0x00007ffff6c7799d in QAbstractItemView::updateGeometries() () from ./lib/libQtGui.so.4
#8 0x00007ffff6cbeabe in QTreeView::updateGeometries() () from ./lib/libQtGui.so.4
#9 0x00007ffff6cc5c44 in QTreeView::expandAll() () from ./lib/libQtGui.so.4
#10 0x0000000000557705 in EditorView::onUndoRedo() ()
#11 0x00000000005572bc in EditorView::doSelect() ()
#12 0x00000000005580d9 in EditorView::mouseUp(QMouseEvent*) ()
#13 0x00007ffff67d23ef in QWidget::event(QEvent*) () from ./lib/libQtGui.so.4
#14 0x00007ffff7283138 in QGLWidget::event(QEvent*) () from ./lib/libQtOpenGL.so.4
#15 0x00007ffff67858b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from ./lib/libQtGui.so.4
#16 0x00007ffff678aea9 in QApplication::notify(QObject*, QEvent*) () from ./lib/libQtGui.so.4
#17 0x000000000064671a in RubeApplication::notify(QObject*, QEvent*) ()
#18 0x00007ffff5f1bd6c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from ./lib/libQtCore.so.4
#19 0x00007ffff6786882 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from ./lib/libQtGui.so.4
#20 0x00007ffff67fe6b8 in ?? () from ./lib/libQtGui.so.4
#21 0x00007ffff67fd4aa in QApplication::x11ProcessEvent(_XEvent*) () from ./lib/libQtGui.so.4
#22 0x00007ffff682496a in ?? () from ./lib/libQtGui.so.4
#23 0x00007ffff5f1ac62 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from ./lib/libQtCore.so.4
#24 0x00007ffff5f1aeb7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from ./lib/libQtCore.so.4
#25 0x00007ffff5f1fdf7 in QCoreApplication::exec() () from ./lib/libQtCore.so.4
#26 0x0000000000427be4 in main ()

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: segfault when selecting multiple fixtures - my buggy scr

Post by iforce2d » Wed Oct 02, 2013 9:59 am

When you say 'filtering script', you mean property display filter script right?
Could you post that script (just the function that filters fixture properties)?

nazgee
Posts: 7
Joined: Mon Sep 30, 2013 8:44 pm

Re: segfault when selecting multiple fixtures - my buggy scr

Post by nazgee » Sun Oct 06, 2013 12:29 pm

property display filter script:

Code: Select all

bool shouldDisplayProperty( fixture f, const string& in propertyName ) {
	bool isStatic = f.getBody().getType() == 0;
	if ( propertyName == "stencil") {
		return isStatic;
	} else if ( propertyName == "fading_edge") {
		if (f.getShapes().length() > 0) {
			return (f.getShape(0).type==2);
		}
	} else if ( propertyName == "smoke_angle") {
		return (!isStatic);
	}

	return true;
}
label coloring script:

Code: Select all

void setLabelColors(fixture f, color &out background, color &out foreground) {
	background.set1(0,0,0,0.5);
	float r_fore = 1;
	float g_fore = 1;
	float b_fore = 1;
	float a_fore = 1;
	if (f.getCustomBool("stencil")) {
		b_fore = 0;
	}
	foreground.set1(r_fore, g_fore, b_fore, a_fore); // green, half opacity
}

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: segfault when selecting multiple fixtures - my buggy scr

Post by iforce2d » Wed Nov 13, 2013 11:35 am

Hi Nazgee

This appears to be the same as this issue which was reported recently. It should be fixed by v1.5.2 which has just been uploaded. Thanks again for the report!

Post Reply