View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012194 | Scribus | Undo/Redo | public | 2014-04-04 14:52 | 2026-08-31 04:29 |
| Reporter | FirasH | Assigned To | |||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | confirmed | Resolution | open | ||
| Platform | x86_64 | OS | openSUSE | OS Version | 13.1 |
| Product Version | 1.5.0svn | ||||
| Target Version | 1.5.5 | ||||
| Summary | 0012194: Redo is not able to restore correctly an imported SVG/PDF/EPS removed with Undo | ||||
| Description | Redo is not able to restore correctly an imported SVG/PDF/EPS removed with Undo. | ||||
| Steps To Reproduce | 0) Create a new document 1) Import an SVG (attached) 2) Undo 3) Redo 2 SVG files are now present on canvas. Moving them behaves quite strange, they're like grouped partially. 4) Select all and ungroup (Ctrl+Shift+G) 5) Undo twice Scribus crashes due to Signal 11 | ||||
| Additional Information | Scribus 1.5.0 SVN (19000) - Qt 5.2.1 Not having this issue with Scribus 1.4.4 SVN (18973) Related to 0012155 Program received signal SIGSEGV, Segmentation fault. 0x00007fffefaecd18 in main_arena () from /lib64/libc.so.6 (gdb) bt #0 0x00007fffefaecd18 in main_arena () from /lib64/libc.so.6 0000001 0x0000000000d41527 in ScribusDoc::itemSelection_DeleteItem (this=0x33fdfe0, customSelection=0x7fffffffbd80, forceDeletion=false) at /home/.../Scribus/scribus/scribusdoc.cpp:11663 0000002 0x0000000000c2e535 in ScPage::restorePageItemCreation (this=0x34232b0, state=0x280cf40, isUndo=true) at /home/.../Scribus/scribus/scpage.cpp:340 0000003 0x0000000000c2c642 in ScPage::restore (this=0x34232b0, state=0x280cf40, isUndo=true) at /home/.../Scribus/scribus/scpage.cpp:209 0000004 0x0000000000de1578 in UndoState::undo (this=0x280cf40) at /home/.../Scribus/scribus/undostate.cpp:73 0000005 0x0000000000dd242a in TransactionState::undo (this=0x324d200) at /home/.../Scribus/scribus/undomanager.cpp:808 0000006 0x0000000000dd242a in TransactionState::undo (this=0x2d1abe0) at /home/.../Scribus/scribus/undomanager.cpp:808 0000007 0x0000000000dd242a in TransactionState::undo (this=0x2f6c960) at /home/.../Scribus/scribus/undomanager.cpp:808 0000008 0x0000000000de06b3 in UndoStack::undo (this=0x34f7390, steps=1, objectId=-1) at /home/.../Scribus/scribus/undostack.cpp:80 0000009 0x0000000000dd0df9 in UndoManager::undo (this=0x1ef0cd0, steps=1) at /home/.../Scribus/scribus/undomanager.cpp:553 0000010 0x00000000007963e2 in UndoManager::qt_static_metacall (_o=0x1ef0cd0, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7fffffffc330) at /home/.../Scribus/build/scribus/moc_undomanager.cpp:143 0000011 0x00007ffff769d6b1 in QMetaObject::activate(QObject*, int, int, void**) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Core.so.5 0000012 0x000000000078b31c in ScrAction::triggeredData (this=0x1d29cc0, _t1=1) at /home/.../Scribus/build/scribus/moc_scraction.cpp:229 0000013 0x0000000000c69328 in ScrAction::triggeredToTriggeredData (this=0x1d29cc0) at /home/.../Scribus/scribus/scraction.cpp:178 0000014 0x000000000078aef1 in ScrAction::qt_static_metacall (_o=0x1d29cc0, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=0x7fffffffc5a0) at /home/.../Scribus/build/scribus/moc_scraction.cpp:114 0000015 0x00007ffff769d6b1 in QMetaObject::activate(QObject*, int, int, void**) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Core.so.5 0000016 0x00007ffff6ce0e92 in QAction::triggered(bool) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000017 0x00007ffff6ce2cc7 in QAction::activate(QAction::ActionEvent) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000018 0x00007ffff6dec125 in ?? () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000019 0x00007ffff6dec3e4 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000020 0x00007ffff6eae9fa in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000021 0x00007ffff6d24077 in QWidget::event(QEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000022 0x00007ffff6eaf890 in QToolButton::event(QEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000023 0x00007ffff6cec0f4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000024 0x00007ffff6cef4d6 in QApplication::notify(QObject*, QEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000025 0x00007ffff7674734 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Core.so.5 0000026 0x00007ffff6cee54a in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000027 0x00007ffff6d43b65 in ?? () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000028 0x00007ffff6d45f98 in ?? () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000029 0x00007ffff6cec0f4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000030 0x00007ffff6cef6ae in QApplication::notify(QObject*, QEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Widgets.so.5 0000031 0x00007ffff7674734 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Core.so.5 0000032 0x00007ffff6608c21 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Gui.so.5 0000033 0x00007ffff66094a5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Gui.so.5 0000034 0x00007ffff65f0ba8 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Gui.so.5 0000035 0x00007fffe58231b0 in ?? () from /home/.../Qt/5.2.1/gcc_64/plugins/platforms/libqxcb.so 0000036 0x00007fffed058316 in g_main_dispatch (context=0x7fffe0001740) at gmain.c:3066 0000037 g_main_context_dispatch (context=context@entry=0x7fffe0001740) at gmain.c:3642 0000038 0x00007fffed058668 in g_main_context_iterate (context=context@entry=0x7fffe0001740, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3713 0000039 0x00007fffed05870c in g_main_context_iteration (context=0x7fffe0001740, may_block=1) at gmain.c:3774 0000040 0x00007ffff76c5374 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Core.so.5 0000041 0x00007ffff76734ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Core.so.5 0000042 0x00007ffff767753e in QCoreApplication::exec() () from /home/.../Qt/5.2.1/gcc_64/lib/libQt5Core.so.5 0000043 0x0000000001230778 in mainApp (argc=1, argv=0x7fffffffdd78) at /home/.../Scribus/scribus/main_nix.cpp:86 0000044 0x0000000001230708 in main (argc=1, argv=0x7fffffffdd78) at /home/.../Scribus/scribus/main_nix.cpp:54 | ||||
| Tags | #please_test | ||||
| Attached Files | |||||
| Patch | No | ||||
| related to | 0012155 | confirmed | Undo is not able to manage a group of shapes imported from SVG | |
| related to | 0012374 | confirmed | Undo/Redo crashes Scribus editing a Barcode | |
| has duplicate | 0009591 | closed | Imported vector with "Undo" lead to all pages blank | |
| has duplicate | 0006993 | closed | Kunda | undo doesn't just undo, but changes contents in text and svg drawings |
| related to | 0013281 | confirmed | Undo/Redo of imported items (Barcode/PDF) casues Scribus crash on document closing | |
| child of | 0012500 | acknowledged | Metabug: Undo/Redo (1.5.x.svn) |
|
|
This issue is probably related to gradients present in SVG files. I uploaded another file with the same issue. |
|
|
The issue is always reproducible if the imported SVG has 2+ shapes. Gradient colors are not the problem... Generic steps: 1) Create a SVG that contains 2+ shapes 2) Import the SVG in Scribus 3) Undo 4) Redo (The SVG file is duplicated?) Move the shapes: very strange behavior of Canvas. |
|
|
To crash the file drawing2.svg follow those steps: 0) Create a new document 1) Import the SVG (drawing2.svg) 2) Ungroup the SVG 3) Undo 2 times Scribus crashes due Signal 11 |
|
|
Very likely related to 0012374. |
|
|
Reproduced on 10.8.5 1.5svn r19309 |
|
|
It should be the same with .eps and .pdf |
|
|
re=categorized as Undo/Redo |
|
|
Changing severity. Block is for release blockers. |
|
|
#Cause: interactive import emitted `CREATE_ITEM` states while the object hierarchy was still being built, including states for items that later became group children. #Failure mode: Redo could append those children back to `DocItems` while they were still owned by a group, corrupting hierarchy/selection state and leading to duplicate-looking objects, invalid moves and crashes. #Fix: wrap hierarchy construction/initial placement in `UndoBlocker`, then emit `CREATE_ITEM` only for the final top-level imported items. #Why here: fixes undo-state creation at the import boundary where final ownership is known, instead of complicating generic `restorePageItemCreation()` or group deletion logic. #Scope: generic interactive grouped-vector import path; not SVG-specific. svg-import-group-undo-redo-r27798-v1.0.patch (2,421 bytes)
Index: scribus/canvasmode_objimport.cpp
===================================================================
--- scribus/canvasmode_objimport.cpp (revision 27798)
+++ scribus/canvasmode_objimport.cpp (working copy)
@@ -168,27 +168,51 @@
m->accept();
if ((m->button() == Qt::LeftButton) && m_mimeData)
{
+ UndoManager* undoManager = UndoManager::instance();
UndoTransaction undoTransaction;
if (m_trSettings && UndoManager::undoEnabled())
{
- undoTransaction = UndoManager::instance()->beginTransaction(*m_trSettings);
+ undoTransaction = undoManager->beginTransaction(*m_trSettings);
}
+
// Creating QDragEnterEvent outside of Qt is not recommended per docs :S
QPointF dropPos = m_view->widget()->mapFromGlobal(m->globalPosition());
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
QDropEvent dropEvent(dropPos, Qt::CopyAction|Qt::MoveAction, m_mimeData, m->buttons(), m->modifiers());
- m_view->contentsDropEvent(&dropEvent);
- if (m_doc->m_Selection->count() > 0)
+ auto dropAndPosition = [&]()
{
- double gx, gy, gh, gw;
- m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
- m_doc->moveGroup(mousePointDoc.x() - gx, mousePointDoc.y() -gy);
- }
- // Commit undo transaction if necessary
+ m_view->contentsDropEvent(&dropEvent);
+ if (m_doc->m_Selection->count() > 0)
+ {
+ double gx, gy, gh, gw;
+ m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+ m_doc->moveGroup(mousePointDoc.x() - gx, mousePointDoc.y() - gy);
+ }
+ };
+
if (undoTransaction)
{
+ const qsizetype oldDocItemCount = m_doc->Items->count();
+ {
+ // Imported groups are assembled after their children are created. Do not
+ // record CREATE_ITEM states until the final top-level hierarchy exists.
+ UndoBlocker undoBlocker;
+ dropAndPosition();
+ }
+
+ for (qsizetype i = oldDocItemCount; i < m_doc->Items->count(); ++i)
+ {
+ PageItem* newItem = m_doc->Items->at(i);
+ auto *is = new ScItemState<PageItem*>("Create PageItem");
+ is->set("CREATE_ITEM");
+ is->setItem(newItem);
+ const int pageIndex = (newItem->OwnPage > -1) ? newItem->OwnPage : 0;
+ undoManager->action(m_doc->Pages->at(pageIndex), is);
+ }
undoTransaction.commit();
}
+ else
+ dropAndPosition();
// Return to normal mode
m_view->requestMode(modeNormal);
}
|
|
|
Here is the new crash bt for reference. bt-svg-new.txt (1,989 bytes)
(gdb) bt
#0 QObject::~QObject (this=0x65e4a70) at /usr/include/c++/16/bits/atomic_base.h:516
#1 0x00007ffff43804d5 in QObject::~QObject (this=0x65e4a70)
at /usr/src/debug/qt6-qtbase-6.11.1-1.fc44.x86_64/src/corelib/kernel/qobject.cpp:1186
#2 0x00000000011c67eb in ScribusDoc::~ScribusDoc (this=0x5a9a610)
at /home/buttar/x/1_src/scribus/scribusdoc.cpp:598
#3 0x00000000011c730e in ScribusDoc::~ScribusDoc (this=0x5a9a610)
at /home/buttar/x/1_src/scribus/scribusdoc.cpp:638
#4 0x00000000011677f0 in ScribusMainWindow::DoFileClose (this=0x2132790)
at /home/buttar/x/1_src/scribus/scribus.cpp:4269
#5 0x00000000012c8b88 in ScribusWin::closeEvent (this=0x32ff760, ce=0x7fffffffc9c0)
at /home/buttar/x/1_src/scribus/scribuswin.cpp:85
#6 0x00007ffff56b0778 in QWidget::event (this=0x32ff760, event=0x7fffffffc9c0)
at /usr/src/debug/qt6-qtbase-6.11.1-1.fc44.x86_64/src/widgets/kernel/qwidget.cpp:9408
#7 0x00007ffff563f92e in QApplicationPrivate::notify_helper
(this=<optimized out>, receiver=0x32ff760, e=0x7fffffffc9c0)
at /usr/src/debug/qt6-qtbase-6.11.1-1.fc44.x86_64/src/widgets/kernel/qapplication.cpp:3276
#8 0x00007ffff430f7b8 in QCoreApplication::notifyInternal2 (receiver=0x32ff760, event=0x7fffffffc9c0)
at /usr/src/debug/qt6-qtbase-6.11.1-1.fc44.x86_64/src/corelib/kernel/qcoreapplication.cpp:1114
#9 0x00007ffff430f7fd in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>)
at /usr/src/debug/qt6-qtbase-6.11.1-1.fc44.x86_64/src/corelib/kernel/qcoreapplication.cpp:1559
#10 0x00007ffff56aa271 in QWidgetPrivate::handleClose
(this=0x59166e0, mode=mode@entry=QWidgetPrivate::CloseWithEvent)
at /usr/src/debug/qt6-qtbase-6.11.1-1.fc44.x86_64/src/widgets/kernel/qwidget.cpp:8625
#11 0x00007ffff56aa4e8 in QWidgetPrivate::close (this=<optimized out>)
at /usr/src/debug/qt6-qtbase-6.11.1-1.fc44.x86_64/src/widgets/kernel/qwidget.cpp:8689
#12 0x00007ffff56aad3d in QWidget::close (this=<optimized out>)
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2014-04-04 14:52 | FirasH | New Issue | |
| 2014-04-04 14:52 | FirasH | File Added: drawing.svg | |
| 2014-04-11 14:22 | FirasH | Note Added: 0031675 | |
| 2014-04-11 14:22 | FirasH | File Added: drawing2.svg | |
| 2014-04-11 16:47 | FirasH | Note Added: 0031676 | |
| 2014-04-11 16:47 | FirasH | Note Edited: 0031676 | |
| 2014-06-15 13:49 | FirasH | Note Added: 0032178 | |
| 2014-06-15 15:12 | FirasH | Note Added: 0032183 | |
| 2014-07-03 15:11 | Kunda | Note Added: 0032440 | |
| 2014-07-03 15:11 | Kunda | Status | new => confirmed |
| 2014-07-03 15:11 | Kunda | Target Version | => 1.5.0 |
| 2014-07-07 21:44 | FirasH | Note Added: 0032563 | |
| 2014-07-07 21:46 | FirasH | Relationship added | related to 0012155 |
| 2014-07-09 01:24 | FirasH | Relationship added | child of 0012500 |
| 2014-07-17 14:01 | Kunda | Relationship added | related to 0012374 |
| 2014-09-11 02:47 | Kunda | Severity | crash => block |
| 2015-04-07 21:43 | Kunda | Patch | => No |
| 2015-04-07 21:43 | Kunda | Note Added: 0034845 | |
| 2015-04-07 21:43 | Kunda | Category | Import / Export => Undo/Redo |
| 2015-05-19 20:56 | cbradney | Target Version | 1.5.0 => 1.5.1 |
| 2015-08-08 23:43 | FirasH | Relationship added | related to 0013281 |
| 2015-11-22 17:11 | FirasH | Summary | Redo is not able to restore correctly an imported SVG removed with Undo => Redo is not able to restore correctly an imported SVG/PDF/EPS removed with Undo |
| 2015-11-22 17:11 | FirasH | Description Updated | |
| 2016-01-23 13:02 | Kunda | Relationship added | related to 0009591 |
| 2016-01-23 17:16 | cbradney | Target Version | 1.5.1 => 1.5.3 |
| 2016-02-14 17:35 | Kunda | Relationship added | has duplicate 0006993 |
| 2016-12-08 21:30 | Kunda | Target Version | 1.5.3 => 1.5.5 |
| 2016-12-12 12:03 | Kunda | Relationship replaced | has duplicate 0009591 |
| 2016-12-29 23:41 |
|
Severity | block => crash |
| 2016-12-29 23:41 |
|
Note Added: 0043259 | |
| 2026-08-31 04:26 | qirat | Note Added: 0054383 | |
| 2026-08-31 04:26 | qirat | File Added: svg-import-group-undo-redo-r27798-v1.0.patch | |
| 2026-08-31 04:26 | qirat | File Added: video-clip-of-issue-reproduce.tar.xz | |
| 2026-08-31 04:27 | qirat | Note Added: 0054384 | |
| 2026-08-31 04:27 | qirat | File Added: bt-svg-new.txt | |
| 2026-08-31 04:29 | qirat | Tag Attached: #please_test |