View Issue Details

IDProjectCategoryView StatusLast Update
0012568ScribusUndo/Redopublic2026-08-28 03:42
ReporterFirasH Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status confirmedResolutionopen 
Platformx86_64OSFreeBSDOS Version10.0.2
Product Version1.5.0svn 
Target Version1.5.5 
Summary0012568: Undo/Redo crashes Scribus editing Groups as Inline Items
DescriptionUndo/Redo crashes Scribus editing Groups as Inline Items.
Steps To Reproduce0) Create a new document and make sure Windows > Inline Items is opened
1) Insert 2 items (example: Text Frame)
2) Select the 2 items and Item > Grouping > Group
3) Select the Group and Item > Send to > Inline Items
4) From Windows > Inline Items double-click on the Group
5) Select the Group and Item > Grouping > Ungroup [Editing Inline Frame]
6) Undo 3 times

Scribus crashes due to Signal 11
Additional Information1.5.0.svn (19373)


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 815406400 (LWP 100515/scribus)]
QListData::size (this=0x0) at qlist.h:91
91 inline int size() const { return d->end - d->begin; }
(gdb) bt
 0 QListData::size (this=0x0)
    at qlist.h:91
 1 0x000000000082964d in QList<PageItem*>::indexOf (this=0x0,
    t=@0x7fffffff8df8, from=0) at qlist.h:884
 2 0x0000000000e43ef7 in ScribusDoc::itemSelection_UnGroupObjects (
    this=0x825460000, customSelection=0x7fffffff8f60)
    at /usr/home/.../Scribus/scribus/scribusdoc.cpp:15452
 3 0x0000000000e37670 in ScribusDoc::restoreGrouping (this=0x825460000,
    state=0x8248aa3c0, isUndo=true)
    at /usr/home/.../Scribus/scribus/scribusdoc.cpp:2374
 4 0x0000000000e29ece in ScribusDoc::restore (this=0x825460000,
    state=0x8248aa3c0, isUndo=true)
    at /usr/home/.../Scribus/scribus/scribusdoc.cpp:1747
 5 0x0000000000e410ee in non-virtual thunk to ScribusDoc::restore(UndoState*, bool) (this=0x825460010, state=0x8248aa3c0, isUndo=true)
    at /usr/home/.../Scribus/scribus/scribusdoc.cpp:2294
 6 0x0000000000f553ad in UndoState::undo (this=0x8248aa3c0)
    at /usr/home/.../Scribus/scribus/undostate.cpp:73
 7 0x0000000000f46521 in TransactionState::undo (this=0x8248b2920)
    at /usr/home/.../Scribus/scribus/undomanager.cpp:813
 8 0x0000000000f51f14 in UndoStack::undo (this=0x8244f8e40, steps=1,
    objectId=-1)
    at /usr/home/.../Scribus/scribus/undostack.cpp:80
 9 0x0000000000f45012 in UndoManager::undo (this=0x815531260, steps=1)
    at /usr/home/.../Scribus/scribus/undomanager.cpp:555
 10 0x0000000000742654 in UndoManager::qt_static_metacall (_o=0x815531260,
    _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7fffffffc0e0)
    at /usr/home/.../Scribus/build/scribus/moc_undomanager.cpp:143
 11 0x00000008024ac827 in QMetaObject::activate ()
   from /usr/local/lib/libQt5Core.so.5
 12 0x0000000000735ecb in ScrAction::triggeredData (this=0x81569d5c0, _t1=1)
    at /usr/home/.../Scribus/build/scribus/moc_scraction.cpp:245
 13 0x0000000000d66d0c in ScrAction::triggeredToTriggeredData (
    this=0x81569d5c0)
    at /usr/home/.../Scribus/scribus/scraction.cpp:100
 14 0x0000000000735a0e in ScrAction::qt_static_metacall (_o=0x81569d5c0,
    _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7fffffffc490)
    at /usr/home/.../Scribus/build/scribus/moc_scraction.cpp:117
 15 0x00000008024ac827 in QMetaObject::activate ()
   from /usr/local/lib/libQt5Core.so.5
 16 0x0000000802a039cf in QAction::activate ()
   from /usr/local/lib/libQt5Widgets.so.5
 17 0x0000000802ad1dac in QAbstractButton::isCheckable ()
   from /usr/local/lib/libQt5Widgets.so.5
 18 0x0000000802ad2e50 in QAbstractButton::mouseReleaseEvent ()
   from /usr/local/lib/libQt5Widgets.so.5
 19 0x0000000802b8b8cf in QToolButton::mouseReleaseEvent ()
   from /usr/local/lib/libQt5Widgets.so.5
 20 0x0000000802a41281 in QWidget::event ()
   from /usr/local/lib/libQt5Widgets.so.5
 21 0x0000000802ad2bb3 in QAbstractButton::event ()
   from /usr/local/lib/libQt5Widgets.so.5
 22 0x0000000802b8be0e in QToolButton::event ()
   from /usr/local/lib/libQt5Widgets.so.5
 23 0x0000000802a0b1a7 in QApplicationPrivate::notify_helper ()
   from /usr/local/lib/libQt5Widgets.so.5
 24 0x0000000802a0e018 in QApplication::notify ()
   from /usr/local/lib/libQt5Widgets.so.5
 25 0x000000080247cac2 in QCoreApplication::notifyInternal ()
   from /usr/local/lib/libQt5Core.so.5
 26 0x0000000802a0bb45 in QApplicationPrivate::sendMouseEvent ()
   from /usr/local/lib/libQt5Widgets.so.5
 27 0x0000000802a5daca in QWidgetPrivate::setModal_sys ()
   from /usr/local/lib/libQt5Widgets.so.5
 28 0x0000000802a5cdff in QWidgetPrivate::setModal_sys ()
   from /usr/local/lib/libQt5Widgets.so.5
 29 0x0000000802a0b1a7 in QApplicationPrivate::notify_helper ()
   from /usr/local/lib/libQt5Widgets.so.5
 30 0x0000000802a0dc0c in QApplication::notify ()
   from /usr/local/lib/libQt5Widgets.so.5
 31 0x000000080247cac2 in QCoreApplication::notifyInternal ()
   from /usr/local/lib/libQt5Core.so.5
 32 0x000000080315c8f7 in QGuiApplicationPrivate::processMouseEvent ()
   from /usr/local/lib/libQt5Gui.so.5
 33 0x000000080315bc41 in QGuiApplicationPrivate::processWindowSystemEvent ()
   from /usr/local/lib/libQt5Gui.so.5
 34 0x000000080314cb58 in QWindowSystemInterface::sendWindowSystemEvents ()
   from /usr/local/lib/libQt5Gui.so.5
 35 0x0000000814d796f0 in qt_plugin_instance ()
   from /usr/local/lib/qt5/plugins/platforms/libqxcb.so
 36 0x000000080becf142 in g_main_context_dispatch ()
   from /usr/local/lib/libglib-2.0.so.0
 37 0x000000080becf497 in g_main_context_pending ()
   from /usr/local/lib/libglib-2.0.so.0
 38 0x000000080becf524 in g_main_context_iteration ()
   from /usr/local/lib/libglib-2.0.so.0
 39 0x00000008024cae58 in QEventDispatcherGlib::processEvents ()
   from /usr/local/lib/libQt5Core.so.5
 40 0x0000000814d7969c in qt_plugin_instance ()
   from /usr/local/lib/qt5/plugins/platforms/libqxcb.so
 41 0x000000080247a45e in QEventLoop::exec ()
   from /usr/local/lib/libQt5Core.so.5
 42 0x000000080247d072 in QCoreApplication::exec ()
   from /usr/local/lib/libQt5Core.so.5
 43 0x00000000014c377b in mainApp (argc=1, argv=0x7fffffffd6a8)
    at main_nix.cpp:86
 44 0x00000000014c36c2 in main (argc=1, argv=0x7fffffffd6a8)
    at main_nix.cpp:54
Tags#please_test
Patch

Relationships

child of 0012500 acknowledged Metabug: Undo/Redo (1.5.x.svn) 

Activities

Kunda

2014-07-28 20:11

updater   ~0033059

Confirmed OSX 10.8.5 1.5svn r19374

qirat

2026-08-28 03:42

reporter   ~0054351

I could still reproduce it after 12 years. Here is a patch.

#Cause:
Inline Item edit mode swaps `ScribusDoc::Items` to the temporary edit list but leaves the normal document Undo stack active. Undo can then replay a pre-inline grouping state against the wrong item container and dereference a null group list.

#Fix:
Switch to a dedicated temporary Undo stack for Inline Item editing; suppress setup/teardown operations and restore the document stack on exit.

#Rationale:
Keeps Undo history scoped to the active item context and fixes the state mismatch rather than masking the crash with a null check.

#Additional:
New backtrace attached if that is somehow useful
inline-items-undo-crash-v1.0.patch (1,176 bytes)   
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 27785)
+++ scribus/scribusdoc.cpp	(working copy)
@@ -6973,8 +6973,11 @@
 	if (mode == m_inlineEditMode)
 		return;
 	m_inlineEditMode = mode;
+	const QString inlineUndoStack = QStringLiteral("__inline_edit_%1").arg(uuidString());
 	if (mode)
 	{
+		m_undoManager->switchStack(inlineUndoStack);
+		m_undoManager->setUndoEnabled(false);
 		m_storedLayerID = activeLayer();
 		int layerID = firstLayerID();
 		m_storedFirstLayerID = layerID;
@@ -7013,9 +7016,11 @@
 		m_Selection->delaySignalsOff();
 		m_ScMW->changeLayer(layerID);
 		changed();
+		m_undoManager->setUndoEnabled(true);
 	}
 	else
 	{
+		m_undoManager->setUndoEnabled(false);
 		ScPage* addedPage = TempPages.at(0);
 		if (Items->isEmpty())
 		{
@@ -7101,6 +7106,9 @@
 		setLayerVisible(m_storedFirstLayerID, m_storedLayerVis);
 		setLayerLocked(m_storedFirstLayerID, m_storedLayerLock);
 		m_ScMW->changeLayer(m_storedLayerID);
+		m_undoManager->removeStack(inlineUndoStack);
+		m_undoManager->switchStack(documentFileName());
+		m_undoManager->setUndoEnabled(true);
 	}
 }
 
backtrace-new.txt (2,036 bytes)   
(gdb) bt
#0  0x0000000000b9f735 in QList<PageItem*>::size() const::{lambda()#1}::operator()() const
    (__closure=0x7fffffffbcb0) at /usr/include/qt6/QtCore/qlist.h:460
#1  0x0000000000b9f79a in QList<PageItem*>::size (this=0x0) at /usr/include/qt6/QtCore/qlist.h:460
#2  0x0000000000b9fca8 in QtPrivate::indexOf<PageItem*, PageItem*>
    (vector=..., u=@0x7fffffffbe88: 0x5e46530, from=0) at /usr/include/qt6/QtCore/qlist.h:1005
#3  0x0000000000b9e6de in QListSpecialMethodsBase<PageItem*>::indexOf<PageItem*>
    (this=0x0, t=@0x7fffffffbe88: 0x5e46530, from=0) at /usr/include/qt6/QtCore/qlist.h:1038
#4  0x000000000122f714 in ScribusDoc::itemSelection_UnGroupObjects (this=0x5ee0210, customSelection=0x7fffffffc000)
    at /home/M/x/1_src/scribus/scribusdoc.cpp:16143
#5  0x00000000011d1766 in ScribusDoc::restoreGrouping (this=0x5ee0210, ss=0x2d2eff0, isUndo=true)
    at /home/M/x/1_src/scribus/scribusdoc.cpp:2137
#6  0x00000000011cdb93 in ScribusDoc::restore (this=0x5ee0210, state=0x2d2eff0, isUndo=true)
    at /home/M/x/1_src/scribus/scribusdoc.cpp:1846
#7  0x000000000132a2f0 in UndoState::undo (this=0x2d2eff0) at /home/M/x/1_src/scribus/undostate.cpp:72
#8  0x000000000132b5af in TransactionState::undo (this=0x48e17f0) at /home/M/x/1_src/scribus/undostate.cpp:335
#9  0x000000000132871a in UndoStack::undo (this=0x5f278b8, steps=1, objectId=-1)
    at /home/M/x/1_src/scribus/undostack.cpp:82
#10 0x0000000001316038 in UndoManager::undo (this=0x225c100, steps=1)
    at /home/M/x/1_src/scribus/undomanager.cpp:395
#11 0x0000000000a9bd2d in UndoManager::qt_static_metacall
    (_o=0x225c100, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7fffffffcf00)
    at /home/M/x/1_build/scribus/scribus-1.7.4.svn_autogen/EWIEGA46WW/moc_undomanager.cpp:162
#12 0x00007ffff438497c in doActivate<false>
    (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.11.1-1.fc44.x86_64/src/corelib/kernel/qobject.cpp:4384
#13 0x0000000000ac5f60 in QMetaObject::activate<void, int>
backtrace-new.txt (2,036 bytes)   

Issue History

Date Modified Username Field Change
2014-07-28 18:46 FirasH New Issue
2014-07-28 18:46 FirasH Relationship added child of 0012500
2014-07-28 20:11 Kunda Note Added: 0033059
2014-07-28 20:11 Kunda Status new => confirmed
2014-07-28 20:11 Kunda Target Version => 1.5.0
2014-09-11 02:34 Kunda Severity crash => block
2015-05-19 20:56 cbradney Target Version 1.5.0 => 1.5.1
2016-01-23 17:16 cbradney Target Version 1.5.1 => 1.5.3
2016-12-08 21:30 Kunda Target Version 1.5.3 => 1.5.5
2016-12-29 23:43 plinnell Severity block => major
2026-08-28 03:42 qirat Note Added: 0054351
2026-08-28 03:42 qirat File Added: inline-items-undo-crash-v1.0.patch
2026-08-28 03:42 qirat File Added: backtrace-new.txt
2026-08-28 03:42 qirat Tag Attached: #please_test