java.lang.IndexOutOfBoundsException: Index: 0 with graphviz 2.40.1

0 votes
asked Jul 27, 2021 in Bug by kohtala (140 points)

Using the plantuml/plantuml-server:jetty-v1.2021.7 image as well as an image I compiled from the latest source on github for 1.2021.9 plantuml, I get exception. I do not the exception running the 1.2021.9 plantuml.jar on Ubuntu 20.04.2 LTS with graphviz 2.42.2-3build2 where strangely enough dot -V reports graphviz version 2.43.0 (0)

To reproduce, I mounted the latest plantuml.jar and diagram source into the docker container and executed there

jetty@49949750aca0:/tmp$ java -jar /plantuml.jar -tsvg vdjm.plantuml
Exception java.lang.IndexOutOfBoundsException: Index: 0
net.sourceforge.plantuml.cucadiagram.UnparsableGraphvizException: java.lang.IndexOutOfBoundsException: Index: 0
        at net.sourceforge.plantuml.svek.GeneralImageBuilder.buildImage(GeneralImageBuilder.java:481)
        at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(CucaDiagramFileMakerSvek.java:102)
        at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(CucaDiagramFileMakerSvek.java:67)
        at net.sourceforge.plantuml.cucadiagram.CucaDiagram.exportDiagramInternal(CucaDiagram.java:639)
        at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:144)
        at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:157)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(PSystemUtils.java:233)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:89)
        at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:171)
        at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:527)
        at net.sourceforge.plantuml.Run.processArgs(Run.java:410)
        at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:377)
        at net.sourceforge.plantuml.Run.main(Run.java:205)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0
        at java.base/java.util.Collections$EmptyList.get(Unknown Source)
        at net.sourceforge.plantuml.svek.SvekUtils.getMinX(SvekUtils.java:85)
        at net.sourceforge.plantuml.svek.DotStringFactory.solve(DotStringFactory.java:391)
        at net.sourceforge.plantuml.svek.GeneralImageBuilder.buildImage(GeneralImageBuilder.java:475)
        ... 12 more

jetty@49949750aca0:/tmp$ java -jar /plantuml.jar -version
PlantUML version 1.2021.9 (Sun Jul 25 10:13:56 UTC 2021)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: null

PLANTUML_LIMIT_SIZE: 4096

Dot version: dot - graphviz version 2.40.1 (20161225.0304)
Installation seems OK. File generation OK

The cyphered source that was able to reproduce the problem is

@startuml vdjm

state ouwytfp {
    state whctqpbh
    state colzcimiwss {
        state saeeblh
        state tfiwij
        state anrzlcsp
    }
    whctqpbh --> colzcimiwss : gifuurtrqtqazgojgtkigd
}

state cizslvns {
    state ahfepoqbxiqlev
    state ccgpgnuj
    state stop <<entryPoint>>
    state stop_syhegge
    state ctyygnlpdsi <<entryPoint>>
    stop -> ahfepoqbxiqlev
    ctyygnlpdsi -> ccgpgnuj
    ahfepoqbxiqlev -> ccgpgnuj : trpgcpfpubxrpmslhnozrch
    ahfepoqbxiqlev -> stop_syhegge : trpgcpfpubxrpmslhnozrch
    ccgpgnuj -> stop_syhegge : trpgcpfpubxrpmslhnozrch
}

state diyg {
    state qfahki <<entryPoint>>
    state sucmbse <<entryPoint>>
    qfahki -> fhemvx
    sucmbse -> mrslsoa
}

diyg : stop /

[*] -> recztbg

recztbg --> ouwytfp : pfokmhgnrboqbdfkodn
recztbg --> stop : lhnl
recztbg --> ctyygnlpdsi : anfi
recztbg --> dswslteliezkp : trpgcpfpubxrpmslhnozrch
recztbg --> sucmbse : trpgcpfpubxrpmslhnozrch

ouwytfp --> stop : trpgcpfpubxrpmslhnozrch
ouwytfp : gifuurtrqtqazgojgtkigd
ouwytfp --> qfahki : gpnjojr
ouwytfp --> diyg : gifuurtrqtqazgojgtkigd

dswslteliezkp --> stop : trpgcpfpubxrpmslhnozrch
dswslteliezkp --> ouwytfp : pfokmhgnrboqbdfkodn
dswslteliezkp --> diyg : nnyioifolwcdepek
dswslteliezkp : nnyioifolwcdepek

cizslvns -> diyg : nnyioifolwcdepek
stop_syhegge --> qfahki

diyg --> dswslteliezkp : anfi

@enduml

commented Jul 30, 2021 by kohtala (140 points)

I built new base images (openjdk + jetty) to start on Debian 11 bullseye for newer graphviz, but while it does not happen to crash on this, the output still is not without some strange artefacts.

(Bullseye is planned to release on 2021-08-14.)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...