Problems with SCIFIO

knip
scifio
Tags: #<Tag:0x00007fb882f853a8> #<Tag:0x00007fb882f84d18>

#1

Hi @hinerm,

since the latest update of SCIFIO it seems that I have some problems with mixed up dependencies. I try to read in images which can be read using ImageJ (with SCIFIO) and I get the following stack-trace:

Execute failed: Stack map does not match the one at exception handler 93
Exception Details:
  Location:
    io/scif/ome/formats/OMEXMLFormat$Parser.typedParse(Lio/scif/io/RandomAccessInputStream;Lio/scif/ome/formats/OMEXMLFormat$Metadata;Lio/scif/config/SCIFIOConfig;)V @93: astore
  Reason:
    Type 'io/scif/ome/formats/OMEXMLFormat$OMEXMLHandler' (current frame, locals[7]) is not assignable to 'org/xml/sax/helpers/DefaultHandler' (stack map, locals[7])
  Current Frame:
    bci: @55
    flags: { }
    locals: { 'io/scif/ome/formats/OMEXMLFormat$Parser', 'io/scif/io/RandomAccessInputStream', 'io/scif/ome/formats/OMEXMLFormat$Metadata', 'io/scif/config/SCIFIOConfig', 'java/util/Vector', 'java/util/Vector', 'java/util/Vector', 'io/scif/ome/formats/OMEXMLFormat$OMEXMLHandler' }
    stack: { 'java/io/IOException' }
  Stackmap Frame:
    bci: @93
    flags: { }
    locals: { 'io/scif/ome/formats/OMEXMLFormat$Parser', 'io/scif/io/RandomAccessInputStream', 'io/scif/ome/formats/OMEXMLFormat$Metadata', 'io/scif/config/SCIFIOConfig', 'java/util/Vector', 'java/util/Vector', 'java/util/Vector', 'org/xml/sax/helpers/DefaultHandler' }
    stack: { 'java/io/IOException' }
  Bytecode:
    0x0000000: bb00 0259 b700 033a 04bb 0002 59b7 0003
    0x0000010: 3a05 bb00 0259 b700 033a 062c 1904 b600
    0x0000020: 042c 1905 b600 052c 1906 b600 06bb 0007
    0x0000030: 592c b700 083a 07bb 0009 592a b600 0a2b
    0x0000040: b600 0bb7 000c 3a08 2ab4 000d 1908 1907
    0x0000050: b900 0e03 0019 08b6 000f a700 113a 08bb
    0x0000060: 0011 5912 1219 08b7 0013 bf04 3608 1904
    0x0000070: b600 143a 0919 09b9 0015 0100 9900 4819
    0x0000080: 09b9 0016 0100 c000 173a 0a19 0ab6 0018
    0x0000090: 360b 190a b600 1936 0c15 0815 0ba2 0011
    0x00000a0: 2ab6 001a b600 1b57 8408 01a7 ffee 1905
    0x00000b0: 2bb6 001c 150c 8561 0a65 b800 1db6 001e
    0x00000c0: 57a7 ffb4 1905 b600 1f9a 000d bb00 1159
    0x00000d0: 1220 b700 21bf 2ab6 0022 1223 b900 2402
    0x00000e0: 002c b600 253a 0901 3a0a 1909 c600 0c2c
    0x00000f0: b600 25b6 0026 3a0a 2ab6 000a 1300 27b6
    0x0000100: 0028 c000 273a 0b19 0ac7 0021 190b 2cb6
    0x0000110: 0029 b900 2a02 003a 0a2c bb00 2b59 2ab6
    0x0000120: 000a 190a b700 2cb6 002d 190b 2cb6 0029
    0x0000130: 190a b900 2e03 00a7 000f 3a0c bb00 1159
    0x0000140: 190c b700 30bf 0336 0c15 0c19 0ab9 0031
    0x0000150: 0100 a200 1619 0a2b b600 0b15 0cb9 0032
    0x0000160: 0300 840c 01a7 ffe4 2c19 0ab9 0033 0100
    0x0000170: 9e00 0704 a700 0403 b600 342c b600 3512
    0x0000180: 362c b600 37b8 0038 b900 3903 0057 b1  
  Exception Handler Table:
    bci [55, 90] => handler: 93
    bci [263, 311] => handler: 314
  Stackmap Table:
    full_frame(@93,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123]},{Object[#124]})
    same_frame(@107)
    append_frame(@117,Integer,Object[#125])
    append_frame(@153,Object[#126],Integer,Integer)
    same_frame(@174)
    full_frame(@196,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123],Integer},{})
    same_frame(@214)
    append_frame(@248,Object[#127],Object[#128])
    append_frame(@298,Object[#129])
    same_locals_1_stack_item_frame(@314,Object[#130])
    same_frame(@326)
    append_frame(@329,Integer)
    chop_frame(@360,1)
    same_locals_1_stack_item_frame(@375,Object[#131])
    full_frame(@376,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123],Integer,Object[#127],Object[#128],Object[#129]},{Object[#131],Integer})

2015-10-21 12:27:28,968 : DEBUG : KNIME-Worker-2 : Image Reader : Image Reader : 0:108 : Execute failed: Stack map does not match the one at exception handler 93
Exception Details:
  Location:
    io/scif/ome/formats/OMEXMLFormat$Parser.typedParse(Lio/scif/io/RandomAccessInputStream;Lio/scif/ome/formats/OMEXMLFormat$Metadata;Lio/scif/config/SCIFIOConfig;)V @93: astore
  Reason:
    Type 'io/scif/ome/formats/OMEXMLFormat$OMEXMLHandler' (current frame, locals[7]) is not assignable to 'org/xml/sax/helpers/DefaultHandler' (stack map, locals[7])
  Current Frame:
    bci: @55
    flags: { }
    locals: { 'io/scif/ome/formats/OMEXMLFormat$Parser', 'io/scif/io/RandomAccessInputStream', 'io/scif/ome/formats/OMEXMLFormat$Metadata', 'io/scif/config/SCIFIOConfig', 'java/util/Vector', 'java/util/Vector', 'java/util/Vector', 'io/scif/ome/formats/OMEXMLFormat$OMEXMLHandler' }
    stack: { 'java/io/IOException' }
  Stackmap Frame:
    bci: @93
    flags: { }
    locals: { 'io/scif/ome/formats/OMEXMLFormat$Parser', 'io/scif/io/RandomAccessInputStream', 'io/scif/ome/formats/OMEXMLFormat$Metadata', 'io/scif/config/SCIFIOConfig', 'java/util/Vector', 'java/util/Vector', 'java/util/Vector', 'org/xml/sax/helpers/DefaultHandler' }
    stack: { 'java/io/IOException' }
  Bytecode:
    0x0000000: bb00 0259 b700 033a 04bb 0002 59b7 0003
    0x0000010: 3a05 bb00 0259 b700 033a 062c 1904 b600
    0x0000020: 042c 1905 b600 052c 1906 b600 06bb 0007
    0x0000030: 592c b700 083a 07bb 0009 592a b600 0a2b
    0x0000040: b600 0bb7 000c 3a08 2ab4 000d 1908 1907
    0x0000050: b900 0e03 0019 08b6 000f a700 113a 08bb
    0x0000060: 0011 5912 1219 08b7 0013 bf04 3608 1904
    0x0000070: b600 143a 0919 09b9 0015 0100 9900 4819
    0x0000080: 09b9 0016 0100 c000 173a 0a19 0ab6 0018
    0x0000090: 360b 190a b600 1936 0c15 0815 0ba2 0011
    0x00000a0: 2ab6 001a b600 1b57 8408 01a7 ffee 1905
    0x00000b0: 2bb6 001c 150c 8561 0a65 b800 1db6 001e
    0x00000c0: 57a7 ffb4 1905 b600 1f9a 000d bb00 1159
    0x00000d0: 1220 b700 21bf 2ab6 0022 1223 b900 2402
    0x00000e0: 002c b600 253a 0901 3a0a 1909 c600 0c2c
    0x00000f0: b600 25b6 0026 3a0a 2ab6 000a 1300 27b6
    0x0000100: 0028 c000 273a 0b19 0ac7 0021 190b 2cb6
    0x0000110: 0029 b900 2a02 003a 0a2c bb00 2b59 2ab6
    0x0000120: 000a 190a b700 2cb6 002d 190b 2cb6 0029
    0x0000130: 190a b900 2e03 00a7 000f 3a0c bb00 1159
    0x0000140: 190c b700 30bf 0336 0c15 0c19 0ab9 0031
    0x0000150: 0100 a200 1619 0a2b b600 0b15 0cb9 0032
    0x0000160: 0300 840c 01a7 ffe4 2c19 0ab9 0033 0100
    0x0000170: 9e00 0704 a700 0403 b600 342c b600 3512
    0x0000180: 362c b600 37b8 0038 b900 3903 0057 b1  
  Exception Handler Table:
    bci [55, 90] => handler: 93
    bci [263, 311] => handler: 314
  Stackmap Table:
    full_frame(@93,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123]},{Object[#124]})
    same_frame(@107)
    append_frame(@117,Integer,Object[#125])
    append_frame(@153,Object[#126],Integer,Integer)
    same_frame(@174)
    full_frame(@196,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123],Integer},{})
    same_frame(@214)
    append_frame(@248,Object[#127],Object[#128])
    append_frame(@298,Object[#129])
    same_locals_1_stack_item_frame(@314,Object[#130])
    same_frame(@326)
    append_frame(@329,Integer)
    chop_frame(@360,1)
    same_locals_1_stack_item_frame(@375,Object[#131])
    full_frame(@376,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123],Integer,Object[#127],Object[#128],Object[#129]},{Object[#131],Integer})

java.lang.VerifyError: Stack map does not match the one at exception handler 93
Exception Details:
  Location:
    io/scif/ome/formats/OMEXMLFormat$Parser.typedParse(Lio/scif/io/RandomAccessInputStream;Lio/scif/ome/formats/OMEXMLFormat$Metadata;Lio/scif/config/SCIFIOConfig;)V @93: astore
  Reason:
    Type 'io/scif/ome/formats/OMEXMLFormat$OMEXMLHandler' (current frame, locals[7]) is not assignable to 'org/xml/sax/helpers/DefaultHandler' (stack map, locals[7])
  Current Frame:
    bci: @55
    flags: { }
    locals: { 'io/scif/ome/formats/OMEXMLFormat$Parser', 'io/scif/io/RandomAccessInputStream', 'io/scif/ome/formats/OMEXMLFormat$Metadata', 'io/scif/config/SCIFIOConfig', 'java/util/Vector', 'java/util/Vector', 'java/util/Vector', 'io/scif/ome/formats/OMEXMLFormat$OMEXMLHandler' }
    stack: { 'java/io/IOException' }
  Stackmap Frame:
    bci: @93
    flags: { }
    locals: { 'io/scif/ome/formats/OMEXMLFormat$Parser', 'io/scif/io/RandomAccessInputStream', 'io/scif/ome/formats/OMEXMLFormat$Metadata', 'io/scif/config/SCIFIOConfig', 'java/util/Vector', 'java/util/Vector', 'java/util/Vector', 'org/xml/sax/helpers/DefaultHandler' }
    stack: { 'java/io/IOException' }
  Bytecode:
    0x0000000: bb00 0259 b700 033a 04bb 0002 59b7 0003
    0x0000010: 3a05 bb00 0259 b700 033a 062c 1904 b600
    0x0000020: 042c 1905 b600 052c 1906 b600 06bb 0007
    0x0000030: 592c b700 083a 07bb 0009 592a b600 0a2b
    0x0000040: b600 0bb7 000c 3a08 2ab4 000d 1908 1907
    0x0000050: b900 0e03 0019 08b6 000f a700 113a 08bb
    0x0000060: 0011 5912 1219 08b7 0013 bf04 3608 1904
    0x0000070: b600 143a 0919 09b9 0015 0100 9900 4819
    0x0000080: 09b9 0016 0100 c000 173a 0a19 0ab6 0018
    0x0000090: 360b 190a b600 1936 0c15 0815 0ba2 0011
    0x00000a0: 2ab6 001a b600 1b57 8408 01a7 ffee 1905
    0x00000b0: 2bb6 001c 150c 8561 0a65 b800 1db6 001e
    0x00000c0: 57a7 ffb4 1905 b600 1f9a 000d bb00 1159
    0x00000d0: 1220 b700 21bf 2ab6 0022 1223 b900 2402
    0x00000e0: 002c b600 253a 0901 3a0a 1909 c600 0c2c
    0x00000f0: b600 25b6 0026 3a0a 2ab6 000a 1300 27b6
    0x0000100: 0028 c000 273a 0b19 0ac7 0021 190b 2cb6
    0x0000110: 0029 b900 2a02 003a 0a2c bb00 2b59 2ab6
    0x0000120: 000a 190a b700 2cb6 002d 190b 2cb6 0029
    0x0000130: 190a b900 2e03 00a7 000f 3a0c bb00 1159
    0x0000140: 190c b700 30bf 0336 0c15 0c19 0ab9 0031
    0x0000150: 0100 a200 1619 0a2b b600 0b15 0cb9 0032
    0x0000160: 0300 840c 01a7 ffe4 2c19 0ab9 0033 0100
    0x0000170: 9e00 0704 a700 0403 b600 342c b600 3512
    0x0000180: 362c b600 37b8 0038 b900 3903 0057 b1  
  Exception Handler Table:
    bci [55, 90] => handler: 93
    bci [263, 311] => handler: 314
  Stackmap Table:
    full_frame(@93,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123]},{Object[#124]})
    same_frame(@107)
    append_frame(@117,Integer,Object[#125])
    append_frame(@153,Object[#126],Integer,Integer)
    same_frame(@174)
    full_frame(@196,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123],Integer},{})
    same_frame(@214)
    append_frame(@248,Object[#127],Object[#128])
    append_frame(@298,Object[#129])
    same_locals_1_stack_item_frame(@314,Object[#130])
    same_frame(@326)
    append_frame(@329,Integer)
    chop_frame(@360,1)
    same_locals_1_stack_item_frame(@375,Object[#131])
    full_frame(@376,{Object[#118],Object[#119],Object[#120],Object[#121],Object[#122],Object[#122],Object[#122],Object[#123],Integer,Object[#127],Object[#128],Object[#129]},{Object[#131],Integer})

    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
    at java.lang.Class.getConstructor0(Class.java:3075)
    at java.lang.Class.newInstance(Class.java:412)
    at io.scif.AbstractFormat.createObject(AbstractFormat.java:216)
    at io.scif.AbstractFormat.createContextualObject(AbstractFormat.java:177)
    at io.scif.AbstractFormat.createParser(AbstractFormat.java:130)

Any idea where this comes from? Again, it seems like dependency conflicts?

Christian


#2

Can you determine what is providing this class in your runtime? Options include: JRE, batik, xml-apis

Can you share the image? If not, can you try to reproduce in Fiji? (File>Import>Image... will force use of SCIFIO)


#3

I can share the image for sure:

https://depot.uni-konstanz.de/cgi-bin/exchange.pl?g=nt53wt8xcv

DefaultHandler comes from xml-apis-1.4.01.jar


#4

As already mentoined, I can’t reproduce in FIJI using SCIFIO. The image gets loaded (even if the first channel seems to be wrong somehow).


#5

so in Fiji, I think the DefaultHandler comes from the JRE (rt.jar). there may be a hack in Fiji to prefer the JRE version over xml-apis.

I was able to delete xml-apis and batik and still open the image properly (using both Java 7 and 8).

So what if you exclude xml-apis from your runtime environment…?


#6

yeah I could do that (probably). But it feels wrong, as scifio-bf-compat has a maven dependency on xml-apis?


#7

The xml-apis dependency is transitive, inherited from Bio-Formats. And that dependency is highly questionable. See SO #11677572 for details.

In short: we need to thoroughly examine our usage of XML APIs and dependencies, and “do the right thing” in all cases to avoid these sorts of problems. And we definitely want to purge any undesirable hacks which were introduced solely to work around the fact that we are not doing the right thing in our distribution.


#8

Indeed. @dietzc I was just suggesting excluding xml-apis as a troubleshooting step to determine if that is the cause of the exception.

Also since this is behavior that you said used to work it may be also be worth pinning to older Bio-Formats versions (which may pull in older xml-apis)… as nothing has changed in this area in SCIFIO itself (just transitive stuff through Bio-Formats)


#9

brrr :wink: OK I will try it. Thanks for the help!!


#10

I removed xml-apis and now I can read in the images again. However, now another .lsm file can’t be read in anymore. This file is confidential, thats why I sent it to you in person.


#11

and fixed. the second bug was introduced with a fix I tried before I removed the xml-apis. Thanks for your help mark.
For all others please also see: https://github.com/scifio/scifio/commit/4b24edc8bb40320bfaadccae8b69383c66c8eba5

@hinerm was so kind to fix the error message related to another problem which came up.

Long story short: Removed xml-apis and it works.