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
216 stars 45 forks source link

Crash on writing YAML file with multiple radio IDs #388

Closed hmatuschek closed 11 months ago

hmatuschek commented 11 months ago

Then, there seems to be something about more than one radio id (I have entered a second one for testing purposes), current devel crashes when writing the config with:

Debug in lib/config.cc@371: Using format version 0.12.0. Debug in lib/config.cc@425: Set default radio ID to 'first_id_here'. [...] Debug in lib/radioid.cc@207: Automatically set default radio id to second_id_here. Debug in lib/radioid.cc@207: Automatically set default radio id to second_id_here. Speicherzugriffsfehler (Speicherabzug geschrieben)

That never happened before, qdmr always wrote the ids where they belong. What should I look for, a digital channel entry without an ID or what makes qdmr jump to lib/radioid.cc@207 suddenly? I tried with some older yaml files, happens there as well, so it seems not to be caused by config changes?

(I replaced the ID identifiers, interesting: when writing the config, the second id is set as the default one according to the debug output - when opening the yaml file earlier the first one was reported correctly as the default one.)

Originally posted by @allesand in https://github.com/hmatuschek/qdmr/issues/383#issuecomment-1742177907

allesand commented 11 months ago

Status with current dev branch:

[ 10%] Building CXX object lib/CMakeFiles/libdmrconf.dir/openrtx_codeplug.cc.o /builddir//qdmr/lib/openrtx_codeplug.cc: In member function ‘virtual bool OpenRTXCodeplug::encode(Config*, const Codeplug::Flags&, const ErrorStack&)’: /builddir//qdmr/lib/openrtx_codeplug.cc:978:38: error: ‘class RadioIDList’ has no member named ‘defaultId’ 978 | if (nullptr == config->radioIDs()->defaultId()) { | ^~~~~~~~~ /builddir//qdmr/lib/openrtx_codeplug.cc: In member function ‘virtual bool OpenRTXCodeplug::encodeElements(const Codeplug::Flags&, Codeplug::Context&, const ErrorStack&)’: /builddir//qdmr/lib/openrtx_codeplug.cc:995:46: error: ‘class RadioIDList’ has no member named ‘defaultId’ 995 | header.setAuthor(ctx.config()->radioIDs()->defaultId()->name()); | ^~~~~~~~~ make[2]: *** [lib/CMakeFiles/libdmrconf.dir/build.make:1698: lib/CMakeFiles/libdmrconf.dir/openrtx_codeplug.cc.o] Fehler 1 make[1]: *** [CMakeFiles/Makefile2:170: lib/CMakeFiles/libdmrconf.dir/all] Fehler 2 make: *** [Makefile:156: all] Fehler 2

hmatuschek commented 11 months ago

Ok, give it a try.

allesand commented 11 months ago

Unfortunately, still crashes, but without helpful hints why:

Debug in lib/radio.cc@57: Try to detect radio at Serial interface 'ttyACM3'. Debug in lib/usbserial.cc@90: Try to open Serial interface 'ttyACM3'. Debug in lib/usbserial.cc@124: Opened serial port ttyACM3 with 115200baud. Debug in lib/anytone_interface.cc@307: Anytone: In program-mode now. Debug in lib/anytone_interface.cc@336: Found radio 'D878UV2', version 'V100'. Speicherzugriffsfehler (Speicherabzug geschrieben)

hmatuschek commented 11 months ago

Can you send/attach the YAML file, that causes the crash?

allesand @.***> schrieb am Mo., 9. Okt. 2023, 11:37:

Unfortunately, still crashes, but without helpful hints why:

Debug in @.: Try to detect radio at Serial interface 'ttyACM3'. Debug in @.: Try to open Serial interface 'ttyACM3'. Debug in @.: Opened serial port ttyACM3 with 115200baud. Debug in @.: Anytone: In program-mode now. Debug in @.***: Found radio 'D878UV2', version 'V100'. Speicherzugriffsfehler (Speicherabzug geschrieben)

— Reply to this email directly, view it on GitHub https://github.com/hmatuschek/qdmr/issues/388#issuecomment-1752654551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACE6E52ZBJ7HXASOHAMQCLX6PAXNAVCNFSM6AAAAAA5T353C6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSGY2TINJVGE . You are receiving this because you were assigned.Message ID: @.***>

allesand commented 11 months ago

Tried to strip down to the absolute minimum, still crashes. yaml file attached.

878-with-two-ids-crashes-on-write.yaml.zip

hmatuschek commented 11 months ago

Just to confirm:

dmrconf --verbose encode examples/878-with-two-ids-crashes-on-write.yaml --radio=d878uv examples/878-with-two-ids-crashes-on-write.dfu

works for me.

hmatuschek commented 11 months ago

It may only crash, when using qdmr. I'll check that, once I am home.

allesand commented 11 months ago

Works here, too:

$ ./dmrconf --verbose encode ../../../../Dokumente/878-with-two-ids-crashes-on-write.yaml --radio=d878uv2 ../../../../Dokumente/878-with-two-ids-crashes-on-write.dfu Debug in lib/config.cc@368: Using format version 0.12.0.

It may only crash, when using qdmr. I'll check that, once I am home.

Looks like it. Thanks!

hmatuschek commented 11 months ago

Ok, give it a try. There is still a memory leak, I need to take care of.

allesand commented 11 months ago

Ok, give it a try. There is still a memory leak, I need to take care of.

Works! So "0.12.0" seems to be able to handle my ever growing config now. Cool!

hmatuschek commented 11 months ago

Merged into devel