Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on writing YAML file with multiple radio IDs #388

Closed
hmatuschek opened this issue Oct 5, 2023 · 11 comments
Closed

Crash on writing YAML file with multiple radio IDs #388

hmatuschek opened this issue Oct 5, 2023 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@hmatuschek
Copy link
Owner

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 #383 (comment)

@hmatuschek hmatuschek self-assigned this Oct 5, 2023
@hmatuschek hmatuschek added the bug Something isn't working label Oct 5, 2023
hmatuschek added a commit that referenced this issue Oct 5, 2023
@allesand
Copy link

allesand commented Oct 7, 2023

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
Copy link
Owner Author

Ok, give it a try.

@allesand
Copy link

allesand commented Oct 9, 2023

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
Copy link
Owner Author

hmatuschek commented Oct 9, 2023 via email

@allesand
Copy link

allesand commented Oct 9, 2023

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

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

@hmatuschek
Copy link
Owner Author

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
Copy link
Owner Author

hmatuschek commented Oct 9, 2023

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

@allesand
Copy link

allesand commented Oct 9, 2023

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 added a commit that referenced this issue Oct 9, 2023
…ore codeplug was encoded in binary format. Addresses #388.
@hmatuschek
Copy link
Owner Author

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

@allesand
Copy link

allesand commented Oct 9, 2023

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 added a commit that referenced this issue Oct 9, 2023
hmatuschek added a commit that referenced this issue Oct 9, 2023
* Added unit test, addresses #388.
* Moved default DMR radio ID to radio settings.
* Fixed mem. leak. Addresses #388.
@hmatuschek
Copy link
Owner Author

Merged into devel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants