jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.71k stars 3.39k forks source link

Pandoc: Illegal instruction on Xen machine #10211

Closed JorgeFrias11 closed 1 month ago

JorgeFrias11 commented 1 month ago

I have been facing this issue for a couple of weeks now and I am unable to solve it. I'm using pandoc on a Xen server and when I run:

pandoc -o output.html pandoc -v pandoc --version

The command works sometimes, but sometimes I get the error Illegal instruction. Nothing more. I tried using --verbose but I still get the same output. I tried with different versions and the most recent version that works is pandoc 2.17.1.1

OS: Debian 12 (bookworm) Pandoc version: 2.18 onwards.

I faced the same problem with quarto. It was unable to find the pandoc:

$ quarto check
error: Uncaught (in promise) Error: Unable to determine Pandoc version
            throw new Error(`Unable to determine ${name} version`);
                  ^
    at checkVersion (file:///opt/quarto-1.5.57/bin/quarto.js:101084:19)
    at checkVersions (file:///opt/quarto-1.5.57/bin/quarto.js:101108:5)
    at eventLoopTick (ext:core/01_core.js:153:7)
    at async check (file:///opt/quarto-1.5.57/bin/quarto.js:101066:13)
    at async Command.actionHandler (file:///opt/quarto-1.5.57/bin/quarto.js:101389:5)
    at async Command.execute (file:///opt/quarto-1.5.57/bin/quarto.js:8017:13)
    at async Command.parseCommand (file:///opt/quarto-1.5.57/bin/quarto.js:7907:20)
    at async quarto (file:///opt/quarto-1.5.57/bin/quarto.js:118224:9)
    at async file:///opt/quarto-1.5.57/bin/quarto.js:118244:9
    at async mainRunner (file:///opt/quarto-1.5.57/bin/quarto.js:118128:9)

And running the pandoc binary in quarto

$ /opt/quarto-1.5.57/bin/tools/x86_64/pandoc -v
Illegal instruction
jgm commented 1 month ago

How did you install pandoc? What is the architecture of the machine? (What does uname -a say?)

JorgeFrias11 commented 1 month ago

I tried installing the DEB and the tarball, but I got the same error in both pandoc (and with previous versions too). The pandoc installation with apt-get install pandoc works, but it is the outdated 2.17.1.1 version.

Architecture: Linux xmrflin-testing 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 GNU/Linux

I found a similar issue in the forum #8947.

I am not sure if it is related, but the Xen machine does not show the flag AVX in cat /proc/cpuinfo, although it is shown in the Xen (host) server. Is this flag required for recent pandoc versions, but not for older ones like 2.17.1.1?

jgm commented 1 month ago

You're right that #8947 seems relevant. Perhaps there will be a clue in that discussion. I believe the avx flag is required by more recent versions of the bytestring library, which we depend on. So there may not be much that I can do at this point.

JorgeFrias11 commented 1 month ago

I installed the pandoc 3.1.6 version and it solved the problem! As mentioned #8947, it seems the AVX instructions were not supported in my system, causing this "Illegal instruction" error. Then I just had to create a link from quarto (/opt/quarto-1.5.57/bin/tools/x86_64/pandoc) to this pandoc 3.1.6 version.