hmatuschek / qdmr

A GUI application for configuring and programming cheap DMR radios under Linux and MacOS X.
https://dm3mat.darc.de/qdmr/
GNU General Public License v3.0
223 stars 46 forks source link

Uploading a codeplug with APRS defined causes crash (DMR-6X2UV) #469

Closed jancona closed 2 months ago

jancona commented 2 months ago

In version 0.12.0, when I add an APRS configuration and attempt to write it to my DMR-6X2UV, QDMR crashes in both Linux and MacOS.

Steps to reproduce:

See attached coredump and console log below.

Linux coredump.log

$ ./build/src/qdmr
Debug in src/application.cc@1002: Set icon theme to 'light'.
Debug in src/application.cc@81: Search for translation in '/usr/local/share/locale/en_US/LC_MESSAGES'.
Debug in src/application.cc@81: Search for translation in '/usr/local/share/locale/en/LC_MESSAGES'.
Debug in src/repeaterbookcompleter.cc@329: Loaded repeater cache of 14 entries.
Debug in lib/userdatabase.cc@132: Loaded user database with 264750 entries from /home/jim/.local/share/DM3MAT/qdmr/user.json.
Debug in lib/talkgroupdatabase.cc@140: Loaded talk group database with 1680 entries from /home/jim/.local/share/DM3MAT/qdmr/talkgroups.json.
Debug in src/application.cc@137: Last known position: 43° 0' 0.0" N, 70° 0' 0.0" W
Debug in src/application.cc@189: Create main window using icon theme 'light'.
Debug in src/application.cc@554: Last device is invalid, search for new one.
Debug in lib/usbserial.cc@117: Search for serial port with matching VID:PID 28e9:18a.
Debug in lib/usbserial.cc@124: Found ttyACM0 (USB 28e9:18a).
Debug in lib/usbserial.cc@117: Search for serial port with matching VID:PID 1fc9:94.
Debug in lib/hid_libusb.cc@128: Search for HID interfaces matching VID:PID 15a2:73.
Debug in lib/dfu_libusb.cc@157: Search for DFU devices matching VID:PID 483:df11.
Debug in lib/c7000device.cc@236: Search for C7000 devices matching VID:PID 1206:227.
Debug in lib/usbdevice.cc@258: Check if serial port ttyACM0 still exisist and has VID:PID 28e9:18a.
Debug in lib/radio.cc@61: Try to detect radio at Serial interface 'ttyACM0'.
Debug in lib/usbserial.cc@27: Try to open Serial interface 'ttyACM0'.
Debug in lib/usbserial.cc@72: Opened serial port ttyACM0 with 115200baud.
Debug in lib/anytone_interface.cc@308: Anytone: In program-mode now.
Debug in lib/anytone_interface.cc@337: Found radio 'D6X2UV', version 'V102'.
Debug in lib/anytone_radio.cc@200: Download of 15 bitmaps.
Debug in lib/dmr6x2uv_codeplug.cc@2278: Allocate roaming zone at 1043000
Debug in lib/anytone_interface.cc@357: Anytone: Left program-mode.
Debug in lib/usbserial.cc@105: Serial port will close now.
Debug in lib/usbdevice.cc@258: Check if serial port ttyACM0 still exisist and has VID:PID 28e9:18a.
Debug in lib/usbdevice.cc@258: Check if serial port ttyACM0 still exisist and has VID:PID 28e9:18a.
Debug in lib/radio.cc@61: Try to detect radio at Serial interface 'ttyACM0'.
Debug in lib/usbserial.cc@27: Try to open Serial interface 'ttyACM0'.
Debug in lib/usbserial.cc@72: Opened serial port ttyACM0 with 115200baud.
Debug in lib/anytone_interface.cc@308: Anytone: In program-mode now.
Debug in lib/anytone_interface.cc@337: Found radio 'D6X2UV', version 'V102'.
QObject::moveToThread: Cannot move objects with a parent
Debug in lib/dmr6x2uv_codeplug.cc@2278: Allocate roaming zone at 1043000
Debug in lib/dmr6x2uv_codeplug.cc@2309: Encode roaming zone Roam Zone 1 (1) at 1043000 with 1 elements.
Debug in lib/anytone_interface.cc@357: Anytone: Left program-mode.
Debug in lib/usbserial.cc@105: Serial port will close now.
Debug in src/application.cc@875: Write complete.
double free or corruption (!prev)
Aborted (core dumped)

MacOS

$ qdmr
Debug in src/application.cc@1002: Set icon theme to 'light'.
Debug in src/application.cc@81: Search for translation in '/usr/local/Cellar/qdmr/0.12.0/share/locale/en_US/LC_MESSAGES'.
Debug in src/application.cc@84: Installed translator for locale 'en_US'.
Debug in src/repeaterbookcompleter.cc@329: Loaded repeater cache of 0 entries.
Debug in lib/userdatabase.cc@132: Loaded user database with 264750 entries from /Users/jim/Library/Application Support/DM3MAT/qdmr/user.json.
Debug in lib/talkgroupdatabase.cc@140: Loaded talk group database with 1680 entries from /Users/jim/Library/Application Support/DM3MAT/qdmr/talkgroups.json.
serialnmea: No known GPS device found. Specify the COM port via QT_NMEA_SERIAL_PORT.
Debug in src/application.cc@137: Last known position: 43° 50' 0.0" N, 70° 0' 0.0" W
Debug in src/application.cc@189: Create main window using icon theme 'light'.
Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before constructing QGuiApplication.
Debug in src/application.cc@554: Last device is invalid, search for new one.
Debug in lib/usbserial.cc@117: Search for serial port with matching VID:PID 28e9:18a.
Debug in lib/usbserial.cc@124: Found cu.usbmodem0000000100001 (USB 28e9:18a).
Debug in lib/usbserial.cc@124: Found tty.usbmodem0000000100001 (USB 28e9:18a).
Debug in lib/usbserial.cc@117: Search for serial port with matching VID:PID 1fc9:94.
Debug in lib/dfu_libusb.cc@157: Search for DFU devices matching VID:PID 483:df11.
Debug in lib/c7000device.cc@236: Search for C7000 devices matching VID:PID 1206:227.
Debug in lib/usbdevice.cc@258: Check if serial port tty.usbmodem0000000100001 still exisist and has VID:PID 28e9:18a.
Debug in lib/radio.cc@61: Try to detect radio at Serial interface 'tty.usbmodem0000000100001'.
Debug in lib/usbserial.cc@27: Try to open Serial interface 'tty.usbmodem0000000100001'.
Debug in lib/usbserial.cc@72: Opened serial port tty.usbmodem0000000100001 with 115200baud.
Debug in lib/anytone_interface.cc@308: Anytone: In program-mode now.
Debug in lib/anytone_interface.cc@337: Found radio 'D6X2UV', version 'V102'.
Debug in lib/anytone_interface.cc@357: Anytone: Left program-mode.
Debug in lib/usbserial.cc@105: Serial port will close now.
Debug in lib/usbdevice.cc@258: Check if serial port tty.usbmodem0000000100001 still exisist and has VID:PID 28e9:18a.
Debug in lib/usbdevice.cc@258: Check if serial port tty.usbmodem0000000100001 still exisist and has VID:PID 28e9:18a.
Debug in lib/radio.cc@61: Try to detect radio at Serial interface 'tty.usbmodem0000000100001'.
Debug in lib/usbserial.cc@27: Try to open Serial interface 'tty.usbmodem0000000100001'.
Debug in lib/usbserial.cc@72: Opened serial port tty.usbmodem0000000100001 with 115200baud.
Debug in lib/anytone_interface.cc@308: Anytone: In program-mode now.
Debug in lib/anytone_interface.cc@337: Found radio 'D6X2UV', version 'V102'.
Debug in lib/anytone_radio.cc@200: Download of 15 bitmaps.
Debug in lib/dmr6x2uv_codeplug.cc@2278: Allocate roaming zone at 1043000
Debug in lib/anytone_interface.cc@357: Anytone: Left program-mode.
Debug in lib/usbserial.cc@105: Serial port will close now.
Debug in lib/usbdevice.cc@258: Check if serial port tty.usbmodem0000000100001 still exisist and has VID:PID 28e9:18a.
Debug in lib/usbdevice.cc@258: Check if serial port tty.usbmodem0000000100001 still exisist and has VID:PID 28e9:18a.
Debug in lib/radio.cc@61: Try to detect radio at Serial interface 'tty.usbmodem0000000100001'.
Debug in lib/usbserial.cc@27: Try to open Serial interface 'tty.usbmodem0000000100001'.
Debug in lib/usbserial.cc@72: Opened serial port tty.usbmodem0000000100001 with 115200baud.
Debug in lib/anytone_interface.cc@308: Anytone: In program-mode now.
Debug in lib/anytone_interface.cc@337: Found radio 'D6X2UV', version 'V102'.
QObject::moveToThread: Cannot move objects with a parent
Debug in lib/dmr6x2uv_codeplug.cc@2278: Allocate roaming zone at 1043000
Debug in lib/dmr6x2uv_codeplug.cc@2309: Encode roaming zone Roam Zone 1 (1) at 1043000 with 1 elements.
Debug in lib/anytone_interface.cc@357: Anytone: Left program-mode.
Debug in lib/usbserial.cc@105: Serial port will close now.
Debug in src/application.cc@875: Write complete.
qdmr(90537,0x10c029600) malloc: Heap corruption detected, free list is damaged at 0x6000022d8480
*** Incorrect guard value: 40606149824806912
qdmr(90537,0x10c029600) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6
hmatuschek commented 2 months ago

The crash might be related to issue #467. There is a bug in calculating SMS template offsets. So if you have more than 8 such message templates defined, delete them until a fix is released.

hmatuschek commented 2 months ago

Never mind, that is another issue.

QObject::moveToThread: Cannot move objects with a parent

gives it away and the fact, that dmrconf works.

hmatuschek commented 2 months ago

I fixed the QObject warning in branch 469-dmr-6x2uv-crash-on-upload. I cannot, however, reproduce the crash. Can you send me the YAML file you want to write?

jancona commented 2 months ago

Branch 469-dmr-6x2uv-crash-on-upload does fix the crash for me. I've attached the codeplug I was testing with. codeplug.zip

hmatuschek commented 2 months ago

Ah, okay thanks for letting me know. I'll merge it then into master.