Menu

#754 FreeBSD/ARM64: GraphicsMagick 1.3.43 reproducibly fails with "Too many args to microtask: 17!"

v1.0_(example)
closed-invalid
5
2025-05-17
2025-03-27
No

Steps to reproduce the problem (on FreeBSD, ARM64 architecture):

gm convert -size 128x128 xc:yellow test.png
gm convert test.png -gravity center -extent 512x512 test2.png

Expected result:

"gm convert" creates test2.png, which would be the content of test.png embedded into a larger frame.

Observed result:

The second command fails on ARM64 (but works fine in x86):
$ gm convert test.png -gravity center -extent 512x512 test2.png
Too many args to microtask: 17!
Too many args to microtask: 17!
...
(64 repetitions)

Some debugging:

The machine has 64 cores (using QEMU, not a real ARM64 CPU). Due to the 64 repetitions, I just tried to limit the number of threads:

OMP_NUM_THREADS=1 gm convert test.png -gravity center -extent 512x512 test2.png
-> this works!

$ OMP_NUM_THREADS=2 gm convert test.png -gravity center -extent 512x512 test2.png
Too many args to microtask: 17!
Too many args to microtask: 17!
-> this fails, with 2 repetitions of the error message.

=> Something seems to be wrong with GraphicsMagick's multi-threading on ARM64.

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2025-03-28

    I see that Mikael Urankar has proposed a patch for FreeBSD's OpenMP implementation.

    To verify that the issue is not in GraphicsMagick itself, I suggest determining if an older GraphicsMagick version (e.g. 1.3.41) does work on the same OS version. Then provide the output of 'gm convert -version' for the version which works, and the version which does not. The most interesting part of the output would be the LIBS specification.

    The GraphicsMagick configure script was significantly re-worked after 1.3.41 in order to use pkg-config data, and including OpenMP linkage dependencies.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2025-03-28

    Based on searching the web for "Too many args to microtask", it seems that perhaps LLVM ('Clang') and libomp are being used, and there is a disagreement between LLVM generated code (producing 17 arguments) and what libomp is willing to handle. Updates were made in LLVM which expect to be able to produce up to 17 arguments but perhaps the dispatcher for microtask supports something smaller (e.g. 15). It seems that a similar problem has been solved multiple times (since 2016).

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2025-03-31
    • status: open --> pending
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2025-03-31

    I believe that this issue is an issue with the FreeBSD run time environment and not with GraphicsMagick. There is a mismatch in the implementation which leads to the error report (which is not produced by GraphicsMagick).

    I will close this issue sometime in the future if no information is produced to indicate that the issue is due to something in GraphicsMagick.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2025-05-17
    • status: pending --> closed-invalid
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2025-05-17

    This issue is due to an operating system library (OpenMP) implementation bug and not due to GraphicsMagick.

     

Log in to post a comment.

MongoDB Logo MongoDB