View Issue Details

IDProjectCategoryView StatusLast Update
0015029ScribusInternalpublic2017-12-20 20:58
Reporteru ltd. Assigned Tojghali  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSalike debianOS Version9
Product Version1.5.3 
Target VersionFixed in Version1.5.4.svn 
Summary0015029: Crash caused by uninitialized variables
DescriptionThis error occurs when executing Scribus after having changed the code in a wrong way. (What happens if you are modifying a functionality -> Nasty development obstacle)

Instead the error occurs, scribus crashes when deinitializing a not-initialized object because the main initaliziation didn't work. (But you actually would expect the main initalization error as main reason.)
Additional Informationdiff -C 5 old/scribus-1.5.3/scribus/scribus.cpp bug-submission/scribus/scribus.cpp
*** old/scribus-1.5.3/scribus/scribus.cpp 2017-05-28 11:10:25.000000000 +0200
--- bug-submission/scribus/scribus.cpp 2017-10-25 23:34:21.000000000 +0200
***************
*** 307,316 ****
--- 307,318 ----
  #ifdef Q_OS_MAC
        //commenting this out until this is resolved :https://bugreports.qt.io/browse/QTBUG-44565
        //ScQApp->setAttribute(Qt::AA_DontShowIconsInMenus);
        //noIcon = IconManager::instance()->loadPixmap("noicon.png");
  #endif
+ m_doc = 0;
+ m_tocGenerator = 0;
  }
  
  /*
   * retval 0 - ok, 1 - no fonts, ...
   */
***************
*** 474,485 ****
  {
        if (actionManager)
                delete actionManager;
        if (appModeHelper)
                delete appModeHelper;
! delete m_doc;
! delete m_tocGenerator;
  }
  
  void ScribusMainWindow::addScToolBar(ScToolBar *tb, QString name)
  {
        if (!scrToolBars.contains(name))
--- 476,490 ----
  {
        if (actionManager)
                delete actionManager;
        if (appModeHelper)
                delete appModeHelper;
!
! if (m_doc)
! delete m_doc;
! if (m_tocGenerator)
! delete m_tocGenerator;
  }
  
  void ScribusMainWindow::addScToolBar(ScToolBar *tb, QString name)
  {
        if (!scrToolBars.contains(name))
Tagscrash
PatchYes

Activities

u ltd.

2017-10-25 21:51

reporter   ~0044586

Patch with better formatting

scribus.cpp.patch (1,146 bytes)
*** old/scribus-1.5.3/scribus/scribus.cpp	2017-05-28 11:10:25.000000000 +0200
--- bug-submission/scribus/scribus.cpp	2017-10-25 23:34:21.000000000 +0200
***************
*** 307,316 ****
--- 307,318 ----
  #ifdef Q_OS_MAC
  	//commenting this out until this is resolved :https://bugreports.qt.io/browse/QTBUG-44565
  	//ScQApp->setAttribute(Qt::AA_DontShowIconsInMenus);
  	//noIcon = IconManager::instance()->loadPixmap("noicon.png");
  #endif
+ 	m_doc = 0;
+ 	m_tocGenerator = 0;
  }
  
  /*
   * retval 0 - ok, 1 - no fonts, ...
   */
***************
*** 474,485 ****
  {
  	if (actionManager)
  		delete actionManager;
  	if (appModeHelper)
  		delete appModeHelper;
! 	delete m_doc;
! 	delete m_tocGenerator;
  }
  
  void ScribusMainWindow::addScToolBar(ScToolBar *tb, QString name)
  {
  	if (!scrToolBars.contains(name))
--- 476,490 ----
  {
  	if (actionManager)
  		delete actionManager;
  	if (appModeHelper)
  		delete appModeHelper;
! 	
! 	if (m_doc)
! 		delete m_doc;
! 	if (m_tocGenerator)
! 		delete m_tocGenerator;
  }
  
  void ScribusMainWindow::addScToolBar(ScToolBar *tb, QString name)
  {
  	if (!scrToolBars.contains(name))
scribus.cpp.patch (1,146 bytes)

jghali

2017-10-26 17:21

administrator   ~0044595

Applied, thanks!

Issue History

Date Modified Username Field Change
2017-10-25 21:49 u ltd. New Issue
2017-10-25 21:49 u ltd. Tag Attached: crash
2017-10-25 21:51 u ltd. File Added: scribus.cpp.patch
2017-10-25 21:51 u ltd. Note Added: 0044586
2017-10-26 17:20 jghali Summary Crash for the wrong reason => Crash caused by uninitialized variables
2017-10-26 17:21 jghali Assigned To => jghali
2017-10-26 17:21 jghali Status new => resolved
2017-10-26 17:21 jghali Resolution open => fixed
2017-10-26 17:21 jghali Fixed in Version => 1.5.4.svn
2017-10-26 17:21 jghali Note Added: 0044595
2017-12-20 20:58 cbradney Status resolved => closed