Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

simulide R1290 segmentation error

Go down  Message [Page 1 of 1]

1simulide R1290 segmentation error Empty simulide R1290 segmentation error Tue Jul 05, 2022 5:01 pm

Guest


Guest

using 1.0.1 r1290 does not start the program.
these are the info from valgrind

billy@localhost:~/rpmbuild/RPMS/x86_64> valgrind simulide
==29683== Memcheck, a memory error detector
==29683== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==29683== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==29683== Command: simulide
==29683==
==29683== Invalid read of size 8
==29683==    at 0x5518F14: QTreeWidgetItem::addChild(QTreeWidgetItem*) (in /usr/lib64/libQt5Widgets.so.5.15.2)
==29683==    by 0x4C9B7F: ComponentSelector::addItem(QString, QTreeWidgetItem*, QString, QString) (in /usr/bin/simulide)
==29683==    by 0x4CE01B: ComponentSelector::addItem(LibraryItem*) (in /usr/bin/simulide)
==29683==    by 0x4CE2AA: ComponentSelector::LoadLibraryItems() (in /usr/bin/simulide)
==29683==    by 0x4CE3E7: ComponentSelector::ComponentSelector(QWidget*) (in /usr/bin/simulide)
==29683==    by 0x45880C: MainWindow::createWidgets() (in /usr/bin/simulide)
==29683==    by 0x459F66: MainWindow::MainWindow() (in /usr/bin/simulide)
==29683==    by 0x455BDD: main (in /usr/bin/simulide)
==29683==  Address 0x30 is not stack'd, malloc'd or (recently) free'd
==29683==
==29683==
==29683== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==29683==  Access not within mapped region at address 0x30
==29683==    at 0x5518F14: QTreeWidgetItem::addChild(QTreeWidgetItem*) (in /usr/lib64/libQt5Widgets.so.5.15.2)
==29683==    by 0x4C9B7F: ComponentSelector::addItem(QString, QTreeWidgetItem*, QString, QString) (in /usr/bin/simulide)
==29683==    by 0x4CE01B: ComponentSelector::addItem(LibraryItem*) (in /usr/bin/simulide)
==29683==    by 0x4CE2AA: ComponentSelector::LoadLibraryItems() (in /usr/bin/simulide)
==29683==    by 0x4CE3E7: ComponentSelector::ComponentSelector(QWidget*) (in /usr/bin/simulide)
==29683==    by 0x45880C: MainWindow::createWidgets() (in /usr/bin/simulide)
==29683==    by 0x459F66: MainWindow::MainWindow() (in /usr/bin/simulide)
==29683==    by 0x455BDD: main (in /usr/bin/simulide)
==29683==  If you believe this happened as a result of a stack
==29683==  overflow in your program's main thread (unlikely but
==29683==  possible), you can try to increase the size of the
==29683==  main thread stack using the --main-stacksize= flag.
==29683==  The main thread stack size used in this run was 8388608.
==29683==
==29683== HEAP SUMMARY:
==29683==     in use at exit: 4,689,552 bytes in 49,469 blocks
==29683==   total heap usage: 218,453 allocs, 168,984 frees, 108,288,579 bytes allocated
==29683==
==29683== LEAK SUMMARY:
==29683==    definitely lost: 12,024 bytes in 127 blocks
==29683==    indirectly lost: 7,164 bytes in 248 blocks
==29683==      possibly lost: 8,096 bytes in 31 blocks
==29683==    still reachable: 4,662,252 bytes in 49,062 blocks
==29683==         suppressed: 16 bytes in 1 blocks
==29683== Rerun with --leak-check=full to see details of leaked memory
==29683==
==29683== For lists of detected and suppressed errors, rerun with: -s
==29683== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

My distro is opensuse 15.4

I remain at your disposal for any further info you may need.



Last edited by arcachofo on Thu Jul 07, 2022 2:20 pm; edited 1 time in total (Reason for editing : Mark as solved (green color))

2simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Wed Jul 06, 2022 4:18 pm

arcachofo

arcachofo

I can't reproduce the issue.
Did you change the location of some files or something like that?

3simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Wed Jul 06, 2022 5:03 pm

Guest


Guest

no file changes.

I only built rpm files with this spec

%build
export PATH=/usr/lib64/qt5/bin:$PATH
export QTDIR=%{_prefix}/lib64/qt5/
cd build_XX
qmake-qt5

make %{?_smp_mflags}

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/bin
%if %build_dev_release
cd build_XX/executables/SimulIDE_1.0.1
%else
cd build_XX/release/SimulIDE_1.0.1
%endif
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_bindir}
cp simulide %{buildroot}/usr/bin/simulide
cp -a data %{buildroot}%{_datadir}/%{name}
cp -a examples %{buildroot}%{_datadir}/%{name}


install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dm644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -Dm644 ~/rpmbuild/BUILD/%{name}_1.0.1_R1290/resources/icons/hicolor/256x256/simulide.png %{buildroot}/usr/share/icons/hicolor/256x256/simulide.png

with gcc 7.5.0

the version 1.0.0-RC2_R1104 work fine with the file spec by changing the name only

if the problem is QTreeWidgetItem, during the the build i have this warning:

../src/gui/componentselector/componentselector.cpp: In member function 'QTreeWidgetItem* ComponentSelector::getCategory(QString, QString)':
../src/gui/componentselector/componentselector.cpp:246:86: warning: 'void QTreeWidgetItem::setTextColor(int, const QColor&)' is deprecated: Use QTreeWidgetItem::setForeground() instead [-Wdeprecated-declarations]
catItem->setTextColor( 0, QColor( 110, 95, 50 )/*QColor(255, 230, 200)*/ );
^
In file included from /usr/include/qt5/QtWidgets/QTreeWidgetItem:1:0,
from ../src/gui/componentselector/compplugindialog.h:25,
from ../src/gui/componentselector/componentselector.h:25,
from ../src/gui/componentselector/componentselector.cpp:30:
/usr/include/qt5/QtWidgets/qtreewidget.h:156:17: note: declared here
inline void setTextColor(int column, const QColor &color)
^~~~~~~~~~~~
../src/gui/componentselector/compplugindialog.cpp: In member function 'void CompPluginDialog::addItem(QTreeWidgetItem*)':
../src/gui/componentselector/compplugindialog.cpp:58:60: warning: 'virtual void QListWidgetItem::setBackgroundColor(const QColor&)' is deprecated: Use QListWidgetItem::setBackground() instead [-Wdeprecated-declarations]

4simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Wed Jul 06, 2022 6:22 pm

arcachofo

arcachofo

Well... when you install you are moving all the files from it's  original location.
Not sure where those files will go because the value of "_datadir" is not shown.

Just in case, there are 2 ways to organize the files:

1. How simulide is deployed if built "normally":
Code:
-rootdir
    |-simulide (executable)
    |-data (dir)
    |-examples (dir)

2. To be installed in "standard" Linux file system:
Code:
-rootdir (usually usr)
    |-bin (dir)
    |   |-simulide (executable)
    |
    |-share (dir)
        |-simulide (dir)
            |-data (dir)
            |-examples (dir)

In your case I guess that "data" and "examples" should go to to:
%{buildroot}/usr/share/simulide/data
%{buildroot}/usr/share/simulide/examples


I don't think a deprecated function will cause any problem.
And I'm not sure what can cause the crash in your system.
Even if the files are not in place it should not crash.

What happens if you run simulide from the build folder?
cd build_XX/executables/SimulIDE_1.0.1
./simulide

5simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Wed Jul 06, 2022 8:13 pm

Guest


Guest

this is the position of "date" and "examples"

/usr/bin/simulide
/usr/share/applications/simulide.desktop
/usr/share/doc/packages/simulide
/usr/share/doc/packages/simulide/COPYING
/usr/share/doc/packages/simulide/changelog.txt
/usr/share/icons/hicolor/256x256/simulide.png
/usr/share/pixmaps/simulide.png
/usr/share/simulide
/usr/share/simulide/data
/usr/share/simulide/data/0-ternary.xml
.
.
/usr/share/simulide/examples
/usr/share/simulide/examples/Active
/usr/share/simulide/examples/Active/BJT
/usr/share/simulide/examples/Active/BJT/Osc_Hartley-2.sim1
.
.

if i run simulide from the build folder i get the same segmentation error

==1215== Invalid read of size 8
==1215==    at 0x5518F14: QTreeWidgetItem::addChild(QTreeWidgetItem*) (in /usr/lib64/libQt5Widgets.so.5.15.2)
==1215==    by 0x4CC2EF: ComponentSelector::addItem(QString, QTreeWidgetItem*, QString, QString) (in /home/billy/simulide_1.0.1_R1290/build_XX/executables/SimulIDE_1.0.1/simulide)
==1215==    by 0x4D078B: ComponentSelector::addItem(LibraryItem*) (in /home/billy/simulide_1.0.1_R1290/build_XX/executables/SimulIDE_1.0.1/simulide)
==1215==    by 0x4D0A1A: ComponentSelector::LoadLibraryItems() (in /home/billy/simulide_1.0.1_R1290/build_XX/executables/SimulIDE_1.0.1/simulide)
==1215==    by 0x4D0B57: ComponentSelector::ComponentSelector(QWidget*) (in /home/billy/simulide_1.0.1_R1290/build_XX/executables/SimulIDE_1.0.1/simulide)
==1215==    by 0x4590DC: MainWindow::createWidgets() (in /home/billy/simulide_1.0.1_R1290/build_XX/executables/SimulIDE_1.0.1/simulide)
==1215==    by 0x45A836: MainWindow::MainWindow() (in /home/billy/simulide_1.0.1_R1290/build_XX/executables/SimulIDE_1.0.1/simulide)
==1215==    by 0x45643D: main (in /home/billy/simulide_1.0.1_R1290/build_XX/executables/SimulIDE_1.0.1/simulide)
==1215==  Address 0x30 is not stack'd, malloc'd or (recently) free'd
==1215==

i am using qt5 5.15.2 if i upgrade them to 5.15.5 would it change anything?

I also tried using gcc10 and gcc11 without changing anything, while version 1.0.0 works fine

could it be a error only for rpm distributions like opensuse and fedora?

6simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Wed Jul 06, 2022 10:38 pm

arcachofo

arcachofo

this is the position of "date" and "examples"
That looks good.

i am using qt5 5.15.2 if i upgrade them to 5.15.5 would it change anything?
could it be a error only for rpm distributions like opensuse and fedora?
I don't think so.

The problem is adding some component to the component list (left panel).
The category looks invalid...
No idea why, so the first step would be to find which component and category.

The best way would be debugging it in Qt Creator (for example).
If you don't have Qt Creator you can add some debug messages like this:
src/gui/componentselector/componentselector.cpp line 176:

Code:
void ComponentSelector::addItem( LibraryItem* libItem )
{
    QString category = libItem->category();
    if( category != "")
    {
        QString icon = ":/"+libItem->iconfile();
        QTreeWidgetItem* catItem = getCategory( category );
        

        // ADD THESE LINES
        qDebug() << libItem->name() << libItem->type() << category << catItem;
        // Let's see if it crashes here now:
        qDebug() << catItem->text( 0 );
                          
        
        addItem( libItem->name(), catItem, icon, libItem->type() );
}   }

Compile, run simulide from terminal and see which is the last output before crashing.
From there we can get an idea...

7simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Thu Jul 07, 2022 12:19 am

Guest


Guest

from the build folder

./simulide
"Sonda" "Probe" "Strumenti di misura" 0x2126a50
"Strumenti di misura"
"Voltmeter" "Voltimeter" "Strumenti di misura" 0x2126a50
"Strumenti di misura"
"Ampmeter" "Amperimeter" "Strumenti di misura" 0x2126a50
"Strumenti di misura"
"FreqMeter" "FreqMeter" "Strumenti di misura" 0x2126a50
"Strumenti di misura"
"Oscilloscopio" "Oscope" "Strumenti di misura" 0x2126a50
"Strumenti di misura"
"Logic Analizer" "LAnalizer" "Strumenti di misura" 0x2126a50
"Strumenti di misura"
"Tensione Costante." "Fixed Voltage" "Alimentazioni/Sorgenti" 0x21df1a0
"Sorgenti"
"Clock" "Clock" "Alimentazioni/Sorgenti" 0x0
Errore di segmentazione (core dump creato)

8simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Thu Jul 07, 2022 2:38 am

arcachofo

arcachofo

Ok, I see.

Italian translation is broken, don't use it.
I didn't know it could do simulide to crash.

You can solve the problem like this:
Code:
void ComponentSelector::addItem( LibraryItem* libItem )
{
    QString category = libItem->category();
    if( category != "")
    {
        QString icon = ":/"+libItem->iconfile();
        QTreeWidgetItem* catItem = getCategory( category );
        
        if( catItem ) addItem( libItem->name(), catItem, icon, libItem->type() );
}   }

9simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Thu Jul 07, 2022 10:53 am

Guest


Guest

you are right Italian translation is broken.

I selected the english language, i applied the code and the program from the build folder works fine

it also works by building package rpm

thank you very much.

10simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Thu Jul 07, 2022 12:11 pm

arcachofo

arcachofo

Good to know. Thank you for reporting.

In any case I must fix the root of the problem that comes from a recent modification of how categories are created, that is why 1.0.0 does not crash.

11simulide R1290 segmentation error Empty Re: simulide R1290 segmentation error Thu Jul 07, 2022 2:20 pm

arcachofo

arcachofo

Crash solved at Rev 1295.

The component list will be a mess with some translations but it will not crash.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum