sbsdev / daisyproducer

An integrated production management system for accessible media
GNU Affero General Public License v3.0
5 stars 3 forks source link

dtbook-to-odt hangs with math #11

Closed egli closed 7 years ago

egli commented 7 years ago

When translating a fairly complicated Math book the conversion hangs, see https://gist.github.com/egli/82d086ed9a0fefc92394541dd4ff1546. It hangs regardless of whether it is invoked via Daisyproducer or directly via the command line. If math is disabled it works like a charm.

egli commented 7 years ago

Bert suspects that this could be a problem with the asciimath handling. This is a piece of Javascript code and in Java8 the Javascript engine has changed:

about the asciimath thing see what the difference is between java 7 and java 8 in terms of javascript engine and, if it is like i suspect, namely that 7 uses rhino and 8 nashorn then maybe you have to explicitly use rhino? i found an article about it: https://wiki.openjdk.java.net/display/Nashorn/Using+Rhino+JSR-223+engine+with+JDK8

egli commented 7 years ago

When running the pipeline2 from the command line with

su pipeline2 -s /opt/daisy-pipeline2/bin/pipeline2

and then converting with

eglic@xmlp01:~$ /opt/daisy-pipeline2-cli/dp2 sbs:dtbook-to-odt --source /tmp/daisyproducer-3H6EW7/30309.xml --images DROP --asciimath BOTH --output test-results2

it produces an odt file.

Also when invoking the thing via the web interface (connecting to the pipeline2 that was started like above) an odt file is returned

egli commented 7 years ago

OK, the whole thing also works when invoking the standard way, i.e. via Daisyproducer Web Interface and the pipeline2 has been started via sv start daisy-pipeline.

I'm using the book in question (Mathematik 3. Arbeitsheft II), the same that was used in the gist.

It works for all three math options: Both, AsciiMath and MathML

egli commented 7 years ago

In other words: Looks like I can no longer reproduce the problem

egli commented 7 years ago

Haha, the asciimath was commented out in the dtbook-to-odt module. No wonder it worked

egli commented 7 years ago

I extracted the formulas in a gist

bertfrees commented 7 years ago

@egli I created a unit test in asciimath-utils, but I can not make it fail on my Debian container (Stretch + openjdk-8-jdk package). I also tried running the whole book.

egli commented 7 years ago

see https://gist.github.com/egli/54367184ebf4c80fbbdf26339cae2b9f for another extensive log

egli commented 7 years ago

The Unit Tests pass on the server machine, so maybe it isn't a problem with asciimath after all.

And consequently switching Rhino for Nashorn wouldn't even help

egli commented 7 years ago

The problem was actually a deadlock in PushNotifier.java

egli commented 7 years ago

Fixed in sbsdev/pipeline@86537c75a9a1fdf74cdb2bb178f09792336fd997

egli commented 7 years ago

@bertfrees would you mind merging this stuff into the sbs branch? Thanks

bertfrees commented 7 years ago

Done