AMC-detect has an infinite loop on arm/arm64 (Bug #661)
Description
As reported here: https://project.auto-multiple-choice.net/boards/4/topics/3212?r=8625 for arm and observed by myself for arm64, the AMC-detect program seems to take forever to run.
I investigated it on AMC 1.4.0 on Armbian bionic arm64 (Olimex image), recompiled it with -g flag and found with gdb that it was always running getopt.
The problem is the char c; declaration which is on line 1073 on master.
On arm and arm64, char is unsigned so when getopt returns -1, it is converted to 254 and then compares different to -1. As a consequence, the loop never ends.
I attach a patch making this modification on the code in master.
I tested this modification successfully on AMC 1.4.0 with Armbian bionic arm64.
History
Updated by Alexis Bienvenüe about 5 years ago
Thanks for the report and solution!
The bug has been fixed in the development version since git:ebb4c61e.
- Status changed from New to Resolved
- % Done changed from 0 to 100
Updated by Alexis Bienvenüe almost 4 years ago
- Status changed from Resolved to Closed
- Target version set to 1.5.0