View Issue Details

IDProjectCategoryView StatusLast Update
0012551ScribusStory Editor / Text Framespublic2015-10-27 16:01
ReporterFirasH Assigned Tojghali  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Platformx86_64OSFreeBSDOS Version10.0.2
Product Version1.5.0svn 
Target Version1.5.1Fixed in Version1.5.1svn 
Summary0012551: Delete Reference to Item crashes Scribus
DescriptionDelete Reference to Item crashes Scribus.
Steps To Reproduce0) Create a new document
1) Insert a Text Frame
2) Double-click on the Text Frame to edit its content
3) Go to: Insert > Marks > Reference to Item > add one
4) Delete the Mark "1" from the Text Frame with backspace
5) Open: Edit > Marks...
6) Select the mark entry and click Delete

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


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 815406400 (LWP 100489/scribus)]
0x0000000000e8ccbb in ScribusDoc::setUndoDelMark (this=0x82485c000,
    mrk=0x8248fb420)
    at /usr/home/.../Scribus/scribus/scribusdoc.cpp:17720
17720 if (master->isNoteFrame())
(gdb) bt
#0 0x0000000000e8ccbb in ScribusDoc::setUndoDelMark (this=0x82485c000,
    mrk=0x8248fb420)
    at /usr/home/.../Scribus/scribus/scribusdoc.cpp:17720
0000001 0x000000000111d719 in MarksManager::on_DeleteButton_clicked (
    this=0x82473f7a0)
    at /usr/home/.../Scribus/scribus/ui/marksmanager.cpp:219
0000002 0x000000000075bf6b in MarksManager::qt_static_metacall (_o=0x82473f7a0,
    _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x7fffffffc4b0)
    at /usr/home/.../Scribus/build/scribus/ui/moc_marksmanager.cpp:102
0000003 0x000000000075c19e in MarksManager::qt_metacall (this=0x82473f7a0,
    _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x7fffffffc4b0)
    at /usr/home/.../Scribus/build/scribus/ui/moc_marksmanager.cpp:138
0000004 0x00000008024a1597 in QMetaObject::activate ()
   from /usr/local/lib/libQt5Core.so.5
0000005 0x0000000802d2a251 in QAbstractButton::clicked ()
   from /usr/local/lib/libQt5Widgets.so.5
0000006 0x0000000802ac6fef in QAbstractButton::isCheckable ()
   from /usr/local/lib/libQt5Widgets.so.5
0000007 0x0000000802ac6e57 in QAbstractButton::isCheckable ()
   from /usr/local/lib/libQt5Widgets.so.5
0000008 0x0000000802ac7e50 in QAbstractButton::mouseReleaseEvent ()
   from /usr/local/lib/libQt5Widgets.so.5
0000009 0x0000000802a36281 in QWidget::event ()
   from /usr/local/lib/libQt5Widgets.so.5
0000010 0x0000000802ac7bb3 in QAbstractButton::event ()
   from /usr/local/lib/libQt5Widgets.so.5
0000011 0x0000000802b533da in QPushButton::event ()
   from /usr/local/lib/libQt5Widgets.so.5
0000012 0x0000000802a001a7 in QApplicationPrivate::notify_helper ()
   from /usr/local/lib/libQt5Widgets.so.5
0000013 0x0000000802a03018 in QApplication::notify ()
   from /usr/local/lib/libQt5Widgets.so.5
0000014 0x0000000802471ac2 in QCoreApplication::notifyInternal ()
   from /usr/local/lib/libQt5Core.so.5
0000015 0x0000000802a00b45 in QApplicationPrivate::sendMouseEvent ()
   from /usr/local/lib/libQt5Widgets.so.5
0000016 0x0000000802a52aca in QWidgetPrivate::setModal_sys ()
   from /usr/local/lib/libQt5Widgets.so.5
0000017 0x0000000802a51dff in QWidgetPrivate::setModal_sys ()
   from /usr/local/lib/libQt5Widgets.so.5
0000018 0x0000000802a001a7 in QApplicationPrivate::notify_helper ()
   from /usr/local/lib/libQt5Widgets.so.5
0000019 0x0000000802a02c0c in QApplication::notify ()
   from /usr/local/lib/libQt5Widgets.so.5
0000020 0x0000000802471ac2 in QCoreApplication::notifyInternal ()
   from /usr/local/lib/libQt5Core.so.5
0000021 0x00000008031518f7 in QGuiApplicationPrivate::processMouseEvent ()
   from /usr/local/lib/libQt5Gui.so.5
0000022 0x0000000803150c41 in QGuiApplicationPrivate::processWindowSystemEvent ()
   from /usr/local/lib/libQt5Gui.so.5
0000023 0x0000000803141b58 in QWindowSystemInterface::sendWindowSystemEvents ()
   from /usr/local/lib/libQt5Gui.so.5
0000024 0x0000000814d6e6f0 in qt_plugin_instance ()
   from /usr/local/lib/qt5/plugins/platforms/libqxcb.so
0000025 0x000000080bec4142 in g_main_context_dispatch ()
   from /usr/local/lib/libglib-2.0.so.0
0000026 0x000000080bec4497 in g_main_context_pending ()
   from /usr/local/lib/libglib-2.0.so.0
0000027 0x000000080bec4524 in g_main_context_iteration ()
   from /usr/local/lib/libglib-2.0.so.0
0000028 0x00000008024bfe58 in QEventDispatcherGlib::processEvents ()
   from /usr/local/lib/libQt5Core.so.5
0000029 0x0000000814d6e69c in qt_plugin_instance ()
   from /usr/local/lib/qt5/plugins/platforms/libqxcb.so
0000030 0x000000080246f45e in QEventLoop::exec ()
   from /usr/local/lib/libQt5Core.so.5
0000031 0x0000000802472072 in QCoreApplication::exec ()
   from /usr/local/lib/libQt5Core.so.5
0000032 0x00000000014c35db in mainApp (argc=1, argv=0x7fffffffd6b8)
    at main_nix.cpp:86
0000033 0x00000000014c3522 in main (argc=1, argv=0x7fffffffd6b8)
    at main_nix.cpp:54
TagsHOST-Oman, patch_tested_ok
PatchYes

Relationships

has duplicate 0011683 closedjghali Crash due to wrong management of Reference to Item Marks 
related to 0012125 closedcbradney Foot/Endnote mark delete == Crash 
child of 0012496 acknowledged Metabug: Marks & Footnotes & Weld (1.5.0.svn) 

Activities

Kunda

2014-07-23 18:48

manager   ~0032928

Confirmed signal 11 crash on OSX 10.8.5 1.5.0svn r19357 (Qt5.3.1)

anood

2015-10-20 11:05

reporter   ~0036727

I'll try to fix it :)

watfa albadi

2015-10-20 11:37

reporter   ~0036728

I hope so to solve it)*_*(

anood

2015-10-21 10:29

reporter   ~0036773

I fixed it ,
I call m_Doc->scMW()->marksManager->updateListView();
in this function
removeMarksFromText(bool doUndo);

Kunda

2015-10-21 12:53

manager   ~0036776

anood,
Thanks for the patch. I tried to apply it but I got an error:
==> Patching
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: pageitem_textframe.cpp
|===================================================================
|--- pageitem_textframe.cpp	(revision 20473)
|+++ pageitem_textframe.cpp	(working copy)
--------------------------
No file to patch.  Skipping patch.
patch unexpectedly ends in middle of line
2 out of 2 hunks ignored
patch unexpectedly ends in middle of line
Error: Failure while executing: /usr/bin/patch -g 0 -f -p1

anood

2015-10-21 14:57

reporter  

issue12551.patch (659 bytes)
Index: pageitem_textframe.cpp
===================================================================
--- pageitem_textframe.cpp	(revision 20473)
+++ pageitem_textframe.cpp	(working copy)
@@ -56,6 +56,7 @@
 #include "scribusstructs.h"
 #include "selection.h"
 #include "ui/guidemanager.h"
+#include "ui/marksmanager.h"
 #include "undomanager.h"
 #include "undostate.h"
 #include "util.h"
@@ -6046,6 +6047,9 @@
 			if (doUndo)
 				m_Doc->setUndoDelMark(mrk);
 			m_Doc->eraseMark(mrk, true, this);
+			m_Doc->changed();
+			m_Doc->regionsChanged()->update(QRectF());
+			m_Doc->scMW()->marksManager->updateListView();
 			++num;
 		}
 		mrk = selectedMark(true);
issue12551.patch (659 bytes)

anood

2015-10-21 14:58

reporter   ~0036780

thanks for your replay , could you please try again ? I upload another patch file

Kunda

2015-10-21 15:44

manager   ~0036781

anood, the format of the patch is different.
See 0013198
Can you generate patches that way?

anood

2015-10-21 16:07

reporter   ~0036782

how I can generate it like that? using linux command line?!
I followed this link in the previous patch http://wiki.scribus.net/canvas/How_to_apply_a_patch_to_scribus_sourcecode

user5122

2015-10-21 16:28

  ~0036787

The patch seems to have been created by calling `svn diff` inside the `scribus/`, so I think applying it there should just work. Or Anood can create a new patch from the root o the svn checkout.

Kunda

2015-10-21 16:39

manager   ~0036789

Khaled Hosny, Thanks.
For better organization would you tell the students to clearly state the:
1) OS,
2) OS version,
3) Scribus version,
4) Scribus revision (using the cmake flag: -DWANT_SVNVERSION=1 if they are building from source)
5) at seldom they can also state the Qt5 version
they used when commenting on bugs that they're testing.

Also they need to be using up to date components and libraries: Qt5 (Qt5.5.1), Ghostscript 1.16 etc...

user5122

2015-10-21 16:47

  ~0036791

They are always building from up to date trunk, on Ubuntu 14.04.

user5122

2015-10-21 16:50

  ~0036792

(Not that I see how the OS version or libraries used would be relevant here, since this issues and the others we checked are not affected by any of this. But you can always ask the patch submitter for more information if you think some relevant information is missing.)

JLuc

2015-10-21 18:12

developer   ~0036795

I managed to apply the patch :
- i had to go down scribus/ folder instead of usual svn/ folder
- i had to specify -p0 instead of usual -p1

Please ensure your patches can be applied in svn/ folder using -p1 parameter.

And to be sure that the core devs will test this patch, can you provide it so can be applied in svn/ folder using -p1 parameter ? Thanks in advance.

JLuc

2015-10-21 18:13

developer   ~0036796

PS : it's great that you work on marks !

cbradney

2015-10-21 18:28

administrator   ~0036797

whatever N in -pN is, its fine. Thanks. we will review.

JLuc

2015-10-22 04:22

developer   ~0036801

I tested the patch and confirm : it fixes the issue. The marks box is empty once the mark is deleted and there is no possible crash.

Craig : Glad to know free -pN patches are ok.

Kunda

2015-10-22 04:31

manager   ~0036802

Fantastic!

anood

2015-10-22 07:43

reporter   ~0036807

I debugged this issue and it turns out that deleting mark in the text frame does not update the list view of the the marks mangers , it keep a reference to the deleted item , so it cause crash . I fixed this issue by calling

ScribusDoc::changed()
ScribusDoc::regionsChanged()->update(QRectF())
MarksManager::updateListView()
when deleting the mark from the text frame .

jghali

2015-10-22 22:18

administrator   ~0036848

Thanks anood. I applied a slightly modified version of your patch: calling m_Doc->changed() repeatedly can have a huge computational cost as it triggers update of GUI. So I test the "num" variable to call it only once at the end of the function.

anood

2015-10-23 07:28

reporter   ~0036851

very good . Thanks Jghali

Kunda

2015-10-23 17:32

manager   ~0036866

Fantastic! Thanks for the patch anood.
Tested and Fixed in r20488
Patch by anood revised by jghali.
Cheers

Issue History

Date Modified Username Field Change
2014-07-23 04:51 FirasH New Issue
2014-07-23 04:52 FirasH Relationship added child of 0012496
2014-07-23 18:48 Kunda Note Added: 0032928
2014-07-23 18:48 Kunda Status new => confirmed
2014-07-23 18:48 Kunda Target Version => 1.5.0
2014-09-11 02:34 Kunda Severity crash => block
2014-11-06 13:54 Kunda Sticky Issue No => Yes
2015-05-19 20:56 cbradney Target Version 1.5.0 => 1.5.1
2015-09-17 20:08 Kunda Category Story Editor / Text Frames => Story Ed/Txt Frames
2015-09-17 20:12 Kunda Category Story Ed/Txt Frames => Story Editor / Text Frames
2015-10-20 11:05 anood Note Added: 0036727
2015-10-20 11:37 watfa albadi Note Added: 0036728
2015-10-21 10:27 anood File Added: issue12551.patch
2015-10-21 10:29 anood Note Added: 0036773
2015-10-21 12:53 Kunda Note Added: 0036776
2015-10-21 14:56 anood File Deleted: issue12551.patch
2015-10-21 14:57 anood File Added: issue12551.patch
2015-10-21 14:58 anood Note Added: 0036780
2015-10-21 15:44 Kunda Note Added: 0036781
2015-10-21 16:07 anood Note Added: 0036782
2015-10-21 16:28 user5122 Note Added: 0036787
2015-10-21 16:39 Kunda Note Added: 0036789
2015-10-21 16:47 user5122 Note Added: 0036791
2015-10-21 16:50 user5122 Note Added: 0036792
2015-10-21 18:12 JLuc Note Added: 0036795
2015-10-21 18:13 JLuc Note Added: 0036796
2015-10-21 18:28 cbradney Note Added: 0036797
2015-10-22 04:22 JLuc Note Added: 0036801
2015-10-22 04:31 Kunda Note Added: 0036802
2015-10-22 07:43 anood Note Added: 0036807
2015-10-22 16:02 JLuc Relationship added has duplicate 0011683
2015-10-22 16:22 JLuc Tag Attached: patch_tested_ok
2015-10-22 16:22 JLuc Patch => Yes
2015-10-22 22:18 jghali Note Added: 0036848
2015-10-22 22:18 jghali Status confirmed => resolved
2015-10-22 22:18 jghali Fixed in Version => 1.5.1svn
2015-10-22 22:18 jghali Resolution open => fixed
2015-10-22 22:18 jghali Assigned To => jghali
2015-10-22 22:25 Kunda Sticky Issue Yes => No
2015-10-23 07:28 anood Note Added: 0036851
2015-10-23 17:32 Kunda Note Added: 0036866
2015-10-23 17:32 Kunda Status resolved => closed
2015-10-25 13:43 user5122 Tag Attached: HOST-Oman
2015-10-27 16:01 Kunda Relationship added related to 0012125