GENIVI / CANdevStudio

Development tool for CAN bus simulation
Mozilla Public License 2.0
923 stars 248 forks source link

Segmentation fault, Gtk-CRITICAL #235

Open kefir opened 2 years ago

kefir commented 2 years ago

Hello everyone.

OS: Manjaro, 5.14.10-arch1 Shell: GNOME Shell 40.5

When trying to open any existing project I'm always getting following error:

(process:124920): Gtk-CRITICAL **: 23:40:09.187: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(process:124920): Gtk-CRITICAL **: 23:40:09.187: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(process:124920): Gtk-CRITICAL **: 23:40:09.187: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
zsh: segmentation fault (core dumped)  CANdevStudio

App crashes, creating new project and working on it is fine

kefir commented 2 years ago

Additional info:

I have managed to avoid this behavior by commenting out this in ./src/comp[onents/cansignaldata/cansignadata_p.h

    ComponentInterface::ComponentProperties _supportedProps = {
            std::make_tuple(_nameProperty,  QVariant::String, true, cf(nullptr)),
            std::make_tuple(_fileProperty, QVariant::String, true, cf([] { return new PropertyFieldPath; } )),
            // std::make_tuple(_colorProperty, QVariant::String, true, cf([] { return new PropertyFieldColor; } ))
    };

Relevant commit: 8f84350

Not a clean or proper solution, but maybe you can tell me where to dig next.

segmentation fault occures here src/common/propertyfields.h:

struct PropertyFieldColor : public PropertyFieldText {
    PropertyFieldColor()
    {
        _pb = new QPushButton(this);
        _pb->setText("...");
        _pb->setFixedSize(24, 24);
        _pb->setFlat(true);
        _pb->setProperty("type", "PropertyFieldPath");
        layout()->addWidget(_pb);

        _cd = new QColorDialog(this); // THIS LINE !!! SEGFAULTS

        connect(_pb, &QPushButton::pressed, [&] {
            _cd->setCurrentColor(QColor(_le->text()));
            if (_cd->exec() == QDialog::Accepted) {
                _le->setText(_cd->selectedColor().name(QColor::HexRgb).toUpper());
            }
        });
    }

private:
    QPushButton* _pb;
    QColorDialog* _cd;
};
rkollataj commented 2 years ago

Thanks @kefir, that's very useful. I will have a look.