View Issue Details

IDProjectCategoryView StatusLast Update
0012688ScribusGeneralpublic2014-10-11 18:33
Reporterwaynedpj Assigned Tojghali  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Platformx86_64OSGNU+Linux Gentoo 
Product Version1.5.0svn 
Fixed in Version1.5.0svn 
Summary0012688: Symbol dependency calculation problem?
Descriptionuntil recently 1.5.0 SVN was working well for a not-too-complex document which uses multiple Symbols. then "all of a sudden" (no svn up, etc.) the same doc Scribus started taking longer and longer to save (would hang for 20-40 seconds before saving) and to do a PDF export (same deal, hang 20-40 seconds before starting to generate PDF). after struggling along and more editing, Scribus started freezing on saving/exporting the document every time. my guess was my use of Symbols in the doc, and in particular dependencies between Symbols (to the best of my recollection the addition of some Symbols was the last change before the problems started). the backtrace (below) seemed to confirm that.

i have attached a simple fix that i believe corrects the problem.
Additional Information    a backtrace of the hanging save is as follows:

$ gdb ./scribus/scribus-1.5.0.svn
GNU gdb (Gentoo 7.6.2 p1) 7.6.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /opt/Scribus/build/scribus/scribus-1.5.0.svn...done.
(gdb) run
Starting program: /opt/Scribus/build/./scribus/scribus-1.5.0.svn
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe4aa8700 (LWP 6743)]
[New Thread 0x7fffd9e81700 (LWP 6744)]
""
[New Thread 0x7fffd29a2700 (LWP 6745)]
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
QRegion empty
[New Thread 0x7fffc3581700 (LWP 6753)]
[New Thread 0x7fffc2d80700 (LWP 6754)]
[New Thread 0x7fffc2379700 (LWP 6755)]
[New Thread 0x7fffc1b78700 (LWP 6756)]
[New Thread 0x7fffc1377700 (LWP 6757)]
[New Thread 0x7fffc0b76700 (LWP 6758)]
[New Thread 0x7fffabfff700 (LWP 6759)]
[New Thread 0x7fffab7fe700 (LWP 6760)]
[New Thread 0x7fffaaffd700 (LWP 6761)]
[New Thread 0x7fffaa7fc700 (LWP 6762)]
[Thread 0x7fffc1377700 (LWP 6757) exited]
[Thread 0x7fffc1b78700 (LWP 6756) exited]
[Thread 0x7fffaa7fc700 (LWP 6762) exited]
[Thread 0x7fffc2379700 (LWP 6755) exited]
[Thread 0x7fffaaffd700 (LWP 6761) exited]
[Thread 0x7fffab7fe700 (LWP 6760) exited]
[Thread 0x7fffabfff700 (LWP 6759) exited]
[Thread 0x7fffc0b76700 (LWP 6758) exited]

^C
Program received signal SIGINT, Interrupt.
0x0000000000781065 in QString::QString (this=0x7ffed0281000, other=...) at /opt/Qt/5.3/gcc_64/include/QtCore/qstring.h:814
814 inline QString::QString(const QString &other) : d(other.d)
(gdb) bt full
#0 0x0000000000781065 in QString::QString (this=0x7ffed0281000, other=...) at /opt/Qt/5.3/gcc_64/include/QtCore/qstring.h:814
No locals.
0000001 0x00000000007a3e5b in QList<QString>::node_copy (this=0x7fffffff8ed0, from=0x7ffeb8004180, to=0x7ffed800e2e0, src=0x7fff30277ea0)
    at /opt/Qt/5.3/gcc_64/include/QtCore/qlist.h:413
        current = 0x7ffed0281000
0000002 0x00000000008f2485 in QList<QString>::operator+= (this=0x7fffffff8ed0, l=...) at /opt/Qt/5.3/gcc_64/include/QtCore/qlist.h:868
        n = 0x7ffeb8004180
0000003 0x0000000000d26ce1 in ScribusDoc::getPatternDependencyList (this=0x2e23a90, used=...) at /opt/Scribus/src/scribus/scribusdoc.cpp:4060
        c = 27
        results = {<QList<QString>> = {{p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7ffe97ffa010},
              d = 0x7ffe97ffa010}}, <No data fields>}
        pp = {<QList<QString>> = {{p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7fff17ffb010},
              d = 0x7fff17ffb010}}, <No data fields>}
        pats = {<QList<QString>> = {{p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x2d646e0},
              d = 0x2d646e0}}, <No data fields>}
        patternStack = {<QVector<QStringList>> = {d = 0x45b4da0}, <No data fields>}
0000004 0x0000000000a6dc57 in PDFLibCore::PDF_Begin_Doc (this=0x35eaeb0, fn=..., AllFonts=..., DocFonts=..., vi=0x2a2cf80) at /opt/Scribus/src/scribus/pdflib_core.cpp:1152
        d = {jd = 2456914}
        IDg = {static null = {<No data fields>}, d = 0x466b200}
        pgit = 0xa72b420
        ind2PDFabr = {d = 0x27a4d20}
        patterns = {<QList<QString>> = {{p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7ffe97ffa010},
              d = 0x7ffe97ffa010}}, <No data fields>}
        itStd = {i = 0x35de410}
        ar = 14
        docTitle = {static null = {<No data fields>}, d = 0x2ec21d0}
        ReallyUsed = {d = 0x2d55750}
        tmpf = {{static null = {<No data fields>}, d = 0x1d44960}, {static null = {<No data fields>}, d = 0x1b722f0}, {static null = {<No data fields>}, d = 0x2d55380}, {
            static null = {<No data fields>}, d = 0x1aa3990}, {static null = {<No data fields>}, d = 0x2d65c10}, {static null = {<No data fields>}, d = 0x35cb0b0}, {
            static null = {<No data fields>}, d = 0x35a8600}, {static null = {<No data fields>}, d = 0x2d649f0}, {static null = {<No data fields>}, d = 0x35a8420}, {
            static null = {<No data fields>}, d = 0x35a8460}, {static null = {<No data fields>}, d = 0x2d637e0}, {static null = {<No data fields>}, d = 0x2d63820}, {
            static null = {<No data fields>}, d = 0x45b4d60}, {static null = {<No data fields>}, d = 0x1aa2f70}}
        allItems = {{p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x35a8650}, d = 0x35a8650}}
        it = {i = 0xa8}
        tmp = {static null = {<No data fields>}, d = 0x35bc2e0}
        ok = {static null = {<No data fields>}, d = 0x35aca40}
        uk = {static null = {<No data fields>}, d = 0x459e120}
        fd = {d_ptr = {d = 0x1aa38c0}}
        a = 1
        dt = {d = {d = 0x45bc690}}
        fext = {static null = {<No data fields>}, d = 0x7ffff7aa2480 <QArrayData::shared_null>}
0000005 0x0000000000a65d02 in PDFLibCore::doExport (this=0x35eaeb0, fn=..., nam=..., Components=3, pageNs=std::vector of length 3, capacity 4 = {...}, thumbs=...)
    at /opt/Scribus/src/scribus/pdflib_core.cpp:217
        ret = false
        pc_exportpages = 0
        pc_exportmasterpages = 0
        usedFonts = {d = 0x45bbd80}
        pm = <incomplete type>
        error = false
0000006 0x0000000000a63746 in PDFlib::doExport (this=0x7fffffffb780, fn=..., nam=..., Components=3, pageNs=std::vector of length 3, capacity 4 = {...}, thumbs=...)
    at /opt/Scribus/src/scribus/pdflib.cpp:19
No locals.
0000007 0x0000000000cd54e3 in ScribusMainWindow::getPDFDriver (this=0x1b23e20, fn=..., nam=..., Components=3, pageNs=std::vector of length 3, capacity 4 = {...}, thumbs=...,
    error=..., cancelled=0x0) at /opt/Scribus/src/scribus/scribus.cpp:7715
        pdflib = {<QObject> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7ffff7a9bd60 <QObject::staticMetaObject>,
              stringdata = 0x130fae0 <qt_meta_stringdata_PDFlib>, data = 0x130fb00 <qt_meta_data_PDFlib>,
              static_metacall = 0x78b610 <PDFlib::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, impl = 0x35eaeb0}
        ret = false
0000008 0x0000000000cd6807 in ScribusMainWindow::doSaveAsPDF (this=0x1b23e20) at /opt/Scribus/src/scribus/scribus.cpp:7852
        pageString = {static null = {<No data fields>}, d = 0x2f5dec0}
        pageNs = std::vector of length 3, capacity 4 = {1, 2, 24}
        components = 3
        pageNumbersSize = 3
        thumbs = {d = 0x4934bf0}
        nam = {static null = {<No data fields>}, d = 0xa2310f0}
        fileName = {static null = {<No data fields>}, d = 0x35ead70}
        errorMsg = {static null = {<No data fields>}, d = 0x7ffff7aa2480 <QArrayData::shared_null>}
---Type <return> to continue, or q <return> to quit---
        ReallyUsed = {d = 0x4301820}
        optBleeds = {Top = 2.0015999999999998, Left = 2.0015999999999998, Bottom = 2.0015999999999998, Right = 2.0015999999999998}
        dia = {<QDialog> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7ffff734b7c0 <QDialog::staticMetaObject>,
              stringdata = 0x133a300 <qt_meta_stringdata_PDFExportDialog>, data = 0x133a400 <qt_meta_data_PDFExportDialog>,
              static_metacall = 0x7b5808 <PDFExportDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}},
          PDFExportLayout = 0x4302f10, NameLayout = 0x43031d0, Layout7 = 0x4882ef0, Name = 0x2e85820, multiFile = 0x431e3b0, openAfterExportCheckBox = 0x4821470,
          changeButton = 0xa370a00, okButton = 0x4883ac0, cancelButton = 0x4884100, fileNameLineEdit = 0x2e85880, Options = 0x42fa3f0, m_doc = 0x2e23a90, m_presEffects = {{p = {
                static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x4647f00}, d = 0x4647f00}}, m_opts = @0x2e24020,
          m_unitRatio = 0.013888888888888888, m_cmsDescriptor = {static null = {<No data fields>}, d = 0xa2310f0}, m_components = 3, m_printerProfiles = @0x1b337b8}
0000009 0x0000000000791d2f in ScribusMainWindow::qt_static_metacall (_o=0x1b23e20, _c=QMetaObject::InvokeMetaMethod, _id=176, _a=0x7fffffffc1b0)
    at /opt/Scribus/build/scribus/moc_scribus.cpp:1141
        _t = 0x1b23e20
0000010 0x00007ffff76887b1 in QMetaObject::activate(QObject*, int, int, void**) () from /opt/Qt/5.3/gcc_64/lib/libQt5Core.so.5
No symbol table info available.
0000011 0x00000000007a0111 in CheckDocument::ignoreAllErrors (this=0x2a40f60) at /opt/Scribus/build/scribus/ui/moc_checkDocument.cpp:252
No locals.
0000012 0x000000000079fb2e in CheckDocument::qt_static_metacall (_o=0x2a40f60, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x7fffffffc430)
    at /opt/Scribus/build/scribus/ui/moc_checkDocument.cpp:111
        _t = 0x2a40f60
0000013 0x00007ffff76887b1 in QMetaObject::activate(QObject*, int, int, void**) () from /opt/Qt/5.3/gcc_64/lib/libQt5Core.so.5
No symbol table info available.
0000014 0x00007ffff701d222 in QAbstractButton::clicked(bool) () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000015 0x00007ffff6d8b203 in ?? () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000016 0x00007ffff6d8bb1a in ?? () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000017 0x00007ffff6d8bd24 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000018 0x00007ffff6cc3c27 in QWidget::event(QEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000019 0x00007ffff6c8ba94 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000020 0x00007ffff6c8ee8c in QApplication::notify(QObject*, QEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000021 0x00007ffff7656f04 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Core.so.5
No symbol table info available.
0000022 0x00007ffff6c8dffa in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000023 0x00007ffff6ce3e87 in ?? () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000024 0x00007ffff6ce69d8 in ?? () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000025 0x00007ffff6c8ba94 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000026 0x00007ffff6c8f0b6 in QApplication::notify(QObject*, QEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5
No symbol table info available.
0000027 0x00007ffff7656f04 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Core.so.5
No symbol table info available.
0000028 0x00007ffff650a537 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Gui.so.5
No symbol table info available.
0000029 0x00007ffff650af75 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /opt/Qt/5.3/gcc_64/lib/libQt5Gui.so.5
No symbol table info available.
0000030 0x00007ffff64f0208 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/5.3/gcc_64/lib/libQt5Gui.so.5
No symbol table info available.
0000031 0x00007fffe5613460 in ?? () from /opt/Qt/5.3/gcc_64/plugins/platforms/libqxcb.so
No symbol table info available.
0000032 0x00007fffecec3664 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
0000033 0x00007fffecec3898 in ?? () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
0000034 0x00007fffecec3954 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
0000035 0x00007ffff76b1574 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/5.3/gcc_64/lib/libQt5Core.so.5
No symbol table info available.
0000036 0x00007ffff765511b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/5.3/gcc_64/lib/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---
No symbol table info available.
0000037 0x00007ffff7659fe5 in QCoreApplication::exec() () from /opt/Qt/5.3/gcc_64/lib/libQt5Core.so.5
No symbol table info available.
0000038 0x0000000001251e40 in mainApp (argc=1, argv=0x7fffffffdbb8) at /opt/Scribus/src/scribus/main_nix.cpp:86
        appRetVal = 0
        app = {<QApplication> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7ffff733e180 <QApplication::staticMetaObject>,
              stringdata = 0x131ca00 <qt_meta_stringdata_ScribusQApp>, data = 0x131ca80 <qt_meta_data_ScribusQApp>,
              static_metacall = 0x79347c <ScribusQApp::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}},
          static useGUI = true, m_ScCore = 0x1b33780, lang = {static null = {<No data fields>}, d = 0x1b084e0}, GUILang = {static null = {<No data fields>}, d = 0x1b08510},
          showSplash = false, showFontInfo = false, showProfileInfo = false, swapDialogButtonOrder = false, prefsUserFile = {static null = {<No data fields>},
            d = 0x7ffff7aa2480 <QArrayData::shared_null>}, filesToLoad = {{p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {
                    0x0}}, d = 0x7ffff7aa2d40 <QListData::shared_null>}, d = 0x7ffff7aa2d40 <QListData::shared_null>}}, fileName = {static null = {<No data fields>},
            d = 0x7ffff7aa2480 <QArrayData::shared_null>}, m_scDLMgr = 0x1b07cf0}
0000039 0x0000000001251dd0 in main (argc=1, argv=0x7fffffffdbb8) at /opt/Scribus/src/scribus/main_nix.cpp:54
No locals.
(gdb)


the message i mainly saw on the console when this freeze/hang occurred was "smallbin double linked list corrupted", though not always.

  starting from the backtrace and investigating the code, i found what could be a bug in the logic of "QStringList ScribusDoc::getPatternDependencyList(QStringList used)" in scribusdoc.cpp. in particular, the lines 4058-4060

pp = getUsedPatternsHelper(pats[c], results);
if (!pp.isEmpty())
    results += pp;

lines 4059-4060 seem unnecessary and could be causing this bug/infinite loop (and thus memory exhaustion?) since results and pp are both pointing at the same object: QStringList ScribusDoc::getUsedPatternsHelper(QString pattern, QStringList &results) places the used patterns in results and also returns results, which is what pp now points at. thus, the "results += pp" seems unnecessary and could be the cause of an infinite loop.

  removing lines 4059-4060 seems to correct the problem for me and i have provided the ultra simple patch that implements the potential fix. while my testing seems to indicate that this fix has no undesired side effects, is there is a test suite/etc. which we can run to make sure this change does not break something else?

  thanks for Scribus, great app.
TagsNo tags attached.
Patch

Activities

waynedpj

2014-09-13 19:11

reporter  

pattern_deps_fix.diff (402 bytes)   
Index: src/scribus/scribusdoc.cpp
===================================================================
--- src/scribus/scribusdoc.cpp	(revision 19502)
+++ src/scribus/scribusdoc.cpp	(working copy)
@@ -4056,8 +4056,6 @@
 		for (int c = 0; c < pats.count(); ++c)
 		{
 			pp = getUsedPatternsHelper(pats[c], results);
-			if (!pp.isEmpty())
-				results += pp;
 		}
 		pats = results;
 		results.clear();
pattern_deps_fix.diff (402 bytes)   

jghali

2014-09-13 20:56

administrator   ~0033677

I've committed your fix. It seems indeed the correct one. Thanks!

Kunda

2014-09-20 14:46

updater   ~0033783

waynedpj, please confirm fix, thx!

waynedpj

2014-09-20 20:07

reporter   ~0033784

yes, the fix is indeed still working with SVN rev. 19516.

thanks for following up.

Issue History

Date Modified Username Field Change
2014-09-13 19:11 waynedpj New Issue
2014-09-13 19:11 waynedpj File Added: pattern_deps_fix.diff
2014-09-13 19:12 waynedpj Tag Attached: dependency
2014-09-13 19:12 waynedpj Tag Attached: patterns
2014-09-13 19:12 waynedpj Tag Attached: symbols
2014-09-13 19:12 waynedpj Tag Detached: patterns
2014-09-13 19:13 waynedpj Tag Detached: symbols
2014-09-13 19:13 waynedpj Tag Attached: pattern
2014-09-13 19:13 waynedpj Tag Attached: symbol
2014-09-13 20:56 jghali Note Added: 0033677
2014-09-13 20:56 jghali Status new => resolved
2014-09-13 20:56 jghali Fixed in Version => 1.5.0svn
2014-09-13 20:56 jghali Resolution open => fixed
2014-09-13 20:56 jghali Assigned To => jghali
2014-09-20 14:46 Kunda Note Added: 0033783
2014-09-20 20:07 waynedpj Note Added: 0033784
2014-09-22 18:47 cbradney Status resolved => closed
2014-10-11 15:37 Kunda Tag Renamed symbol => symbols
2014-10-11 18:33 Kunda Tag Detached: pattern
2014-10-11 18:33 Kunda Tag Detached: symbols
2014-10-11 18:33 Kunda Tag Detached: dependency