AMC-detect has an infinite loop on arm/arm64 (Bug #661)


Added by Guillaume Sergent over 4 years ago. Updated about 3 years ago.


Status:Closed Start date:09/12/2019
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:-
Target version:1.5.0

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.


eliminate-infinite-loop-on-arm.diff (466 Bytes) Guillaume Sergent, 09/12/2019 11:43 pm


History

Updated by Alexis Bienvenüe over 4 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 about 3 years ago

  • Status changed from Resolved to Closed
  • Target version set to 1.5.0

Also available in: Atom PDF