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. Totally confusing segmentation violation
Forum Updated to NodeBB v4.3 + New Features

Totally confusing segmentation violation

Scheduled Pinned Locked Moved Unsolved General and Desktop
24 Posts 6 Posters 10.2k Views 2 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 ambershark

    @mstoth Can you share your code for that form's class, and the code for the instantiation of the form/class?

    mstothM Offline
    mstothM Offline
    mstoth
    wrote on last edited by mstoth
    #21

    @ambershark Here's the three files associated with the panel I tried to present. Really nothing to see here however, it is just the template from choosing Qt Designer Form Class and adding one label. Without the label, everything is fine. Once the label is there, it crashes. To instantiate it all I do is

        DialogVoicePresets *dvp = new DialogVoicePresets(this);
        dvp->show();
    
    

    The c file:

    #include "dialogvoicepresets.h"
    #include "ui_dialogvoicepresets.h"
    
    DialogVoicePresets::DialogVoicePresets(QWidget *parent) :
        QDialog(parent),
        ui(new Ui::DialogVoicePresets)
    {
        ui->setupUi(this);
    }
    
    DialogVoicePresets::~DialogVoicePresets()
    {
        delete ui;
    }
    
    

    The Header

    #ifndef DIALOGVOICEPRESETS_H
    #define DIALOGVOICEPRESETS_H
    
    #include <QDialog>
    
    namespace Ui {
    class DialogVoicePresets;
    }
    
    class DialogVoicePresets : public QDialog
    {
        Q_OBJECT
    
    signals:
        void openPresets();
    
    public:
        explicit DialogVoicePresets(QWidget *parent = 0);
        ~DialogVoicePresets();
    
    private:
        Ui::DialogVoicePresets *ui;
    };
    
    #endif // DIALOGVOICEPRESETS_H
    
    

    And the .ui file

    <?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
     <class>DialogVoicePresets</class>
     <widget class="QDialog" name="DialogVoicePresets">
      <property name="geometry">
       <rect>
        <x>0</x>
        <y>0</y>
        <width>480</width>
        <height>272</height>
       </rect>
      </property>
      <property name="windowTitle">
       <string>Dialog</string>
      </property>
      <widget class="QLabel" name="label">
       <property name="geometry">
        <rect>
         <x>200</x>
         <y>20</y>
         <width>59</width>
         <height>16</height>
        </rect>
       </property>
       <property name="text">
        <string>TextLabel</string>
       </property>
      </widget>
     </widget>
     <resources/>
     <connections/>
    </ui>
    
    
    A 1 Reply Last reply
    0
    • kshegunovK kshegunov

      Try setting the QT_NO_FT_CACHE environment variable to something, either 0 or 1. This is done in the kit configuration you select the "Run" from the side panel (Qt creator 4.x) and then open the "Run environment list". I suspect this is a bug either in Qt, which is less likely at this point or in your redhat's version (or the fontconfig library). As reference look at this report (albeit quite old). And these bits in Qt's source:
      http://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qfontengine_ft.cpp?h=5.7#n686
      http://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/global/qglobal.cpp?h=5.7#n3235

      PS.
      Alternatively try a later Qt version, where qfontengine_ft "magically" disappeared. ;)

      mstothM Offline
      mstothM Offline
      mstoth
      wrote on last edited by mstoth
      #22

      @kshegunov
      I tried to setQT_NO_FT_CACHE to 1. I'm running 4.0.3 but I got to this form from the Debug button on the side panel. On my version of Creator the run button just runs the program. Once I picked Debug then I had the options of Build and Run where I could choose the environment variables as shown in this image.
      0_1507293685606_Selection_175.png

      Unfortunately the problem still exists after this. However thank you for the idea! Still looking... I will see about upgrading to a later version.

      1 Reply Last reply
      0
      • mstothM mstoth

        @ambershark Here's the three files associated with the panel I tried to present. Really nothing to see here however, it is just the template from choosing Qt Designer Form Class and adding one label. Without the label, everything is fine. Once the label is there, it crashes. To instantiate it all I do is

            DialogVoicePresets *dvp = new DialogVoicePresets(this);
            dvp->show();
        
        

        The c file:

        #include "dialogvoicepresets.h"
        #include "ui_dialogvoicepresets.h"
        
        DialogVoicePresets::DialogVoicePresets(QWidget *parent) :
            QDialog(parent),
            ui(new Ui::DialogVoicePresets)
        {
            ui->setupUi(this);
        }
        
        DialogVoicePresets::~DialogVoicePresets()
        {
            delete ui;
        }
        
        

        The Header

        #ifndef DIALOGVOICEPRESETS_H
        #define DIALOGVOICEPRESETS_H
        
        #include <QDialog>
        
        namespace Ui {
        class DialogVoicePresets;
        }
        
        class DialogVoicePresets : public QDialog
        {
            Q_OBJECT
        
        signals:
            void openPresets();
        
        public:
            explicit DialogVoicePresets(QWidget *parent = 0);
            ~DialogVoicePresets();
        
        private:
            Ui::DialogVoicePresets *ui;
        };
        
        #endif // DIALOGVOICEPRESETS_H
        
        

        And the .ui file

        <?xml version="1.0" encoding="UTF-8"?>
        <ui version="4.0">
         <class>DialogVoicePresets</class>
         <widget class="QDialog" name="DialogVoicePresets">
          <property name="geometry">
           <rect>
            <x>0</x>
            <y>0</y>
            <width>480</width>
            <height>272</height>
           </rect>
          </property>
          <property name="windowTitle">
           <string>Dialog</string>
          </property>
          <widget class="QLabel" name="label">
           <property name="geometry">
            <rect>
             <x>200</x>
             <y>20</y>
             <width>59</width>
             <height>16</height>
            </rect>
           </property>
           <property name="text">
            <string>TextLabel</string>
           </property>
          </widget>
         </widget>
         <resources/>
         <connections/>
        </ui>
        
        
        A Offline
        A Offline
        ambershark
        wrote on last edited by ambershark
        #23

        @mstoth Couple ideas..

        1. What happens if you do dvp->exec() to make it modal instead of show()?

        2. Do you have a custom event loop somewhere?

        3. What happens if you do not give your dialog a parent? I.e. new DialogVoicePresets();?

        4. If possible can you test this on another linux box? Preferably something more modern than redhat? Not necessarily cutting edge like arch/gentoo, but even something simple and newer like ubuntu. That will help show if it's a problem with your system or if it's a problem with your code.

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        mstothM 1 Reply Last reply
        0
        • A ambershark

          @mstoth Couple ideas..

          1. What happens if you do dvp->exec() to make it modal instead of show()?

          2. Do you have a custom event loop somewhere?

          3. What happens if you do not give your dialog a parent? I.e. new DialogVoicePresets();?

          4. If possible can you test this on another linux box? Preferably something more modern than redhat? Not necessarily cutting edge like arch/gentoo, but even something simple and newer like ubuntu. That will help show if it's a problem with your system or if it's a problem with your code.

          mstothM Offline
          mstothM Offline
          mstoth
          wrote on last edited by
          #24

          @ambershark
          First many thanks to all who provided time and help!

          Finally after several months in desperation, I just re-wrote the MainWindow code, copied all the panels and created a new version of the application. Now I do not have the crashing problem. I do not see how it's different so there must be some nearly invisible artifact that was throwing a monkey wrench into the works. That's my guess anyway.

          Again, many thanks to all! As a friend of mine used to say "Your blood's worth bottlin'"

          1 Reply Last reply
          3

          • Login

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