jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.08k stars 3.35k forks source link

Fedora: One markdown file fails to convert after update #4461

Closed Devices closed 6 years ago

Devices commented 6 years ago

Setup:

Commands to reproduce the problem:

  1. pandoc ruhle_1928_karl_marx_life_and_work.md -s -t ms -o ruhletest.pdf
  2. pandoc ruhle_1928_karl_marx_life_and_work.md -s -o ruhletest.html
  3. pandoc ruhle_1928_karl_marx_life_and_work.md -s -o ruhletest.mobi
  4. pandoc ruhle_1928_karl_marx_life_and_work.md -s -o ruhletest.epub

File in question: ruhle_1928_karl_marx_life_and_work.txt Note: Since github does not support the .md extension, I have attached it as a txt file. Rename the file.

Output: fish: “pandoc ruhle_1928_karl_marx_lif…” terminated by signal SIGSEGV (Address boundary error) Usually it also freezes my server for a while until it terminates. Note: fish is my shell.

Elaboration: I was using pandoc version 2.0.0.1 before from that copr repo, but after the update to 2.1.1 I get the error listed under 'output'. I convert about 250 other markdown files at once and this is the only file that produces this error after the upgrade to 2.1.1.

When I use pandoc 1.19.1 in the official fedora repo's I also do not get an error when running the commands. Except command 1, since 1.19 does not have pdfgroff support yet.

I also performed the command with strace, maybe it is helpful. pandoc_strace.txt

Summary: 1.19.1 and 2.0.0.1 convert the markdown file fine, but since 2.1.1 it produces an error.

If more information is required I'd be happy to provide it if it's within my capabilities. I am not a programmer and not very good at things like compiling.

mb21 commented 6 years ago

Can you try with an official build: https://github.com/jgm/pandoc/releases

Devices commented 6 years ago

I downloaded pandoc-2.1.2-linux.tar.gz, extracted it and ran the command ./pandoc ruhle_1928_karl_marx_life_and_work.md -s -t ms -o ruhletest.pdf and got the same output as in the top post.

mb21 commented 6 years ago

also -o ruhletest.html ?

I cannot reproduce this on macOS...

mb21 commented 6 years ago

Could you also try a different shell maybe?

Devices commented 6 years ago

I tried converting to .html using fish and also bash and they both fail. Using bash I get a different output: "Segmentation fault (core dumped)".

mb21 commented 6 years ago

Strange... but other conversions work? e.g. echo test | pandoc -o test.html

Sounds like its Fedora-specific (or possibly Linux-specific). I guess you could try building from source

Devices commented 6 years ago

Yes other conversions work, it's only this file that causes a problem for me. I convert an entire repository with markdown files to html, pdf, epub and mobi (this one: https://github.com/redtexts/texts) and all conversions go fine, except this one file.

The file does convert with the two other pandoc versions I listed on the same OS, so I figured there must be something new introduced in 2.1.

Also I just tried converting the file on Solus with the official 2.1.2 build and that works fine. Seems like it's maybe indeed be Fedora specific. I don't have other Fedora machines to test on though.

Devices commented 6 years ago

Small update.

I spun up another Fedora 27 server on vultr (where my other server is too) and I get the same error when converting that file while other files work.

I also spun up an ubuntu 16.04 server and the file did convert there. I used the official 2.1.2 build for both OSs.

Seems like we have two OS (Solus, Ubuntu 16.04) where it works so far and one (Fedora 27) where it does not.

mb21 commented 6 years ago

Our official build is created on Debian (or Ubuntu) so it's not that surprising... from INSTALLING:

If you use an RPM-based distro, you may be able to install the deb from our download page using alien.

Or as I mentioned: building from source should work fine.

jgm commented 6 years ago

Do all of these commands produce the problem with this file, or just one of them?

  1. pandoc ruhle_1928_karl_marx_life_and_work.md -s -t ms -o ruhletest.pdf
  2. pandoc ruhle_1928_karl_marx_life_and_work.md -s -o ruhletest.html
  3. pandoc ruhle_1928_karl_marx_life_and_work.md -s -o ruhletest.mobi
  4. pandoc ruhle_1928_karl_marx_life_and_work.md -s -t ms -o ruhletest.epub

Note: pandoc does not support 'mobi' output, so command 3 is just going to produce html.

Devices commented 6 years ago

Or as I mentioned: building from source should work fine.

The 2.1.1 package in that copr repo is also build from source, isn't it? Or would building it on my own server make a difference?

Do all of these commands produce the problem with this file, or just one of them?

All of them.

Note: pandoc does not support 'mobi' output, so command 3 is just going to produce html.

This is good to know, thanks.

mb21 commented 6 years ago

Or would building it on my own server make a difference?

It just might, since the libraries linked against (and other system-specific stuff) might be different on your system...

ousia commented 6 years ago

@Devices,

I’m using both Fedora 27 (64bit & 8GB RAM) and pandoc-2.1.1 from @juhp’s repo.

I can generate both ePub and HTML outputs perfectly fine. I don’t have LaTeX installed on my system.

Just in case it helps.

ousia commented 6 years ago

I also have ghc-pandoc-types and ghc-pandoc-types-devel installed, but I don’t think this should affect to the problem you describe.

juhp commented 6 years ago

Just for the record, when @Devices and I discussed this earlier in private I was not able to reproduce: it is probably worth testing with Fedora 28 too which is approaching Beta, and ships with pandoc-2.0.6.

@Devices, you could try building my previous srpm or I can spin up a 2.0 Copr repo.