Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f35ac27
minimal add function
andreaTP Feb 10, 2026
1c2e434
testing infrastructure
andreaTP Feb 10, 2026
68cd500
tightening
andreaTP Feb 10, 2026
6ea7525
going on
andreaTP Feb 10, 2026
1009f4c
seems going on
andreaTP Feb 10, 2026
7bd34da
going on
andreaTP Feb 11, 2026
12e1217
simplify test module name mangling
andreaTP Feb 11, 2026
cab167b
more opcodes
andreaTP Feb 11, 2026
b56cc49
f32 working
andreaTP Feb 11, 2026
bc9f817
f64 operations
andreaTP Feb 11, 2026
92f12ef
i64
andreaTP Feb 11, 2026
6ac0ee0
fix const tests
andreaTP Feb 11, 2026
3433a99
ignore ignorable assertions in address.wast
andreaTP Feb 11, 2026
af4596c
int_exprs working
andreaTP Feb 11, 2026
5650471
md for next agent
andreaTP Feb 11, 2026
17f30dc
more specs
andreaTP Feb 11, 2026
595799f
drop_keep
andreaTP Feb 11, 2026
1b370fb
minor
andreaTP Feb 11, 2026
ca988f5
initial Java like control flow
andreaTP Feb 11, 2026
13e27bb
more passing tests
andreaTP Feb 11, 2026
3d2c4e7
control flow fixes
andreaTP Feb 12, 2026
b146a77
more control flow passing
andreaTP Feb 12, 2026
90d3eef
br_if
andreaTP Feb 12, 2026
ba4d2c9
wat2wasm compiling
andreaTP Feb 12, 2026
1afc34d
decompiled wabt
andreaTP Feb 12, 2026
55abd5f
risky method splitting
andreaTP Feb 13, 2026
daefa10
br_table passing fully and elems
andreaTP Feb 13, 2026
2fe2271
finalizing the compiler
andreaTP Feb 13, 2026
9d58d8b
wat2wasm only stdin/out
andreaTP Feb 13, 2026
7b29bc9
more debug
andreaTP Feb 13, 2026
866967e
looks working now
andreaTP Feb 13, 2026
1549c86
working wat2wasm
andreaTP Feb 13, 2026
b0693dd
remove unused python scripts
andreaTP Feb 13, 2026
710b4b5
reproducer finished
andreaTP Feb 13, 2026
445448c
instructions to reproduce
andreaTP Feb 13, 2026
a9a832d
zip utility
andreaTP Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions decompiled-wabt/Reproducer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# JDK-8376400 reproducer

This is a self contained reproducer for JDK-8376400.
We keep the pom.wml for conveninece, but it can be reproduced with plain `javac`/`java` executions.

To build: `./build.sh`
To run: `./run.sh`

On Java 18+, or on Java 17 after applying this commit: `f3eb5014aa75af4463308f52f2bc6e9fcd2da36c` the run command completes successfully.

On Java <= 17 the run fails with this error(much down the line):

```
Exception in thread "main" com.dylibso.chicory.runtime.WasmRuntimeException: out of bounds memory access: attempted to access address: 668598272 but limit is: 668598272 and size: 8
at com.dylibso.chicory.runtime.ByteBufferMemory.outOfBoundsException(ByteBufferMemory.java:313)
at com.dylibso.chicory.runtime.ByteBufferMemory.writeLong(ByteBufferMemory.java:424)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_1890(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_1890(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_231(Wat2WasmMachine.java:22513)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_231(Wat2WasmMachine.java:22523)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_224(Wat2WasmMachine.java:22138)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_224(Wat2WasmMachine.java:22152)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_41(Wat2WasmMachine.java:2699)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_41(Wat2WasmMachine.java:3555)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_40(Wat2WasmMachine.java:2488)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_40(Wat2WasmMachine.java:2679)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_21(Wat2WasmMachine.java:678)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_21(Wat2WasmMachine.java:998)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_33(Wat2WasmMachine.java:1758)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_33(Wat2WasmMachine.java:1765)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_1791(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_1791(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.wabt.Wat2WasmMachine.func_18(Wat2WasmMachine.java:191)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call_18(Wat2WasmMachine.java:208)
at com.dylibso.chicory.wabt.Wat2WasmMachine.call(Wat2WasmMachine.java)
at com.dylibso.chicory.runtime.Instance$Exports.lambda$function$0(Instance.java:219)
at com.dylibso.chicory.runtime.Instance.initialize(Instance.java:184)
at com.dylibso.chicory.runtime.Instance.<init>(Instance.java:118)
at com.dylibso.chicory.runtime.Instance$Builder.build(Instance.java:884)
at com.dylibso.chicory.wabt.Wat2Wasm.parse(Wat2Wasm.java:65)
at com.dylibso.chicory.wabt.Wat2Wasm.parse(Wat2Wasm.java:41)
at com.dylibso.chicory.wabt.Main.main(Main.java:8)
```
16 changes: 16 additions & 0 deletions decompiled-wabt/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

DIR="$(cd "$(dirname "$0")" && pwd)"
OUT="$DIR/target/classes"

rm -rf "$OUT"
mkdir -p "$OUT"

javac \
-d "$OUT" \
$(find "$DIR/src/main/java" -name '*.java')

cp -r "$DIR/src/main/resources/"* "$OUT/"

echo "Build complete: $OUT"
71 changes: 71 additions & 0 deletions decompiled-wabt/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dylibso.chicory</groupId>

<artifactId>wabt</artifactId>
<version>999-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Chicory - wabt</name>
<description>wabt tools compiled to pure Java with Chicory</description>

<properties>
<maven.compiler.release>11</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>com.dylibso.chicory</groupId>
<artifactId>annotations</artifactId>
<version>1.6.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.4</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<release>${maven.compiler.release}</release>
<annotationProcessorPaths combine.children="append">
<path>
<groupId>com.dylibso.chicory</groupId>
<artifactId>annotations-processor</artifactId>
<version>1.6.1</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<phase>package</phase>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.dylibso.chicory.wabt.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions decompiled-wabt/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

DIR="$(cd "$(dirname "$0")" && pwd)"
OUT="$DIR/target/classes"

java -cp "$OUT" com.dylibso.chicory.wabt.Main "$@"
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.dylibso.chicory.log;

public class BasicLogger implements Logger {
private static final java.util.logging.Logger LOGGER =
java.util.logging.Logger.getLogger("chicory");

@Override
public void log(Level level, String msg, Throwable throwable) {
LOGGER.log(toJavaLoggerLevel(level), msg, throwable);
}

@Override
public boolean isLoggable(Level level) {
return LOGGER.isLoggable(toJavaLoggerLevel(level));
}

java.util.logging.Level toJavaLoggerLevel(Logger.Level level) {
switch (level) {
case ALL:
return java.util.logging.Level.ALL;
case TRACE:
return java.util.logging.Level.FINEST;
case DEBUG:
return java.util.logging.Level.FINE;
case INFO:
return java.util.logging.Level.INFO;
case WARNING:
return java.util.logging.Level.WARNING;
case ERROR:
return java.util.logging.Level.SEVERE;
case OFF:
return java.util.logging.Level.OFF;
default:
throw new IllegalArgumentException("Unsupported logger level: " + level);
}
}
}
Loading
Loading