podonoghue / usbdm-firmware

Firmware for USBDM BDMs
47 stars 28 forks source link

UsbdmFlashprogrammer segfault. #9

Closed HondaRulez closed 1 year ago

HondaRulez commented 1 year ago

Hi,

(Using Linux, Debian BookWoorm, latest Wx libs)

The UsbdmFlashProgrammer and the GSBServer both got segfault at same point.

firmware loader (HCS), FlashDump app works fine...

BackTrace of Flasprogrammer:

Reading symbols from UsbdmFlashProgrammer-debug... (No debugging symbols found in UsbdmFlashProgrammer-debug) (gdb) run Starting program: /opt/src/usbdm_4.12.1.300-1-x86_64/usr/bin/UsbdmFlashProgrammer-debug [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff15866c0 (LWP 31615)] [New Thread 0x7ffff0d856c0 (LWP 31616)] [New Thread 0x7fffebfff6c0 (LWP 31617)]

Thread 1 "UsbdmFlashProgr" received signal SIGSEGV, Segmentation fault. 0x00007ffff7f6b54c in ?? () from /usr/lib/x86_64-linux-gnu/usbdm/libusbdm-device-database-debug.so.4 (gdb) bt

0 0x00007ffff7f6b54c in ?? () from /usr/lib/x86_64-linux-gnu/usbdm/libusbdm-device-database-debug.so.4

https://github.com/podonoghue/usbdm-firmware/issues/1 0x00007ffff7f6b597 in ?? () from /usr/lib/x86_64-linux-gnu/usbdm/libusbdm-device-database-debug.so.4 https://github.com/podonoghue/usbdm-firmware/issues/2 0x00007ffff7f65db6 in DeviceDataBase::getDefaultDevice() () from /usr/lib/x86_64-linux-gnu/usbdm/libusbdm-device-database-debug.so.4 https://github.com/podonoghue/usbdm-firmware/issues/3 0x00007ffff7f67e6e in DeviceDataBase::loadDeviceData() () from /usr/lib/x86_64-linux-gnu/usbdm/libusbdm-device-database-debug.so.4 https://github.com/podonoghue/usbdm-firmware/issues/4 0x00005555555c8190 in ?? () https://github.com/podonoghue/usbdm-firmware/issues/5 0x00005555555c70a1 in ?? () https://github.com/podonoghue/usbdm-firmware/issues/6 0x00005555555c76b5 in ?? () https://github.com/podonoghue/usbdm-firmware/issues/7 0x00005555555bd49d in ?? () https://github.com/podonoghue/usbdm-firmware/issues/8 0x00005555555bc2d9 in ?? ()

9 0x00007ffff72a306b in wxAppConsoleBase::OnInit() () from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0

10 0x00005555555bb953 in ?? ()

11 0x00005555555c4adf in ?? ()

12 0x00007ffff731feea in wxEntry(int&, wchar_t**) () from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0

13 0x00005555555bae3e in ?? ()

14 0x00007ffff704618a in __libc_start_call_main (main=main@entry=0x5555555bae1c, argc=argc@entry=1,

argv=argv@entry=0x7fffffffdff8) at ../sysdeps/nptl/libc_start_call_main.h:58

15 0x00007ffff7046245 in __libc_start_main_impl (main=0x5555555bae1c, argc=1, argv=0x7fffffffdff8,

init=, fini=, rtld_fini=, stack_end=0x7fffffffdfe8) at ../csu/libc-start.c:381

16 0x0000555555580501 in ?? ()

(gdb)

podonoghue commented 1 year ago

Hi, Does this happen on launch of the flash programmer or on some operation. I have done a quick clean/build/createDeb/install from scratch on LInux Mint. The flash programmer appears to work OK. Can you:

HondaRulez commented 1 year ago

Hi,

I always do CleanAll before compille or git pull. The app crash at the start.

The new debian system is a clean install without any extra CFlLAGS or so...

because the Flashprogrammer and GDBServer works fine on my old debian system the problem probably related to the GCC12 or maybe to the newer wx libs also something wrong with the build system.

The debug information swapped between the normal and debug versions (on both, old and new Linux) so the normal build contains debug info and the debug version has no any debug info.

the created .deb file contains 2 different vesions and both have no debug info (but the sizes are different)

bin files from the source tree: -rwxr-xr-x 1 fmiku fmiku 3879288 ápr 6 06.31 UsbdmFlashProgrammer-debug -rwxr-xr-x 1 fmiku fmiku 7057312 ápr 6 06.31 UsbdmFlashProgrammer

bin files from the *.deb package tree -rwxr-xr-x 1 fmiku fmiku 538072 ápr 6 06.31 UsbdmFlashProgrammer -rwxr-xr-x 1 fmiku fmiku 689448 ápr 6 06.31 UsbdmFlashProgrammer-debug

Here is the BT from the NON debug app :)

Reading symbols from UsbdmFlashProgrammer... (gdb) run Starting program: /opt/src/usbdm-eclipse-makefiles-build/Programmer/UsbdmFlashProgrammer.x86_64-linux-gnu/UsbdmFlashProgrammer [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff15be6c0 (LWP 51649)] [New Thread 0x7ffff0dbd6c0 (LWP 51650)] [New Thread 0x7fffebfff6c0 (LWP 51651)]

Thread 1 "UsbdmFlashProgr" received signal SIGSEGV, Segmentation fault. 0x00007ffff7f89e86 in DeviceDataBase::getDefaultDevice() () from /usr/lib/x86_64-linux-gnu/usbdm/libusbdm-device-database.so.4 (gdb) bt

0 0x00007ffff7f89e86 in DeviceDataBase::getDefaultDevice() ()

from /usr/lib/x86_64-linux-gnu/usbdm/libusbdm-device-database.so.4

1 0x00007ffff7f900a7 in DeviceDataBase::loadDeviceData() ()

from /usr/lib/x86_64-linux-gnu/usbdm/libusbdm-device-database.so.4

2 0x00005555555b877c in DeviceDataBase::DeviceDataBase (targetType=, this=0x555555788a50)

at ../Shared/src/DeviceData.h:1333

3 DeviceInterface::loadDeviceDatabase (this=this@entry=0x5555557d87c0) at ../Shared/src/DeviceInterface.cpp:21

4 0x00005555555b89da in DeviceInterface::DeviceInterface (this=this@entry=0x5555557d87c0, targetType=)

at ../Shared/src/DeviceInterface.cpp:107

5 0x00005555555b08af in FlashProgrammerApp::parseCommandLine (this=this@entry=0x555555659a40, parser=...)

at src/FlashProgrammerApp.cpp:488

6 0x00005555555b4751 in FlashProgrammerApp::OnCmdLineParsed (this=0x555555659a40, parser=...)

at src/FlashProgrammerApp.cpp:377

7 0x00007ffff72a306b in wxAppConsoleBase::OnInit() () from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0

8 0x00005555555b6008 in FlashProgrammerApp::OnInit (this=0x555555659a40) at src/FlashProgrammerApp.cpp:223

9 0x00007ffff731feea in wxEntry(int&, wchar_t**) () from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0

10 0x000055555557b952 in main (argc=, argv=) at src/FlashProgrammerApp.cpp:107

(gdb)

podonoghue commented 1 year ago

Hi, There should be a Flashprogrammer.log and usbdm.log created in ~/.usbdm from running the debug version of the programmer. Could you post those please.

bye

HondaRulez commented 1 year ago

Hi,

usbdm.log Flashprogrammer.log

HondaRulez commented 1 year ago

I see the access rights are not OK, changed to 644 for files... (Ok, on the old OS)

The original file list... root@d12:/usr/share/usbdm/DeviceData# ls -l total 856 dr-xr-xr-x 2 root root 4096 ápr 6 08.23 ARM -rwxrwx--- 1 root root 1516 2017 júl 3 arm_devices.xml -rwxrwx--- 1 root root 204671 2019 máj 8 arm_kinetis_devices.old -rwxrwx--- 1 root root 209878 2022 aug 6 arm_kinetis_devices.xml -rwxrwx--- 1 root root 28208 2017 júl 3 arm_lpc_devices.xml -rwxrwx--- 1 root root 8953 2020 okt 5 arm_stm_devices.xml dr-xr-xr-x 2 root root 4096 ápr 6 08.23 CFV1 -rwxrwx--- 1 root root 43444 2019 nov 12 cfv1_devices.xml dr-xr-xr-x 2 root root 4096 ápr 6 08.23 CFVx -rwxrwx--- 1 root root 15107 2018 nov 1 cfvx_devices.xml dr-xr-xr-x 2 root root 4096 ápr 6 08.23 DSC -rwxrwx--- 1 root root 31369 2017 júl 3 dsc_devices.xml -rwxrwx--- 1 root root 1646 2016 jún 22 gdb-target.dtd dr-xr-xr-x 3 root root 4096 ápr 6 08.23 HCS08 -rwxrwx--- 1 root root 97332 2022 aug 6 hcs08_devices.xml dr-xr-xr-x 2 root root 4096 ápr 6 08.23 HCS12 -rwxrwx--- 1 root root 116872 2022 máj 29 hcs12_devices.xml -rwxrwx--- 1 root root 6006 2022 máj 29 JTAG_Devices.cfg -rwxrwx--- 1 root root 291 2016 jún 22 kinetis_map.xml -rwxrwx--- 1 root root 580 2016 jún 22 Memory.dtd dr-xr-xr-x 2 root root 4096 ápr 6 08.23 RS08 -rwxrwx--- 1 root root 9243 ápr 5 07.47 rs08_devices.xml dr-xr-xr-x 2 root root 4096 ápr 6 08.23 S12Z -rwxrwx--- 1 root root 20111 2017 júl 3 s12z_devices.xml -rwxrwx--- 1 root root 12272 2017 júl 3 usbdmDeviceSchema.dtd -rwxrwx--- 1 root root 486 2016 jún 22 xinclude.dtd

The app starts but got this message 2 times, then start..

image

podonoghue commented 1 year ago

I will check the script that creates the DEB. The error reporting to user is obviously a bit poor.

I use wxFormbuilder to create the dialogue skeletons. I have clicked too many buttons. It will take a while to track down where these are as I don't want to just change the C++ code as I may need to re-generate files from the .fbp files. bye

HondaRulez commented 1 year ago

Probably not so much ppl using this project under linux :)

BTW, the installscripts need to be more precise about the access rights at least on the Linux distros. as I see the differences on the DEFAULTs getting more and more different on the distributions...

and also take a look why the debug/normal built swapped while compille on Linux.

and ofcos thanks for the support :) Bye

podonoghue commented 1 year ago

Fix done for permissions I hope. The image created now has the permissions explicitly set in the image. I don't believe this is the correct method as there are some options you can set somewhere when building but I'm not familiar with the details. Fix done for wxWidgets warning. At least the only occurrence I could locate. bye

HondaRulez commented 1 year ago

Everything works fine, Thank you :)