0

I am attempting to use pandoc to convert an HTML file to a MediaWiki format. I'm getting the following error. (It is a large file, so it wouldn't surprise me if this is the issue.)

I have googled the error message, but no results I could find seemed sensible/understandable.

pandoc run_faster.html -f html -t mediawiki -s -o run_faster.txt
Stack space overflow: current size 16777216 bytes.
Use `+RTS -Ksize -RTS' to increase it.

What exactly is causing the problem, and how do I fix it?

  • What happened when you followed the suggestion on the third line and what size (in bytes) did you try? pandoc +RTS -K100000000 -RTS run_faster.html -f html -t mediawiki -s -o run_faster.txt A bit of Googling suggests that pandoc needs to compiled with RTS options enabled for this solution to work: cabal install --ghc-options=-rtsopts=all – Mike Fitzpatrick May 5 '16 at 5:16
  • I haven't tried the suggestion on the third line because I was unsure of where to put it in the command and what exactly it might do. I'm afraid you'll need to be more specific with your instructions, because I am on a relatively beginner level with Linux. I'm unfamiliar with +RTS -Ksize -RTS and cabal install --gch-options=-rtsopts=all. I don't understand what either is doing. Note that I use Ubuntu 14.04. @MikeFitzpatrick – David Dale May 5 '16 at 6:20
  • You should insert +RTS -K100000000 -RTS into your command at the position I've suggested in my first comment. This will increase pandoc's stack size from 16777216 bytes to 100000000 bytes iff your copy of pandoc supports rstopts and this will hopefully sidestep your stack size issue. If you get the same error try increasing the stack size further. If you get a different error then your copy of pandoc might not have been compiled with --ghc-options=-rtsopts=all – Mike Fitzpatrick May 5 '16 at 12:58
  • Worked like a charm. I figured it was basically like this, but I wasn't familiar with the command, so it was helpful to have some guidance. If you post this as the answer, @MikeFitzpatrick, I would be happy to accept it. – David Dale May 6 '16 at 1:06
  • I'm glad to hear it worked. Posted as an answer. – Mike Fitzpatrick May 6 '16 at 3:13
0

You can increase the pandoc's default stack size using +RTS -Ksize -RTS in your command as follows:

pandoc +RTS -K100000000 -RTS run_faster.html -f html -t mediawiki -s -o 

This will increase pandoc's stack size from 16,777,216 bytes to 100,000,000 bytes.

If you get the same error try again with a larger stack size.

If you get a different error then your copy of pandoc might not have been compiled with --ghc-options=-rtsopts=all

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.