SEGFAULT in options dialog and FIX

Torsten Uhlmann TUhlmann at debis.com
Fri Jun 4 17:27:55 BST 1999


I did this to get rid of the segfault when opening the options dialog:

old code:
	QString *str = (QString*) m_set_modify_line->text();
  if (!str->isEmpty()) {
    text+=" -W";
    text+= m_set_modify_line->text();
  }

	str = (QString*) m_optional_line->text();
  if (!str->isEmpty()) {
    text+=" ";
    text+= m_optional_line->text();
  }

new code:
	QString *str = new QString;
	str->setStr(m_set_modify_line->text());
  if (!str->isEmpty()) {
    text+=" -W";
    text+= m_set_modify_line->text();
  }

	str->setStr(m_optional_line->text());
  if (!str->isEmpty()) {
    text+=" ";
    text+= m_optional_line->text();
  }

On Wed, 02 Jun 1999 you wrote:
>On Mon, 31 May 1999 you wrote:
>>Am Mon, 31 May 1999 you wrote:
>...
>>>>Another thing: when going to Project->Options, doing nothing
>>>and pressing ok, kdevelop segfaults.
>>>
>>>I´m using latest CVS version.
>>
>>Can you compile KDevelop in the debug mode (./configure --enable-debug) and send us the backtrace
>>output when KDevelop segfaults?, because I coudn't repeat your scenario.
>>
>Is this what you wanted:
>
>Program received signal SIGSEGV, Segmentation fault.
>0x81ed648 in QString::isEmpty (this=0x8414210) at /usr/local/qt/include/qstring.h:260
>(xxgdb) backtrace
>#0  0x81ed648 in QString::isEmpty (this=0x8414210) at /usr/local/qt/include/qstring.h:260
>#1  0x80ae6a5 in CPrjOptionsDlg::ok (this=0xbffff14c) at cprjoptionsdlg.cpp:1480
>#2  0x40113313 in QObject::activate_signal ()
>#3  0x401c8c90 in QTabDialog::applyButtonPressed ()
>#4  0x40113313 in QObject::activate_signal ()
>#5  0x401ccdf0 in QButton::clicked ()
>#6  0x40142e34 in QButton::mouseReleaseEvent ()
>#7  0x4012807a in QWidget::event ()
>#8  0x400ec3f0 in QApplication::notify ()
>#9  0x4019d5f3 in QETWidget::translateMouseEvent ()
>#10 0x4019b3b9 in QApplication::x11ProcessEvent ()
>#11 0x4019af07 in QApplication::processNextEvent ()
>#12 0x4019bd89 in QApplication::enter_loop ()
>#13 0x400f19be in QDialog::show ()
>#14 0x400e9b87 in QTabDialog::show ()
>#15 0x400f13d4 in QDialog::exec ()
>#16 0x8095c65 in CKDevelop::slotProjectOptions (this=0x82de710) at ckdevelop_project.cpp:392
>#17 0x40113313 in QObject::activate_signal ()
>#18 0x40176d46 in QPopupMenu::mouseReleaseEvent ()
>#19 0x4012807a in QWidget::event ()
>#20 0x400ec3f0 in QApplication::notify ()
>#21 0x4019d443 in QETWidget::translateMouseEvent ()
>#22 0x4019b3b9 in QApplication::x11ProcessEvent ()
>#23 0x4019af07 in QApplication::processNextEvent ()
>#24 0x4019bd89 in QApplication::enter_loop ()
>#25 0x4019ae85 in QApplication::exec ()
>#26 0x8072b2c in main (argc=1, argv=0xbffff834) at main.cpp:78
>
>Hope this helps!
>
>>Ciao!
>>
>>Sandy
>-- 
>
>best regards,
>Torsten Uhlmann
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>TUhlmann at gmx.de
>http://www.tuhlmann.purespace.de
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Wise men still seek him
-- 

best regards,
Torsten Uhlmann

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TUhlmann at gmx.de
http://www.tuhlmann.purespace.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wise men still seek him!




More information about the KDevelop mailing list