Qcas Segmentation fault

Interface QT

Modérateur : xcasadmin

sagitter
Messages : 31
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Qcas Segmentation fault

Message par sagitter » jeu. nov. 30, 2017 2:25 pm

Hi all.

Qcas-0.4.9 does not work on Fedora 27 with giac-1.2.3.57:

Code : Tout sélectionner

$ qcas
Segmentation fault (core dumped)
This is the GDB output:

Code : Tout sélectionner

$ gdb qcas
GNU gdb (GDB) Fedora 8.0.1-30.fc27
This GDB was configured as "x86_64-redhat-linux-gnu".
(gdb) thread apply all bt full
(gdb) run
Starting program: /usr/bin/qcas 
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.26-16.fc27.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
giac::gen::operator= (this=0x5555559c74b0, a=...) at /usr/include/giac/gen.h:713
713		if (*rc!=-1)
(gdb) bt
#0  giac::gen::operator= (this=0x5555559c74b0, a=...) at /usr/include/giac/gen.h:713
#1  0x00007ffff6eda7cf in std::imvector<giac::gen>::push_back (p0=..., this=<optimized out>) at vector.h:224
#2  std::imvector<giac::gen>::push_back(giac::gen const&) () at sym2poly.cc:4005
#3  0x00007ffff733a1ea in giac::makenewvecteur (a=..., b=...) at vecteur.cc:432
#4  0x00007ffff776e553 in giac::sym_mult (a=..., b=..., contextptr=contextptr@entry=0x0) at gen.cc:6885
#5  0x00007ffff7770aa9 in giac::operator_times (a=..., b=..., t=<optimized out>, contextptr=0x0) at gen.cc:6085
#6  0x00007ffff7772e7d in giac::operator* (a=..., b=...) at gen.cc:6100
#7  0x00007ffff6e8cb89 in __static_initialization_and_destruction_0 (__priority=65535, __initialize_p=1) at prog.cc:9235
#8  0x00007ffff7de5e83 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#9  0x00007ffff7dd5f0a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#10 0x0000000000000001 in ?? ()
#11 0x00007fffffffe0ac in ?? ()
#12 0x0000000000000000 in ?? ()
(gdb) quit
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

frederic han
Messages : 1137
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: Qcas Segmentation fault

Message par frederic han » jeu. nov. 30, 2017 10:44 pm

Hello antonio,

I think it was fixed in qcas 0.5.1:
http://webusers.imj-prg.fr/~frederic.ha ... 5.1.tar.gz

Best

Frederic

sagitter
Messages : 31
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Re: Qcas Segmentation fault

Message par sagitter » ven. déc. 01, 2017 12:09 pm

qcas-0.5.1does not compile with following error:

Code : Tout sélectionner

g++ -c -pipe -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wno-error=format-security -fno-strict-aliasing -Wno-unused-parameter -DGIAC_GENERIC_CONSTANTS -fpermissive -fPIC -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++ -I../../qcas -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtSvg -I/usr/include -I../../qcas -I../qt -I. -I. -I. -o output.o ../qt/output.cpp
In file included from ../qt/MainWindow.cpp:42:0:
../qt/gui/FormalSheet.h:106:9: warning: extra qualification 'FormalWorkSheet::' on member 'getLinesSize' [-fpermissive]
     int FormalWorkSheet::getLinesSize();
         ^~~~~~~~~~~~~~~
../qt/MainWindow.cpp: In member function 'void MainWindow::retranslateAction()':
../qt/MainWindow.cpp:430:121: warning: cannot call constructor 'QKeySequence::QKeySequence' directly [-fpermissive]
                                                           "<li><b>"+STRCTRL+"+"+QKeySequence::QKeySequence(Qt::Key_Space).toString()+":</b><center>"+tr("donne les complétions possibles de la chaine saisie")+"</center></li>"
                                                                                                                         ^
../qt/MainWindow.cpp:430:121: note: for a function-style cast, remove the redundant '::QKeySequence'
../qt/MainWindow.cpp: In member function 'void MainWindow::clearWorkspace()':
../qt/MainWindow.cpp:524:16: warning: unused variable 'sheet' [-Wunused-variable]
     MainSheet* sheet=0;
                ^~~~~
../qt/MainWindow.cpp: In member function 'bool MainWindow::loadFile(const QString&)':
../qt/MainWindow.cpp:601:7: warning: return-statement with no value, in function returning 'bool' [-fpermissive]
       return;
       ^~~~~~
../qt/MainWindow.cpp: In member function 'bool MainWindow::appendFile(const QString&)':
../qt/MainWindow.cpp:613:7: warning: return-statement with no value, in function returning 'bool' [-fpermissive]
       return;
       ^~~~~~
../qt/MainWindow.cpp: In member function 'bool MainWindow::loadQcasFile(const QString&)':
../qt/MainWindow.cpp:619:9: error: 'qInfo' was not declared in this scope
         qInfo()<<"Failed to open: "<<fileName;
         ^~~~~
../qt/MainWindow.cpp:640:9: warning: unused variable 'tabBeforeLoad' [-Wunused-variable]
     int tabBeforeLoad=tabPages->count();
         ^~~~~~~~~~~~~
../qt/MainWindow.cpp: In member function 'bool MainWindow::loadGiacFile(const QString&)':
../qt/MainWindow.cpp:724:16: warning: unused variable 'g2d' [-Wunused-variable]
  GraphWidget * g2d=0;
                ^~~
../qt/MainWindow.cpp: In member function 'bool MainWindow::askforXcasarchive()':
../qt/MainWindow.cpp:894:3: warning: return-statement with no value, in function returning 'bool' [-fpermissive]
   return;
   ^~~~~~
../qt/MainWindow.cpp: In member function 'void MainWindow::initAutoSave()':
../qt/MainWindow.cpp:1082:9: error: 'qInfo' was not declared in this scope
         qInfo()<<"Found automatic saving file"<<autofound;
         ^~~~~
../qt/MainWindow.cpp: In member function 'bool MainWindow::autoSave()':
../qt/MainWindow.cpp:1132:3: warning: return-statement with no value, in function returning 'bool' [-fpermissive]
   return;
   ^~~~~~
../qt/MainWindow.cpp: In member function 'void MainWindow::evaluateforinsertion(const QString&)':
../qt/MainWindow.cpp:1799:33: warning: unused variable 'id' [-Wunused-variable]
             CasManager::warning id=cas->initExpression(&formula);
                                 ^~
../qt/MainWindow.cpp: In member function 'void MainWindow::displayXcasHelp(const QString&) const':
../qt/MainWindow.cpp:1887:43: warning: passing 'const QString' as 'this' argument discards qualifiers [-fpermissive]
    giac::gen expression(keyWord.remove("?").toStdString(),giac::context0);
                                           ^
In file included from /usr/include/QtCore/qobject.h:48:0,
                 from /usr/include/QtCore/qcoreapplication.h:45,
                 from /usr/include/QtGui/qapplication.h:45,
                 from /usr/include/QtGui/QApplication:1,
                 from ../qt/MainWindow.cpp:20:
/usr/include/QtCore/qstring.h:280:14: note:   in call to 'QString& QString::remove(const QString&, Qt::CaseSensitivity)'
     QString &remove(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive);
              ^~~~~~
../qt/MainWindow.cpp: In member function 'QString CommandInfo::displayPage(const QString&) const':
../qt/MainWindow.cpp:2059:9: error: 'qInfo' was not declared in this scope
         qInfo()<<command<<"fin de commande\n";
         ^~~~~
make: *** [Makefile:479: MainWindow.o] Error 1
Also, i need to pass the -Wno-error=format-security flag for avoiding the error:

Code : Tout sélectionner

g++ -c -pipe -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fno-strict-aliasing -Wno-unused-parameter -DGIAC_GENERIC_CONSTANTS -fpermissive -fPIC -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++ -I../../qcas -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtSvg -I/usr/include -I../../qcas -I../qt -I. -I. -I. -o FormalLineWidgets.o ../qt/gui/FormalLineWidgets.cpp
../qt/gui/qtmmlwidget.cpp: In member function 'void MmlDocument::_dump(const MmlNode*, QString&) const':
../qt/gui/qtmmlwidget.cpp:3190:56: error: format not a string literal and no format arguments [-Werror=format-security]
     qWarning((indent + node->toStr()).toLatin1().data());
                                                        ^
../qt/gui/qtmmlwidget.cpp: In member function 'void MmlDocument::insertOperator(MmlNode*, const QString&)':
../qt/gui/qtmmlwidget.cpp:3397:10: warning: variable 'ok' set but not used [-Wunused-but-set-variable]
     bool ok = insertChild(node, mo_node, 0);
          ^~
../qt/gui/qtmmlwidget.cpp: In member function 'virtual int MmlNode::scriptlevel(const MmlNode*) const':
../qt/gui/qtmmlwidget.cpp:3735:85: error: format not a string literal and no format arguments [-Werror=format-security]
      qWarning(("MmlNode::scriptlevel(): bad value " + expl_sl_str).toLatin1().data());
                                                                                     ^
../qt/gui/qtmmlwidget.cpp:3751:103: error: format not a string literal and no format arguments [-Werror=format-security]
  qWarning(("MmlNode::scriptlevel(): could not parse value: \"" + expl_sl_str + "\"").toLatin1().data());
                                                                                                       ^
../qt/gui/qtmmlwidget.cpp: In function 'QString decodeEntityValue(QString)':
../qt/gui/qtmmlwidget.cpp:5812:97: error: format not a string literal and no format arguments [-Werror=format-security]
      qWarning(("decodeEntityValue(): bad entity literal: \"" + literal + "\"").toLatin1().data());
                                                                                                 ^
../qt/gui/qtmmlwidget.cpp:5820:97: error: format not a string literal and no format arguments [-Werror=format-security]
      qWarning(("decodeEntityValue(): bad entity literal: \"" + literal + "\"").toLatin1().data());
                                                                                                 ^
../qt/gui/qtmmlwidget.cpp:5828:97: error: format not a string literal and no format arguments [-Werror=format-security]
      qWarning(("decodeEntityValue(): bad entity literal: \"" + literal + "\"").toLatin1().data());
                                                                                                 ^
../qt/gui/qtmmlwidget.cpp:5837:94: error: format not a string literal and no format arguments [-Werror=format-security]
   qWarning(("decodeEntityValue(): bad entity literal: \"" + literal + "\"").toLatin1().data());
                                                                                              ^
../qt/gui/qtmmlwidget.cpp:5846:94: error: format not a string literal and no format arguments [-Werror=format-security]
   qWarning(("decodeEntityValue(): bad entity literal: \"" + literal + "\"").toLatin1().data());
                                                                                              ^
../qt/gui/qtmmlwidget.cpp: In member function 'MmlNode* MmlDocument::domToMml(const QDomNode&, bool*, QString*)':
../qt/gui/qtmmlwidget.cpp:3470:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if (spec->child_spec != child_cnt) {
      ^~
../qt/gui/qtmmlwidget.cpp:3485:2: note: here
  case NodeSpec::ChildAny:
  ^~~~
cc1plus: some warnings being treated as errors
make: *** [Makefile:550: qtmmlwidget.o] Error 1
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

frederic han
Messages : 1137
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: Qcas Segmentation fault

Message par frederic han » ven. déc. 01, 2017 1:41 pm

The first one is a qt4 problem and should not occur with qt5. I have started to fix it but I am now using Qt5 isn't it the default Qt version on fedora? I am also using fedora mingw Qt5 packages for the windows built of qcas.

On fedora 26 I usually do:
qmake-qt5 qcas.pro
then make.



For the format-security problem I will look.

sagitter
Messages : 31
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Re: Qcas Segmentation fault

Message par sagitter » ven. déc. 01, 2017 4:25 pm

frederic han a écrit :The first one is a qt4 problem and should not occur with qt5. I have started to fix it but I am now using Qt5 isn't it the default Qt version on fedora? I am also using fedora mingw Qt5 packages for the windows built of qcas.

On fedora 26 I usually do:
qmake-qt5 qcas.pro
then make.
So you have switched to QT5; okay.


For the format-security problem I will look.
Thank you.
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

frederic han
Messages : 1137
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: Qcas Segmentation fault

Message par frederic han » sam. déc. 02, 2017 5:48 am

So Qt4 built and format-security should be fixed in qcas 0.5.2:

https://git.tuxfamily.org/qcas/qcas.git ... 5.2.tar.gz

sagitter
Messages : 31
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Re: Qcas Segmentation fault

Message par sagitter » sam. déc. 02, 2017 6:42 pm

frederic han a écrit :So Qt4 built and format-security should be fixed in qcas 0.5.2:

https://git.tuxfamily.org/qcas/qcas.git ... 5.2.tar.gz
Errors solved. Thank you.
Qcas is built both with Qt4 and Qt5.

I'm going to create RPMs of QCAS and giacpy.
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

frederic han
Messages : 1137
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: Qcas Segmentation fault

Message par frederic han » dim. déc. 03, 2017 6:41 am

Thank you very much.

Répondre