Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8260705

jextract crash with libbart's types.h

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      The jextract crash is as follows:

      jextract -J-Djextract.debug=true types.h
      WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.jextract
      Invalid size for layout: 0
      java.lang.IllegalArgumentException: Invalid size for layout: 0
      at jdk.incubator.foreign/jdk.incubator.foreign.AbstractLayout.checkSize(AbstractLayout.java:114)
      at jdk.incubator.foreign/jdk.incubator.foreign.AbstractLayout.checkSize(AbstractLayout.java:109)
      at jdk.incubator.foreign/jdk.incubator.foreign.MemoryLayout.ofValueBits(MemoryLayout.java:701)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createVar(TreeMaker.java:254)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createTreeInternal(TreeMaker.java:92)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createTree(TreeMaker.java:81)
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
      at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createScoped(TreeMaker.java:190)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createTreeInternal(TreeMaker.java:99)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createTree(TreeMaker.java:81)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.Parser.lambda$parse$2(Parser.java:86)
      at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
      at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.Parser.parse(Parser.java:67)
      at jdk.incubator.jextract/jdk.incubator.jextract.JextractTool.parse(JextractTool.java:112)
      at jdk.incubator.jextract/jdk.incubator.jextract.JextractTool.run(JextractTool.java:241)
      at jdk.incubator.jextract/jdk.incubator.jextract.JextractTool.main(JextractTool.java:157)

      I reduced the file to minimum test case:

      File: mytypes.h

      typedef const struct typeid_s { int:0; } TYPEID;


      jextract crash for mytypes.h looks as follows:

      jextract -J-Djextract.debug=true mytypes.h
      WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.jextract
      Invalid size for layout: 0
      java.lang.IllegalArgumentException: Invalid size for layout: 0
      at jdk.incubator.foreign/jdk.incubator.foreign.AbstractLayout.checkSize(AbstractLayout.java:114)
      at jdk.incubator.foreign/jdk.incubator.foreign.AbstractLayout.checkSize(AbstractLayout.java:109)
      at jdk.incubator.foreign/jdk.incubator.foreign.MemoryLayout.ofValueBits(MemoryLayout.java:701)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createVar(TreeMaker.java:254)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createTreeInternal(TreeMaker.java:92)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createTree(TreeMaker.java:81)
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
      at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createScoped(TreeMaker.java:190)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createTreeInternal(TreeMaker.java:99)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.TreeMaker.createTree(TreeMaker.java:81)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.Parser.lambda$parse$2(Parser.java:86)
      at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
      at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
      at jdk.incubator.jextract/jdk.internal.jextract.impl.Parser.parse(Parser.java:67)
      at jdk.incubator.jextract/jdk.incubator.jextract.JextractTool.parse(JextractTool.java:112)
      at jdk.incubator.jextract/jdk.incubator.jextract.JextractTool.run(JextractTool.java:241)
      at jdk.incubator.jextract/jdk.incubator.jextract.JextractTool.main(JextractTool.java:157)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sundar Sundararajan Athijegannathan
              Reporter:
              sundar Sundararajan Athijegannathan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: