Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with disassembler and SIGILL signal
Forum Updated to NodeBB v4.3 + New Features

Problem with disassembler and SIGILL signal

Scheduled Pinned Locked Moved Solved General and Desktop
59 Posts 4 Posters 21.7k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Amaury

    I am using Gdb as debugger and Gcc as a compiler , I forget to precise that I was on a raspberry Pi 3.
    I would try your way and come back again.

    kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by
    #20

    Are you sure that this compiler produces binaries for that particular instruction set? Look up the compatibility of your gcc version with the instruction set of that particular Pi.

    Read and abide by the Qt Code of Conduct

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #21

      Hmm dont seems like it as just a Qstring.
      Its more if you have a widget and assign parent.
      Then both scope and parent might delete it and it might crash.

      Dont the call stack give hint what it was doing ?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Amaury
        wrote on last edited by
        #22

        @kshegunov Sorry I didn't understand anything I'm not really used with the debuggers.

        @mrjj Hum I am associating widgets to a parent when using a QStackWidget for example I got my main window with some widgets in it. It the main ui of my application.

        I am adding some widgets in a QStackedWidget on the MainWindow and calling them by using their names .

        MainWindow

        MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
            ui(new Ui::MainWindow)
        {
        
            //this->setWindowFlags(Qt::FramelessWindowHint);
        
            ui->setupUi(this);
            this->move(this->x(),this->y());
        
            AccueilWindow = new Accueil(this,"AccueilWindow");
            ui->stackedWidget->addWidget(AccueilWindow);
        
        ui->stackedWidget->setCurrentWidget(AccueilWindow);
        
        connect(this,SIGNAL(changeInterface(QString)),this,SLOT(changeOnglet(QString)));
        }
        
        void MainWindow::changeOnglet(QString name)
        {
            qDebug()<<name;
            if ((name == AccueilWindow->objectName())&&AccueilWindow)
            {
                ui->stackedWidget->setCurrentWidget(AccueilWindow);
                hide_full_ui();
                show_ui();
                return;
            }
            else if ((name == AlarmesWindow->objectName())&&AlarmesWindow)
            {
                ui->stackedWidget->setCurrentWidget(AlarmesWindow);
                show_ui();
                return;
            }
        }
        
        

        Mainwindow.h

        private:
            
            Ui::MainWindow *ui;
        
            Accueil *AccueilWindow;
            Alarmes *AlarmesWindow;
        
        
        

        The alarm.cpp

        Alarmes::Alarmes(QWidget *parent,QString AlarmesWindow) :
            QWidget(parent),
            Alrm_ui(new Ui::Alarmes)
        {
            Alrm_ui->setupUi(this);
        
        
            this->setObjectName(AlarmesWindow);
            connect(this,SIGNAL(changeInterface(QString)),qobject_cast<MainWindow *>(parent),SLOT(changeOnglet(QString)));
        }
        

        alarm.h

        namespace Ui {
        class Alarmes;
        }
        
        class Alarmes : public QWidget
        {
            Q_OBJECT
        
        public:
            explicit Alarmes(QWidget *parent ,QString AlarmesWindow);
            virtual ~Alarmes();
        
        
        
        
        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #23

          Hi
          Nothing springs to eye. Seems you let the Qt system handle it.

          If you create a default Widgets project and run it on the pi.

          Does that also crash at close?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Amaury
            wrote on last edited by Amaury
            #24

            If i delete the whole Qtranslator thing it seems that's not ceashing anymore , there just a message saying starting the debug and debug ended. I assume that's ok ...

            I didn't tried to let some other programm running to see if there's something but I didn't found any problems on an other application .

            Edit : It seems that other programs have no problem ..

            And I don't have any more troubles if my main.cpp is like :

            int main(int argc, char *argv[])
            {
                QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
                QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
            
                QApplication a(argc, argv);
            
            //    QTranslator qtTranslator;
            //        qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
            //        a.installTranslator(&qtTranslator);
            
            
            
            
            
                MainWindow w;
                w.show();
            
                MemTampon::Db.aff_Temperature();
                MemTampon::Db.aff_Humidite();
                MemTampon::Db.aff_Puissance();
                MemTampon::Db.aff_Nom_SD();
            
            
            //    a.removeTranslator(&qtTranslator);
                return a.exec();
            }
            
            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #25

              Ok
              Im not sure what to conclude from that :)
              But seems to be related to it anyway then.

              1 Reply Last reply
              1
              • A Offline
                A Offline
                Amaury
                wrote on last edited by Amaury
                #26

                Yes I'm really not sure about it that's really pointing on this but don't know what's wrong ...

                I think I'm going to create some buttons that are written in my language instead of using the Qt popup default buttons.

                Thanks for help I'm closing this subject and put it as solved .

                See you in a close future I think ^^

                Edit Seems to be the return a.exec() that is bugged don't know why ^^

                mrjjM 1 Reply Last reply
                1
                • A Amaury

                  Yes I'm really not sure about it that's really pointing on this but don't know what's wrong ...

                  I think I'm going to create some buttons that are written in my language instead of using the Qt popup default buttons.

                  Thanks for help I'm closing this subject and put it as solved .

                  See you in a close future I think ^^

                  Edit Seems to be the return a.exec() that is bugged don't know why ^^

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #27

                  @Amaury said in Problem with disassembler and SIGILL signal:

                  Edit Seems to be the return a.exec() that is bugged don't know why ^^

                  For QApplication it has setting that says When last window closed,
                  exit the event loop ( exec() ) and die.
                  see
                  app.setQuitOnLastWindowClosed(true);
                  This is in effect sort of the same as
                  app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));

                  So if some sort of instruction that gets called when deconstructing then it will
                  show exec() as the the point of crash.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #28

                    Hi,

                    Out of curiosity, why are you removing the translator before starting the event loop ? Doing it like that raises the following question: why set a translator in the first place ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Amaury
                      wrote on last edited by
                      #29

                      @SGaist I am removing the translator because it looked like that was this function that send the SIGILL signal .
                      After all it seems that it doesn't changed anything, but I do need it , just that I can translate my pop-ups in a different way.

                      @mrjj I'm going to look those potential solutions and post here if I get the answer.

                      kshegunovK 1 Reply Last reply
                      0
                      • A Amaury

                        @SGaist I am removing the translator because it looked like that was this function that send the SIGILL signal .
                        After all it seems that it doesn't changed anything, but I do need it , just that I can translate my pop-ups in a different way.

                        @mrjj I'm going to look those potential solutions and post here if I get the answer.

                        kshegunovK Offline
                        kshegunovK Offline
                        kshegunov
                        Moderators
                        wrote on last edited by
                        #30

                        @Amaury
                        It'd be helpful if you also extract the assembly (a few lines) from the point of the crash, where you get the SIGILL.

                        Read and abide by the Qt Code of Conduct

                        1 Reply Last reply
                        1
                        • A Offline
                          A Offline
                          Amaury
                          wrote on last edited by
                          #31

                          Those are the first 15 lines of the disassembler where I get my Sigill signal : it happens on line 6

                          0x6f6a2dd4                   00 00 00 00  andeq	r0, r0, r0
                          0x6f6a2dd8                   00 00 00 00  andeq	r0, r0, r0
                          0x6f6a2ddc                   00 00 00 00  andeq	r0, r0, r0
                          0x6f6a2de0                   fe e1 6e f2  vorr	q15, q15, q15
                          0x6f6a2de4                   1e ff 2f e1  bx	lr
                          0x6f6a2de8                   1d 0f 19 ee  mrc	15, 0, r0, cr9, cr13, {0}
                          0x6f6a2dec                   1e ff 2f e1  bx	lr
                          0x6f6a2df0                   9f 2f 90 e1  ldrex	r2, [r0]
                          0x6f6a2df4                   01 30 82 e0  add	r3, r2, r1
                          0x6f6a2df8                   93 2f 80 e1  strex	r2, r3, [r0]
                          0x6f6a2dfc                   00 00 52 e3  cmp	r2, #0
                          0x6f6a2e00                   fa ff ff 1a  bne	0x6f6a2df0
                          0x6f6a2e04                   03 00 a0 e1  mov	r0, r3
                          0x6f6a2e08                   1e ff 2f e1  bx	lr
                                  Function: OPENSSL_cleanse
                          
                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            Amaury
                            wrote on last edited by
                            #32

                            Hi there ,

                            after a day of research I finnaly didn't found what's the real problem .

                            I read that the return a.exec() Will execute only when a signal is send to it ( when nothing is shown).

                            I maybe found a track that leads to my destructors , I have some sql request and QUrl posts in my program , ido I need to delete them in the destructor , would that cause a problem if the program is executed during a long time ?

                            Everything is compiling fine and my program is running well but after a period of time it's crashing.

                            Finally I was thinking about the SIGILL signal ,when I F10 or F11 on this it's running this part of the program but if it's closing everything on the app would it be normal to have this signal ?

                            don't know if I was clear ...

                            1 Reply Last reply
                            0
                            • mrjjM Offline
                              mrjjM Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on last edited by mrjj
                              #33

                              Hi
                              SIGILL is not normal.
                              From normal program errors you do not get this in any easy way.
                              So the big question is. Can you can get SIGILL from a normal GUI program or
                              only when using your full code?

                              It might be some sort of corruption but impossible to guess at :)

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                Amaury
                                wrote on last edited by Amaury
                                #34

                                I didn't tried that but it works with another program I don't have any SIGILL error ...

                                the problem with this is that I have something like 18 pages and 500 lines by pages on average.

                                So that said to find out where the problem is do I have to check each lines of my program ? :/

                                mrjjM 1 Reply Last reply
                                0
                                • A Amaury

                                  I didn't tried that but it works with another program I don't have any SIGILL error ...

                                  the problem with this is that I have something like 18 pages and 500 lines by pages on average.

                                  So that said to find out where the problem is do I have to check each lines of my program ? :/

                                  mrjjM Offline
                                  mrjjM Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #35

                                  @Amaury
                                  Well if ONLY this program does it. Its not compiler.
                                  But you should be really clear about it.
                                  Else you can waste tons of time.

                                  So yes, if it is program error in your code. You will need to find the actual line/the bug.

                                  You can try http://valgrind.org/ but its takes time to use and understand.

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    Amaury
                                    wrote on last edited by
                                    #36

                                    Thanks for the support , I need to debug my program before I continue so I prefer to waste little time to understand and use the program.
                                    I can't try to debug the code line per line it would take too long and it should be everywhere .

                                    At least when I'm done with it I finally have to find a solution to start my app on boot but for now if it crashes all the time it's not really usefull.

                                    mrjjM 1 Reply Last reply
                                    0
                                    • A Amaury

                                      Thanks for the support , I need to debug my program before I continue so I prefer to waste little time to understand and use the program.
                                      I can't try to debug the code line per line it would take too long and it should be everywhere .

                                      At least when I'm done with it I finally have to find a solution to start my app on boot but for now if it crashes all the time it's not really usefull.

                                      mrjjM Offline
                                      mrjjM Offline
                                      mrjj
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #37

                                      @Amaury
                                      Well u should look for array copy. dangling pointers.
                                      old char * types and stuff like that.
                                      To get SIGILL from program bug , you must corrupt
                                      something in the code segment.
                                      Easy way is to use dangling pointer.

                                      So maybe you can guess at functions where it might happen.

                                      1 Reply Last reply
                                      0
                                      • A Offline
                                        A Offline
                                        Amaury
                                        wrote on last edited by Amaury
                                        #38

                                        @mrjj
                                        Well right now you're talking to me in japanese ^^
                                        I'm going to have a look on that didn't had time yesterday , I think I can be helped for one thing or two :)
                                        I'll come back if my problem is solve or not.

                                        mrjjM 1 Reply Last reply
                                        0
                                        • A Amaury

                                          @mrjj
                                          Well right now you're talking to me in japanese ^^
                                          I'm going to have a look on that didn't had time yesterday , I think I can be helped for one thing or two :)
                                          I'll come back if my problem is solve or not.

                                          mrjjM Offline
                                          mrjjM Offline
                                          mrjj
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #39

                                          @Amaury

                                          Oh :) sorry.
                                          What i mean is SIGILL means "what the hell is that instruction" from the cpu.
                                          This can happen if compiler setting is slightly off for target.
                                          OR
                                          you can also have it happen if you write over the end of an array
                                          or use a pointer that is not set.
                                          Like
                                          MyClass *c1; /// dangling pointer
                                          c1->somfunc()
                                          Then when CPU tries to run the func it sees some random garbage at that location
                                          and might say SIGILL.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved