Compare commits

..

No commits in common. "8d16e23383e5ad374f1ff4faa0eb8deae24debc9" and "0b1ac328697fcd4ae545303ef77caaee0ba4b2ec" have entirely different histories.

28 changed files with 166 additions and 2171 deletions

3
.gitignore vendored
View file

@ -33,6 +33,3 @@ build/
### Mac OS ###
.DS_Store
### other
*.bin.gz

View file

@ -16,19 +16,11 @@ public class Main {
}
}
```
Requirements
* java22
* rust
Start rest service
* run it with (adjust paths):
``` bash
cd api; RUST_LOG=info cargo run
```
Start your java with
```
java22 -javaagent:$EXCEPTIONAL_PROJECT/exceptional/agent/target/exceptional-agent-1.0-SNAPSHOT.jar
-Dagentlib="$EXCEPTIONAL_PROJECT/rustlib/target/release/librustlib.dylib"
--enable-preview --enable-native-access=ALL-UNNAMED
-classpath $YOUR_CLASSPATH YourMain
java22 -javaagent:$EXCEPTIONAL_PROJECT/exceptional/agent/target/exceptional-agent-1.0-SNAPSHOT.jar --enable-preview -classpath $YOUR_CLASSPATH Main
```

Binary file not shown.

View file

@ -21,40 +21,14 @@
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.10.5</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
<groupId>org.github.shautvast.exceptional</groupId>
<artifactId>exceptional-lib</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -73,21 +47,14 @@
<Premain-Class>com.github.shautvast.exceptional.Agent</Premain-Class>
<Can-Retransform-Classes>true</Can-Retransform-Classes>
<Can-Redefine-Classes>true</Can-Redefine-Classes>
<Boot-Class-Path>
/Users/Shautvast/dev/exceptional/lib/target/exceptional-lib-1.0-SNAPSHOT.jar
</Boot-Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<argLine>-Dagentlib=${project.basedir}/rustlib/target/release/librustlib.dylib</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -21,22 +21,13 @@ public class Agent {
// add transformer
instrumentation.addTransformer(new ClassFileTransformer() {
@Override
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined,
ProtectionDomain protectionDomain, byte[] classfileBuffer) {
return bytecode(className, classfileBuffer);
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
return instrumentExceptionLoggerAtThrow(className, classfileBuffer);
}
@Override
public byte[] transform(Module module, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
return bytecode(className, classfileBuffer);
}
private static byte[] bytecode(String className, byte[] classfileBuffer) {
if (!className.startsWith("com/fasterxml/jackson")) {
return injectExceptionLoggerBeforeThrow(className, classfileBuffer);
} else {
return classfileBuffer;
}
return instrumentExceptionLoggerAtThrow(className, classfileBuffer);
}
}, true);
}
@ -44,7 +35,7 @@ public class Agent {
/*
* Every throw opcode will be preceded by a call to our ExceptionLogger
*/
private static byte[] injectExceptionLoggerBeforeThrow(String className, byte[] classfileBuffer) {
private static byte[] instrumentExceptionLoggerAtThrow(String className, byte[] classfileBuffer) {
var classFile = ClassFile.of();
var classModel = classFile.parse(classfileBuffer);
return classFile.build(classModel.thisClass().asSymbol(), classBuilder -> {

View file

@ -1,166 +0,0 @@
package com.github.shautvast.exceptional;
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* Circular bytebuffer for variable length entries, that allows concurrent writing, using CAS.
* Multi threaded reading is provided, but:
* - mainly for testing the reliability of the buffer
* - relies on a ReentrantLock, preventing multiple reads at the same read index
*/
public class CircularByteBuffer {
private final AtomicLong readPosition;
private final AtomicLong writePosition;
final ByteBuffer data;
private final int capacity;
private final int readStartPos;
private final int writeStartPos;
private final Lock readLock = new ReentrantLock();
// TODO implement MemorySegment as backing buffer
public CircularByteBuffer(int capacity) {
if (capacity > Integer.MAX_VALUE - 8 || capacity < 0) {
throw new IllegalArgumentException("illegal capacity: " + capacity);
}
this.capacity = capacity; //logical cap is bytebuffer cap - 8. extra space for the read and write pointers so that non-java processes can read it there
this.data = ByteBuffer.allocate(capacity + 8);
readStartPos = capacity; // write values after logical capacity position
writeStartPos = capacity + 4;
this.readPosition = new AtomicLong();
this.writePosition = new AtomicLong();
setReadIndex(0);
setWriteIndex(0);
}
public boolean put(byte[] bytes) {
boolean updatePending = true;
while (updatePending) {
int oldwriteIndex = writePosition.intValue();
int writeIndex = oldwriteIndex;
int len = bytes.length;
int remaining;
// check capacity for bytes to insert
int readIndex = readPosition.intValue();
try {
if (writeIndex >= readIndex) {
remaining = capacity - writeIndex + readIndex;
} else {
remaining = readIndex - writeIndex;
}
if (remaining < len + 2) {
return false;
} else {
int remainingUntilEnd = capacity - writeIndex;
if (remainingUntilEnd < len + 2) {
if (remainingUntilEnd > 1) {
// we can write the length
this.data.putShort(writeIndex, (short) len);
writeIndex += 2;
remainingUntilEnd -= 2;
if (remainingUntilEnd > 0) {
this.data.put(writeIndex, bytes, 0, remainingUntilEnd);
}
writeIndex = 0;
this.data.put(writeIndex, bytes, remainingUntilEnd, len - remainingUntilEnd);
writeIndex += len - remainingUntilEnd;
} else {
// we can write only one byte of the length
this.data.put(writeIndex, (byte) (len >> 8));
writeIndex = 0;
this.data.put(writeIndex, (byte) (len & 0xff));
writeIndex += 1;
this.data.put(writeIndex, bytes);
writeIndex += len;
}
} else {
this.data.putShort(writeIndex, (short) len);
writeIndex += 2;
this.data.put(writeIndex, bytes);
writeIndex += len;
if (writeIndex == this.capacity) {
writeIndex = 0;
}
}
if (writePosition.compareAndSet(oldwriteIndex, writeIndex)) {
this.data.putInt(writeStartPos, writePosition.intValue());
updatePending = false;
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return true;
}
/**
* The reader side is provided, for reference and testability only.
* In practice, the reader is implemented outside of java, see rustlib module
*/
public byte[] get() {
readLock.lock();
int readIndex = readPosition.intValue();
int writeIndex = writePosition.intValue();
if (readIndex == writeIndex) {
return null;
}
int remainingUntilEnd = capacity - readIndex;
int len;
if (remainingUntilEnd == 1) {
byte high = this.data.get(readIndex);
readIndex = 0;
byte low = this.data.get(readIndex);
readIndex += 1;
len = high << 8 | low;
remainingUntilEnd = len;
} else if (remainingUntilEnd == 2) {
len = this.data.getShort(readIndex);
readIndex = 0;
remainingUntilEnd = 0;
} else {
len = this.data.getShort(readIndex);
readIndex += 2;
remainingUntilEnd -= 2;
}
byte[] result = new byte[len];
if (len <= remainingUntilEnd) {
setReadIndex(readIndex + len);
readLock.unlock();
this.data.get(readIndex, result);
} else {
setReadIndex(len - remainingUntilEnd);
readLock.unlock();
this.data.get(readIndex, result, 0, remainingUntilEnd);
this.data.get(0, result, remainingUntilEnd, len - remainingUntilEnd);
}
return result;
}
void setWriteIndex(int i) {
writePosition.set(i);
this.data.putInt(writeStartPos, writePosition.intValue());
}
void setReadIndex(int i) {
readPosition.set(i);
this.data.putInt(readStartPos, readPosition.intValue());
}
int getReadIndex() {
return readPosition.intValue();
}
int getWriteIndex() {
return writePosition.intValue();
}
}

View file

@ -1,18 +0,0 @@
package com.github.shautvast.exceptional;
import org.junit.jupiter.api.Test;
import org.xerial.snappy.Snappy;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
class Compress {
@Test
void compress() throws IOException {
byte[] helloWorld = Snappy.compress("{\"cause\":null,\"stackTrace\":[{\"classLoaderName\":\"app\",\"moduleName\":null,\"moduleVersion\":null,\"methodName\":\"call\",\"fileName\":\"Main.java\",\"lineNumber\":17,\"className\":\"Main\",\"nativeMethod\":false},{\"classLoaderName\":\"app\",\"moduleName\":null,\"moduleVersion\":null,\"methodName\":\"main\",\"fileName\":\"Main.java\",\"lineNumber\":7,\"className\":\"Main\",\"nativeMethod\":false}],\"message\":\"5778\",\"suppressed\":[],\"localizedMessage\":\"5778\"}");
Files.write(Paths.get("hello.snap"), helloWorld);
}
}

View file

@ -1,17 +0,0 @@
package com.github.shautvast.exceptional;
import org.junit.jupiter.api.Test;
import java.time.Duration;
class ExceptionLoggerTest {
@Test
void test() throws InterruptedException {
for (int i = 0; i < 1; i++) {
ExceptionLogger.log(new Throwable());
}
Thread.sleep(Duration.ofSeconds(1));
}
}

View file

@ -1,133 +0,0 @@
package com.github.shautvast.exceptional;
import org.junit.jupiter.api.Test;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.*;
class SingleThreadCircularByteBufferTest {
@Test
void testPutAndGet() {
var buffer = new SingleThreadCircularByteBuffer(9);
byte[] bytes = "hello".getBytes(UTF_8);
boolean written = buffer.put(bytes);
assertTrue(written);
assertArrayEquals(bytes, buffer.get());
assertArrayEquals(new byte[]{0, 5, 104, 101, 108, 108, 111, 0, 0, 0, 0, 0, 7, 0, 0, 0, 7}, buffer.data.array());
}
@Test
void testJustGet() {
var buffer = new SingleThreadCircularByteBuffer(8);
System.out.println(SingleThreadCircularByteBuffer.bytesToString(buffer.get()));
}
@Test
void testPutFitsBeforeGet() {
var buffer = new SingleThreadCircularByteBuffer(14);
var bytes = "hello".getBytes(UTF_8);
buffer.setWriteIndex(7);
buffer.setReadIndex(7);
buffer.put(bytes);
assertArrayEquals(new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 5, 104, 101, 108, 108, 111, 0, 0, 0, 7, 0, 0, 0, 0}, buffer.data.array());
// buffer.setWriteIndex(0);
// end of setup, situation where writeIndex < readIndex
var written = buffer.put(bytes);
assertTrue(written);
assertArrayEquals(new byte[]{0, 5, 104, 101, 108, 108, 111, 0, 5, 104, 101, 108, 108, 111, 0, 0, 0, 7, 0, 0, 0, 7}, buffer.data.array());
assertEquals(7, buffer.getReadIndex());
assertEquals(7, buffer.getWriteIndex());
}
@Test
void testPutFitsNotBeforeGet() {
var buffer = new SingleThreadCircularByteBuffer(13);
var bytes = "hello".getBytes(UTF_8);
buffer.setWriteIndex(6);
buffer.setReadIndex(6);
buffer.put(bytes);
assertArrayEquals(new byte[]{0, 0, 0, 0, 0, 0, 0, 5, 104, 101, 108, 108, 111, 0, 0, 0, 6, 0, 0, 0, 0}, buffer.data.array());
// end of setup, situation where writeIndex < readIndex
boolean written = buffer.put(bytes);
assertFalse(written);
assertArrayEquals(new byte[]{0, 0, 0, 0, 0, 0, 0, 5, 104, 101, 108, 108, 111, 0, 0, 0, 6, 0, 0, 0, 0}, buffer.data.array());
}
@Test
void testWrapAroundPutLenAndOneCharBeforeWrap() {
var buffer = new SingleThreadCircularByteBuffer(9);
var bytes = "hello".getBytes(UTF_8);
buffer.setWriteIndex(6);
buffer.setReadIndex(6);
boolean written = buffer.put(bytes);
assertTrue(written);
assertArrayEquals(new byte[]{101, 108, 108, 111, 0, 0, 0, 5, 104, 0, 0, 0, 6, 0, 0, 0, 4}, buffer.data.array());
assertArrayEquals(bytes, buffer.get());
}
@Test
void testWrapAroundPutLenBeforeWrap() {
var buffer = new SingleThreadCircularByteBuffer(9);
var bytes = "hello".getBytes(UTF_8);
buffer.setWriteIndex(7);
buffer.setReadIndex(7);
var written = buffer.put(bytes);
assertTrue(written);
assertArrayEquals(new byte[]{104, 101, 108, 108, 111, 0, 0, 0, 5, 0, 0, 0, 7, 0, 0, 0, 5}, buffer.data.array());
assertArrayEquals(bytes, buffer.get());
}
@Test
void testWrapAroundPutLenSplitBeforeWrap() {
var buffer = new SingleThreadCircularByteBuffer(9);
var bytes = "hello".getBytes(UTF_8);
buffer.setWriteIndex(8);
buffer.setReadIndex(8);
var written = buffer.put(bytes);
assertTrue(written);
assertArrayEquals(new byte[]{5, 104, 101, 108, 108, 111, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 6}, buffer.data.array());
assertArrayEquals(bytes, buffer.get());
}
@Test
void testNoFreeSpace() {
var buffer = new SingleThreadCircularByteBuffer(9);
var bytes = "hello".getBytes(UTF_8);
boolean written1 = buffer.put(bytes);
assertTrue(written1);
boolean written2 = buffer.put(bytes);
assertFalse(written2); // no space left
}
@Test
void testFreeSpaceReclaimed() {
var buffer = new SingleThreadCircularByteBuffer(9);
assertEquals(0, buffer.getReadIndex());
assertEquals(0, buffer.getWriteIndex());
var bytes = "hello".getBytes(UTF_8);
var written1 = buffer.put(bytes);
assertTrue(written1);
assertEquals(0, buffer.getReadIndex());
assertEquals(7, buffer.getWriteIndex());
assertArrayEquals(bytes, buffer.get());
assertEquals(7, buffer.getReadIndex());
assertEquals(7, buffer.getWriteIndex());
var written2 = buffer.put(bytes);
assertTrue(written2); // the read has freed space
assertEquals(7, buffer.getReadIndex());
assertEquals(5, buffer.getWriteIndex());
assertArrayEquals(bytes, buffer.get());
assertEquals(5, buffer.getReadIndex());
assertEquals(5, buffer.getWriteIndex());
}
}

View file

@ -1,19 +1,25 @@
use axum::extract::State;
use axum::Json;
use tracing::info;
use crate::AppState;
use crate::domain::models::post::StacktraceError;
use crate::handlers::stacktraces::StacktraceResponse;
use crate::infra::repositories::stacktrace_repository;
static mut counter: usize = 0;
pub async fn create_stacktrace(
State(state): State<AppState>,
data: String,
) -> Result<Json<StacktraceResponse>, StacktraceError> {
unsafe {
counter += 1;
}
let new_post_db = stacktrace_repository::NewPostDb {
stacktrace: data,
};
let created_stacktrace = stacktrace_repository::insert(&state.pool, new_post_db)
.await
.map_err(StacktraceError::InfraError)?;

View file

@ -1,58 +0,0 @@
package org.github.shautvast.exceptional;
import com.github.shautvast.exceptional.CircularByteBuffer;
import org.openjdk.jcstress.annotations.Actor;
import org.openjdk.jcstress.annotations.JCStressTest;
import org.openjdk.jcstress.annotations.Outcome;
import org.openjdk.jcstress.annotations.State;
import org.openjdk.jcstress.infra.results.I_Result;
import java.util.concurrent.atomic.AtomicInteger;
import static org.openjdk.jcstress.annotations.Expect.ACCEPTABLE;
/**
* The circular buffer is put under stress to see if it fails basic expectations (what goes in
* must come out
*/
@JCStressTest
@Outcome(id = {"0", "1", "2147483647"}, expect = ACCEPTABLE, desc = "Value is correct, or not set")
@State
public class StressTest {
private final CircularByteBuffer buffer = new CircularByteBuffer(100);
private final AtomicInteger counter = new AtomicInteger(0);
@Actor
public void actor1(I_Result r) {
buffer.put(toBigEndianByteArray(counter.getAndSet(1)));
byte[] bytes = buffer.get();
if (bytes != null) {
r.r1 = fromBigEndianByteArray(bytes);
}
}
@Actor
public void actor2(I_Result r) {
buffer.put(toBigEndianByteArray(counter.getAndSet(Integer.MAX_VALUE)));
byte[] bytes = buffer.get();
if (bytes != null) {
r.r1 = fromBigEndianByteArray(bytes);
}
}
private static byte[] toBigEndianByteArray(int value) {
return new byte[]{
(byte) (value >> 24),
(byte) (value >> 16),
(byte) (value >> 8),
(byte) value
};
}
private static int fromBigEndianByteArray(byte[] bytes) {
return ((bytes[0] & 0xFF) << 24) |
((bytes[1] & 0xFF) << 16) |
((bytes[2] & 0xFF) << 8) |
(bytes[3] & 0xFF);
}
}

View file

@ -6,10 +6,18 @@
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>exceptional-agent</artifactId>
<artifactId>exceptional-lib</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>22</source>
<target>22</target>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
@ -23,34 +31,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>22</source>
<target>22</target>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifestEntries>
<Premain-Class>com.github.shautvast.exceptional.Agent</Premain-Class>
<Can-Retransform-Classes>true</Can-Retransform-Classes>
<Can-Redefine-Classes>true</Can-Redefine-Classes>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<argLine>-Dagentlib=${project.basedir}/rustlib/target/release/librustlib.dylib</argLine>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View file

@ -3,36 +3,37 @@
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>
<parent>
<groupId>org.github.shautvast.exceptional</groupId>
<artifactId>exceptional-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>concurrency-test</artifactId>
<artifactId>exceptional-lib</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jcstress.version>0.16</jcstress.version>
<uberjar.name>jcstress</uberjar.name>
</properties>
<prerequisites>
<maven>3.2</maven>
</prerequisites>
<dependencies>
<dependency>
<groupId>org.openjdk.jcstress</groupId>
<artifactId>jcstress-core</artifactId>
<version>${jcstress.version}</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.github.shautvast.exceptional</groupId>
<artifactId>exceptional-agent</artifactId>
<version>1.0-SNAPSHOT</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.6.2</version>
</dependency>
</dependencies>
@ -41,36 +42,23 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<compilerVersion>22</compilerVersion>
<source>22</source>
<target>22</target>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.4</version>
<executions>
<execution>
<id>main</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${uberjar.name}</finalName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.openjdk.jcstress.Main</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/TestList</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
@ -78,4 +66,5 @@
</plugins>
</build>
</project>

View file

@ -33,17 +33,12 @@ public class CircularBufferWriter implements AutoCloseable {
// setup of native memory ringbuffer
var arena = Arena.ofConfined();
var ringbufferMemory = arena.allocate(32768);
var buffer = new SingleThreadCircularByteBuffer(ringbufferMemory);
var buffer = new CircularByteBuffer(ringbufferMemory);
arena = Arena.ofConfined();
linker = Linker.nativeLinker();
//TODO relative path, or configurable
String agentlibPath = System.getProperty("agentlib");
if (agentlibPath == null) {
System.err.println("Please specify an agent library with -Dagentlib=<path to native agent>");
System.exit(-1);
}
rustlib = SymbolLookup.libraryLookup(agentlibPath, arena);
rustlib = SymbolLookup.libraryLookup(System.getProperty("agentlib"), arena);
MemorySegment create = rustlib.find("buffer_updated").orElseThrow();
var updateHandle = linker.downcallHandle(create, FunctionDescriptor.ofVoid(
ValueLayout.ADDRESS

View file

@ -6,20 +6,20 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* Single-threaded Circular buffer for variable sized byte arrays. The indices for read and write
* Circular buffer for variable sized byte arrays. The indices for read and write
* are also stored in the bytebuffer, making changes visible to any non-java process that is reading.
*
*
* Written for a scenario with multiple concurrent writers, and a single reader in a non-java process
* This class relies on MPSCBufferWriter for multithreaded writes. This class queues
* byte arrays waiting to be stored in the circular buffer. Effectively MPSCBufferWriter starts the only
* This class itself is Not Threadsafe! It relies on MPSCBufferWriter for multithreaded writes. This queues
* byte arrays waiting to be stored in the circular buffer. MPSCBufferWriter starts the only
* thread that is allowed to interact with the CircularByteBuffer.
* ..
* *Implementation note:*
* The last 8 bytes are reserved for the reader and writer index. The actual capacity is always `bytebuffer.capacity -8`
*/
@SuppressWarnings("StringTemplateMigration")
public class SingleThreadCircularByteBuffer {
public class CircularByteBuffer {
private int readStartPos;
private int writeStartPos;
@ -32,7 +32,7 @@ public class SingleThreadCircularByteBuffer {
*
* @param capacity the capacity of the CircularByteBuffer
*/
public SingleThreadCircularByteBuffer(int capacity) {
public CircularByteBuffer(int capacity) {
this.data = ByteBuffer.allocate(capacity + 8); // 8 extra for the read and write index
initIndices();
}
@ -41,7 +41,7 @@ public class SingleThreadCircularByteBuffer {
* Constructs a CircularByteBuffer with the specified capacity. The buffer is backed by native memory
* from the MemorySegment
*/
public SingleThreadCircularByteBuffer(MemorySegment memory) {
public CircularByteBuffer(MemorySegment memory) {
if (memory.byteSize() > 0xfff7) {
throw new IllegalArgumentException("Max memory size is 65527");
}
@ -56,6 +56,7 @@ public class SingleThreadCircularByteBuffer {
this.data.putInt(readStartPos, 0);
this.data.putInt(writeStartPos, 0);
}
public boolean put(byte[] bytes) {

View file

@ -1,7 +1,6 @@
package com.github.shautvast.exceptional;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.xerial.snappy.Snappy;
@SuppressWarnings("unused") // this code is called from the instrumented code
public class ExceptionLogger {
@ -13,7 +12,7 @@ public class ExceptionLogger {
// use json for now because of ease of integration
// would compression be useful?? use snappy?
if (throwable != null) {
bufferWriter.put(Snappy.compress(objectMapper.writeValueAsBytes(throwable)));
bufferWriter.put(objectMapper.writeValueAsBytes(throwable));
}
} catch (Throwable e) {
e.printStackTrace(System.err);

View file

@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.*;
class SingleThreadCircularByteBuffer2Test {
class CircularByteBufferTest {
@Test
void testPutAndGet() {
@ -20,7 +20,7 @@ class SingleThreadCircularByteBuffer2Test {
@Test
void testJustGet() {
var buffer = new CircularByteBuffer(8);
System.out.println(SingleThreadCircularByteBuffer.bytesToString(buffer.get()));
System.out.println(CircularByteBuffer.bytesToString(buffer.get()));
}

View file

@ -0,0 +1,20 @@
package com.github.shautvast.exceptional;
import org.junit.jupiter.api.Test;
import java.util.concurrent.TimeUnit;
class ExceptionLoggerTest {
@Test
void test() throws InterruptedException {
long t0 = System.currentTimeMillis();
for (int i = 0; i < 1_000; i++) {
ExceptionLogger.log(new Throwable());
TimeUnit.MILLISECONDS.sleep(1);
}
System.out.println(System.currentTimeMillis() - t0);
Thread.sleep(10000);
}
}

View file

@ -0,0 +1,22 @@
package com.github.shautvast.exceptional;
import java.lang.foreign.Arena;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
class MPSCBufferWriterTest {
// @Test
void test() throws InterruptedException {
var arena = Arena.ofConfined();
var ringbufferMemory = arena.allocate(4096);
// var buffer = new CircularByteBuffer(ringbufferMemory);
CircularBufferWriter writer = new CircularBufferWriter();
byte[] bytes = "cow".getBytes(UTF_8);
writer.put(bytes);
writer.put(bytes);
Thread.sleep(10000);
writer.close();
}
}

View file

@ -0,0 +1,24 @@
package com.github.shautvast.exceptional;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets;
// TODO scheduled for demolition
class RingBufferTest {
@Test
void testWriteAndRead() {
// var ringBuffer = new CircularByteBuffer(MemorySegment.ofArray(new byte[16]));
var writer = new CircularBufferWriter();
// writer.startReader(x -> System.out.println("read " + new String(x, StandardCharsets.UTF_8)));
for (int i = 0; i < 10; i++) {
System.out.println("put " + i + " in ring buffer");
byte[] testdata = ("test" + i).getBytes(StandardCharsets.UTF_8);
writer.put(testdata);
}
}
}

View file

@ -10,10 +10,9 @@
<packaging>pom</packaging>
<modules>
<module>rustlib</module>
<module>agent</module>
<module>api</module>
<module>concurrency-test</module>
<module>rustlib</module>
<module>lib</module>
</modules>
</project>

View file

@ -1,124 +0,0 @@
<html>
<head>
<title>Java Concurrency Stress test report</title>
<style type="text/css">
* { font-family: Arial; }
table { font-size: 9pt; }
a { color: #000000; }
.progress { padding: 0px; }
.header { text-align: left; }
.section1 { font-size: 12pt; background-color: #BDB76B; color: #000000; font-weight: bold;}
.section2 { font-size: 12pt; background-color: #F0E68C; color: #000000; font-weight: bold;}
.cell1 { background-color: #FAFAD2; }
.cell2 { background-color: #EEE8AA; }
.passedProgress { background-color: #00AA00; color: #FFFFFF; text-align: center; font-weight: bold; }
.failedProgress { background-color: #FF0000; color: #FFFFFF; text-align: center; font-weight: bold; }
.passed { color: #00AA00; text-align: center; font-weight: bold; }
.failed { color: #FF0000; text-align: center; font-weight: bold; }
.interesting { color: #0000FF; text-align: center; font-weight: bold; }
.spec { color: #AAAA00; text-align: center; font-weight: bold; }
.endResult { font-size: 48pt; text-align: center; font-weight: bold; }
</style>
</head>
<body>
<table width="100%" cellspacing="20">
<tr>
<td>
<p class="endResult passed">
100%
</p>
<table width="100%" cellpadding="3" cellspacing="0">
<tr><td width="100%" class="passedProgress">&nbsp;</td></tr>
<tr><td nowrap><b>Overall pass rate:</b> 1/1&nbsp;</td></tr>
</table>
<br>
</td>
<td width=100>
<table>
<tr>
<td nowrap>java.specification.name</td>
<td nowrap>Java Platform API Specification</td>
</tr>
<tr>
<td nowrap>java.specification.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.specification.version</td>
<td nowrap>22</td>
</tr>
<tr>
<td nowrap>java.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.version</td>
<td nowrap>22</td>
</tr>
<tr>
<td nowrap>java.vm.name</td>
<td nowrap>OpenJDK 64-Bit Server VM</td>
</tr>
<tr>
<td nowrap>java.vm.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.vm.version</td>
<td nowrap>22+36-2370</td>
</tr>
<tr>
<td nowrap>os.arch</td>
<td nowrap>aarch64</td>
</tr>
<tr>
<td nowrap>os.name</td>
<td nowrap>Mac OS X</td>
</tr>
<tr>
<td nowrap>os.version</td>
<td nowrap>14.6.1</td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<h3>FAILED tests</h3>
<p>Strong asserts were violated. Correct implementations should have no assert failures here.</p>
<table cellspacing=0 cellpadding=3 width="100%">
</table>
None!
<br>
<br>
<hr>
<h3>ERROR tests</h3>
<p>Tests break for some reason, other than failing the assert. Correct implementations should have none.</p>
<table cellspacing=0 cellpadding=3 width="100%">
</table>
None!
<br>
<br>
<hr>
<h3>INTERESTING tests</h3>
<p>Some interesting behaviors observed. This is for the plain curiosity.</p>
<table cellspacing=0 cellpadding=3 width="100%">
</table>
None!
<br>
<br>
<hr>
<h3>All tests</h3>
<p></p>
<table cellspacing=0 cellpadding=3 width="100%">
<tr class="cell2">
<td>&nbsp;&nbsp;&nbsp;<a href="org.github.shautvast.exceptional.StressTest.html">org.github.shautvast.exceptional.StressTest</a></td>
<td>10<sup>8</sup></td><td class="passed">PASSED</td>
<td class="interesting"></td>
<td class="passed"></td>
</tr>
</table>
<br>
</body>
</html>

View file

@ -1,568 +0,0 @@
<html>
<head>
<title>Java Concurrency Stress test report</title>
<style type="text/css">
* { font-family: Arial; }
table { font-size: 9pt; }
a { color: #000000; }
.progress { padding: 0px; }
.header { text-align: left; }
.section1 { font-size: 12pt; background-color: #BDB76B; color: #000000; font-weight: bold;}
.section2 { font-size: 12pt; background-color: #F0E68C; color: #000000; font-weight: bold;}
.cell1 { background-color: #FAFAD2; }
.cell2 { background-color: #EEE8AA; }
.passedProgress { background-color: #00AA00; color: #FFFFFF; text-align: center; font-weight: bold; }
.failedProgress { background-color: #FF0000; color: #FFFFFF; text-align: center; font-weight: bold; }
.passed { color: #00AA00; text-align: center; font-weight: bold; }
.failed { color: #FF0000; text-align: center; font-weight: bold; }
.interesting { color: #0000FF; text-align: center; font-weight: bold; }
.spec { color: #AAAA00; text-align: center; font-weight: bold; }
.endResult { font-size: 48pt; text-align: center; font-weight: bold; }
</style>
</head>
<body>
<h1>org.github.shautvast.exceptional.StressTest</h1>
<h3>Description and references</h3>
<p>null</p>
<h3>Environment</h3>
<table>
<tr>
<td nowrap>java.specification.name</td>
<td nowrap>Java Platform API Specification</td>
</tr>
<tr>
<td nowrap>java.specification.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.specification.version</td>
<td nowrap>22</td>
</tr>
<tr>
<td nowrap>java.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.version</td>
<td nowrap>22</td>
</tr>
<tr>
<td nowrap>java.vm.name</td>
<td nowrap>OpenJDK 64-Bit Server VM</td>
</tr>
<tr>
<td nowrap>java.vm.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.vm.version</td>
<td nowrap>22+36-2370</td>
</tr>
<tr>
<td nowrap>os.arch</td>
<td nowrap>aarch64</td>
</tr>
<tr>
<td nowrap>os.name</td>
<td nowrap>Mac OS X</td>
</tr>
<tr>
<td nowrap>os.version</td>
<td nowrap>14.3.1</td>
</tr>
</table>
<h3>Results</h3>
<table cellpadding=5 border=1>
<tr>
<th>Compilation Mode</th>
<th>Scheduling Class</th>
<th>Java Options</th>
<th>Status</th>
<th colspan=1>Observed States</th>
</tr>
<tr>
<th colspan=4></th>
<th nowrap align='center'>0</th>
</tr>
<tr>
<td colspan=4></td>
<td>Forbidden</td>
</tr>
<tr>
<td colspan=4></td>
<td>No default case provided, assume Forbidden</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>30902291</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>32448531</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>32417811</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1042557900]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>32315411</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1075505546]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>31045651</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1297563461]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>31352851</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=341109036]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>32929811</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=743091320]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>30871571</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>38285331</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>57024531</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>65288211</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1475905266]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>64960531</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1751296682]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>66496531</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=296131663]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>63107091</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=604532419]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>60383251</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=748857893]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>60332051</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>38797331</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1665729567]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>38613011</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1856278423]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>39002131</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=2102286780]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>37486611</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=346933759]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>39391251</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=906592642]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>37230611</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>108470291</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1805276407]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>106893331</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=2146860082]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>51945491</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=263133163]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>55191571</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=710335425]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>59256851</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=823945074]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>54935571</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>68554771</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1040062964]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>63219731</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1158731359]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>108142611</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1247680276]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>64458771</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=486365934]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>64602131</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=83544816]</pre>
</td>
<td align='center' bgColor='red '>FAILED</td>
<td align='right' width='100.0%' bgColor=#ff0000>119826451</td>
</tr>
</table>
<h3>Messages</h3>
<h3>VM Output Streams</h3>
<h3>VM Error Streams</h3>
</body>
</html>

View file

@ -1,642 +0,0 @@
<html>
<head>
<title>Java Concurrency Stress test report</title>
<style type="text/css">
* { font-family: Arial; }
table { font-size: 9pt; }
a { color: #000000; }
.progress { padding: 0px; }
.header { text-align: left; }
.section1 { font-size: 12pt; background-color: #BDB76B; color: #000000; font-weight: bold;}
.section2 { font-size: 12pt; background-color: #F0E68C; color: #000000; font-weight: bold;}
.cell1 { background-color: #FAFAD2; }
.cell2 { background-color: #EEE8AA; }
.passedProgress { background-color: #00AA00; color: #FFFFFF; text-align: center; font-weight: bold; }
.failedProgress { background-color: #FF0000; color: #FFFFFF; text-align: center; font-weight: bold; }
.passed { color: #00AA00; text-align: center; font-weight: bold; }
.failed { color: #FF0000; text-align: center; font-weight: bold; }
.interesting { color: #0000FF; text-align: center; font-weight: bold; }
.spec { color: #AAAA00; text-align: center; font-weight: bold; }
.endResult { font-size: 48pt; text-align: center; font-weight: bold; }
</style>
</head>
<body>
<h1>org.github.shautvast.exceptional.StressTest</h1>
<h3>Description and references</h3>
<p>null</p>
<h3>Environment</h3>
<table>
<tr>
<td nowrap>java.specification.name</td>
<td nowrap>Java Platform API Specification</td>
</tr>
<tr>
<td nowrap>java.specification.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.specification.version</td>
<td nowrap>22</td>
</tr>
<tr>
<td nowrap>java.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.version</td>
<td nowrap>22</td>
</tr>
<tr>
<td nowrap>java.vm.name</td>
<td nowrap>OpenJDK 64-Bit Server VM</td>
</tr>
<tr>
<td nowrap>java.vm.vendor</td>
<td nowrap>Oracle Corporation</td>
</tr>
<tr>
<td nowrap>java.vm.version</td>
<td nowrap>22+36-2370</td>
</tr>
<tr>
<td nowrap>os.arch</td>
<td nowrap>aarch64</td>
</tr>
<tr>
<td nowrap>os.name</td>
<td nowrap>Mac OS X</td>
</tr>
<tr>
<td nowrap>os.version</td>
<td nowrap>14.6.1</td>
</tr>
</table>
<h3>Results</h3>
<table cellpadding=5 border=1>
<tr>
<th>Compilation Mode</th>
<th>Scheduling Class</th>
<th>Java Options</th>
<th>Status</th>
<th colspan=3>Observed States</th>
</tr>
<tr>
<th colspan=4></th>
<th nowrap align='center'>0</th>
<th nowrap align='center'>1</th>
<th nowrap align='center'>2147483647</th>
</tr>
<tr>
<td colspan=4></td>
<td>Acceptable</td>
<td>Acceptable</td>
<td>Acceptable</td>
</tr>
<tr>
<td colspan=4></td>
<td>Value is correct, or not set</td>
<td>Value is correct, or not set</td>
<td>Value is correct, or not set</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2507</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>6749513</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>6516991</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9790</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>15272488</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>1939373</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8541</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>13115500</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2479690</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1289469392]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8960</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12554400</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2722931</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1334196207]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9474</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12062665</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2077512</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1518137892]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>10866</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12504654</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2279251</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=165968267]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8998</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>13327603</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2338810</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: Interpreter
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=46553116]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9363</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>10907789</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2392819</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8572</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>1805981</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12345338</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>6973</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>25429662</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>25136696</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>10195</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9814711</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7908745</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1258498741]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>5194</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>10757506</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9029191</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1265577250]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7495</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>10976948</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9350168</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1718364339]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>6800</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9694008</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7684683</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1986468010]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>6581</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11133163</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9307507</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C1
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=988230546]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7014</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12201531</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>10419826</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8329</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2612383</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11518699</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1568282099]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8851</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2849650</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>13093390</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1769721426]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9957</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2238775</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12586999</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=485149037]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11301</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2525467</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>14111443</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=646649906]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9357</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2649745</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11592949</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: Interpreter
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=732333148]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11606</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2530883</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11474042</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8659</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7350026</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8859446</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1330574674]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7955</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7425003</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8815893</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=537320790]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>6375</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8337756</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9256400</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=590941573]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>6029</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>18121364</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>17812978</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=783986298]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>6417</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9953222</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11071292</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C1
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=972835668]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>5315</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8176412</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>9439284</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12682</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7997829</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7992580</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=146296887]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>4508</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7992238</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8088265</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1475645167]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>2388</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12140630</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11959913</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1786164078]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>3627</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7904462</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>7890202</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=1936754903]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>1405</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>12159084</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>11840042</td>
</tr>
<tr>
<td nowrap valign=top width=10><pre>split
actor1: C2
actor2: C2
</pre></td>
<td nowrap valign=top width=10><pre> actor1: package group free, core group free
actor2: package group free, core group free
</pre></td>
<td valign=top width=10>
<pre>[-XX:+StressLCM, -XX:+StressGCM, -XX:+StressIGVN, -XX:+StressCCP, -XX:StressSeed=439637539]</pre>
</td>
<td align='center' bgColor='green '>OK</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>3778</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8417441</td>
<td align='right' width='33.333333333333336%' bgColor=#00ff00>8206512</td>
</tr>
</table>
<h3>Messages</h3>
<h3>VM Output Streams</h3>
<h3>VM Error Streams</h3>
</body>
</html>

221
rustlib/Cargo.lock generated
View file

@ -17,15 +17,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aho-corasick"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
dependencies = [
"memchr",
]
[[package]]
name = "android-tzdata"
version = "0.1.1"
@ -147,10 +138,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
[[package]]
name = "crossbeam-channel"
version = "0.5.13"
name = "crossbeam-deque"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2"
checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
dependencies = [
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
dependencies = [
"crossbeam-utils",
]
@ -272,12 +273,6 @@ dependencies = [
"slab",
]
[[package]]
name = "gcc"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
[[package]]
name = "getrandom"
version = "0.2.15"
@ -497,12 +492,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.155"
@ -521,15 +510,6 @@ version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "matchers"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
dependencies = [
"regex-automata 0.1.10",
]
[[package]]
name = "memchr"
version = "2.7.4"
@ -579,16 +559,6 @@ dependencies = [
"tempfile",
]
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
dependencies = [
"overload",
"winapi",
]
[[package]]
name = "num-traits"
version = "0.2.19"
@ -657,12 +627,6 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "overload"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "percent-encoding"
version = "2.3.1"
@ -725,50 +689,6 @@ dependencies = [
"proc-macro2",
]
[[package]]
name = "regex"
version = "1.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata 0.4.7",
"regex-syntax 0.8.4",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [
"regex-syntax 0.6.29",
]
[[package]]
name = "regex-automata"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax 0.8.4",
]
[[package]]
name = "regex-syntax"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
[[package]]
name = "reqwest"
version = "0.12.5"
@ -853,11 +773,8 @@ version = "0.1.0"
dependencies = [
"anyhow",
"chrono",
"crossbeam-channel",
"crossbeam-deque",
"reqwest",
"snappy",
"tracing",
"tracing-subscriber",
]
[[package]]
@ -981,15 +898,6 @@ dependencies = [
"serde",
]
[[package]]
name = "sharded-slab"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
dependencies = [
"lazy_static",
]
[[package]]
name = "slab"
version = "0.4.9"
@ -1005,27 +913,6 @@ version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "snappy"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b570b1d39e2fcb136a07e46d15a1fe962ba71c151e4d8d6888f59f1fcd185bb1"
dependencies = [
"libc",
"snappy-sys",
]
[[package]]
name = "snappy-sys"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f873053ef085548b0b924db3aa2ce38d9389fb3be353bf7fcec4ababc99a307"
dependencies = [
"gcc",
"libc",
"pkg-config",
]
[[package]]
name = "socket2"
version = "0.5.7"
@ -1098,16 +985,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "thread_local"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c"
dependencies = [
"cfg-if",
"once_cell",
]
[[package]]
name = "tinyvec"
version = "1.6.1"
@ -1206,21 +1083,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
dependencies = [
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tracing-core"
version = "0.1.32"
@ -1228,36 +1093,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
dependencies = [
"once_cell",
"valuable",
]
[[package]]
name = "tracing-log"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
dependencies = [
"log",
"once_cell",
"tracing-core",
]
[[package]]
name = "tracing-subscriber"
version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b"
dependencies = [
"matchers",
"nu-ansi-term",
"once_cell",
"regex",
"sharded-slab",
"smallvec",
"thread_local",
"tracing",
"tracing-core",
"tracing-log",
]
[[package]]
@ -1304,12 +1139,6 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "valuable"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "vcpkg"
version = "0.2.15"
@ -1407,28 +1236,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
version = "0.52.0"

View file

@ -11,7 +11,4 @@ bench = false
anyhow = "1.0"
chrono = "0.4"
reqwest = { version = "0.12", features = ["blocking"]}
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
crossbeam-channel = "0.5"
snappy = "0.4"
crossbeam-deque = "0.8"

View file

@ -31,7 +31,6 @@
<workingDirectory>${project.basedir}/rustlib</workingDirectory>
<arguments>
<argument>build</argument>
<argument>--release</argument>
</arguments>
</configuration>
</execution>

View file

@ -1,68 +1,21 @@
use crossbeam_channel::{Receiver, Sender, bounded};
use std::cell::OnceCell;
use std::ffi::c_char;
use std::sync::OnceLock;
use std::thread::JoinHandle;
use std::{slice, thread};
use std::time::Duration;
use std::slice;
use reqwest::blocking::Client; // can I use non-blocking here?
use reqwest::blocking::Client;
// same value, but different meanings
// TODO find a way to set the buffer size from java.
// why not just add it to the function
const CAPACITY: isize = 32760;
const READ: isize = 32760;
static CHANNEL: OnceLock<(Sender<Vec<u8>>, Receiver<Vec<u8>>)> = OnceLock::new();
static HANDLE: OnceLock<JoinHandle<()>> = OnceLock::new();
const CLIENT: OnceCell<Client> = OnceCell::new();
/// Reads the data from the bytebuffer in the caller thread and sends the data to a background
/// thread that updates the datastore
///
/// # Safety
///
/// The function is unsafe for skipped checks on UTF-8 and string length and because it reads from a
/// mutable raw pointer.
/// Still it's guaranteed to be safe because
/// 1. We make sure the part that's read is not being mutated at the same time (happens in the same thread)
/// 2. don't need to check the length since it's calculated and stored within the byte buffer
/// 3. the bytes are guaranteed to be UTF-8
#[no_mangle]
pub unsafe extern "C" fn buffer_updated(buffer: *mut c_char) {
// using a channel for the bytes read from the buffer
// this decouples the originating from the http request
let (sender, receiver) = CHANNEL.get_or_init(|| bounded(1000));
HANDLE.get_or_init(|| {
thread::spawn(move || {
let http_client = Client::new();
loop {
let maybe_job = receiver.recv();
if let Ok(data) = maybe_job {
let data = String::from_utf8(snappy::uncompress(&data).unwrap()).unwrap();
_ = http_client
.post("http://localhost:3000/api/stacktraces")
.body(data)
.send();
}
}
});
thread::spawn(move || {
let http_client = Client::new();
loop {
let maybe_job = receiver.recv();
if let Ok(data) = maybe_job {
let data = String::from_utf8(snappy::uncompress(&data).unwrap()).unwrap();
_ = http_client
.post("http://localhost:3000/api/stacktraces")
.body(data)
.send();
}
}
})
});
pub extern "C" fn buffer_updated(buffer: *mut c_char) {
let client = CLIENT;
let client = client.get_or_init(|| Client::new());
let mut read_pos = get_u32(buffer, READ) as isize;
if read_pos == CAPACITY {
read_pos = 0;
}
let mut remaining = CAPACITY - read_pos; // nr of bytes to read before end of buffer
let len = if remaining == 1 {
@ -85,34 +38,28 @@ pub unsafe extern "C" fn buffer_updated(buffer: *mut c_char) {
l
} as isize;
// must copy to maintain it safely once read from the buffer
// can safely skip checks for len and utf8
// copy only when needed
if len <= remaining {
let s = slice::from_raw_parts(
buffer.offset(read_pos).cast::<u8>(),
len as usize,
).to_owned();
let send_result = sender.send_timeout(s, Duration::from_secs(10));
if send_result.is_err() {
println!("overflow detected, discarding");
unsafe {
let result = std::str::from_utf8_unchecked(slice::from_raw_parts(buffer.offset(read_pos).cast::<u8>(), len as usize));
client.post("http://localhost:3000/api/stacktraces")
.body(result)
.send()
.unwrap();
}
read_pos += len;
} else {
let mut s = slice::from_raw_parts(
buffer.offset(read_pos).cast::<u8>(),
remaining as usize,
).to_owned();
let s2 = slice::from_raw_parts(
buffer.cast::<u8>(),
(len - remaining) as usize,
);
s.append(&mut s2.to_owned());
let send_result = sender.send_timeout(s, Duration::from_secs(10));
if send_result.is_err() {
println!("overflow detected, discarding");
unsafe {
let s1 = std::str::from_utf8_unchecked(slice::from_raw_parts(buffer.offset(read_pos).cast::<u8>(), remaining as usize));
let s2 = std::str::from_utf8_unchecked(slice::from_raw_parts(buffer.cast::<u8>(), (len - remaining) as usize));
let mut s = String::with_capacity(len as usize);
s.push_str(s1);
s.push_str(s2);
client.post("http://localhost:3000/api/stacktraces")
.body(s)
.send()
.unwrap();
}
read_pos = len - remaining;
}
put_u32(buffer, READ, read_pos as u32);
@ -151,14 +98,3 @@ fn put_u32(s: *mut c_char, pos: isize, value: u32) {
*s.offset(pos + 3) = bytes[3] as c_char;
}
}
#[cfg(test)]
mod test {
#[test]
fn read_snap() {
let bytes = std::fs::read("/Users/Shautvast/dev/exceptional/agent/hello.snap").unwrap();
let uncompressed = snappy::uncompress(&bytes).unwrap();
let uncompressed = String::from_utf8(uncompressed).unwrap();
println!("{}", uncompressed);
}
}