Skip to content

Fix bug of release_buffer #11

@TheSilentDawn

Description

@TheSilentDawn

Env

  • Host: Ubuntu 22
  • Docker
  • Target: Ubuntu 18.04

Problem

While running command cargo run --release -- -c -o out ../build/Sodor3Stage.toml, I get the following error information

# From fuzzer

warning: `kfuzz` (bin "kfuzz") generated 25 warnings (run `cargo fix --bin "kfuzz"` to apply 25 suggestions)

    Finished `release` profile [optimized] target(s) in 0.01s

     Running `target/release/kfuzz -c -o out ../build/Sodor3Stage.toml`

Fuzzing Sodor3Stage

Instrumented on:   2025-12-01T14:33:16+08:00

Coverage Signals:  187

Input Fields:      4

Total Input Width: 35

Allocated Bytes per Input:    8

Allocated Bytes for Coverage: 190

Test Buffer:     1024 KiB

Coverage Buffer: 1024 KiB

Max Inputs: 21845



thread 'main' (10982) panicked at src/run/shmem.rs:206:9:

assertion `left == right` failed: tx pipe was closed unexpectedly!

  left: 0

 right: 8

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

# From Server
/workspace/rfuzz/build/Sodor3Stage_server

Fuzz Server for Sodor3Stage

Allocated Bytes per Input:    8

Allocated Bytes per Coverage: 190

created tx fifo

created rx fifo

opened tx fifo

opened rx fifo

Sodor3Stage_server: ../../verilator/fpga_queue.cpp:96: bool FPGAQueueFuzzer::acquire_buffer(): Assertion `test_in_id == -1' failed.

Makefile:125: recipe for target 'run' failed

make: *** [run] Aborted (core dumped)

Under help of AI, it looks like the code of

if(coverage_out_id > 0 && test_in_id > 0) {
is too strict due to different linux distrubute version.
As a result, I change it to

void FPGAQueueFuzzer::release_buffer() {
	// release in reverse order
//	if(coverage_out_id > 0 && test_in_id > 0) {
	if(coverage_out_id != -1 && test_in_id != -1) {

I'm not sure if AL response is correct, but it works for me. If possible, could u please help to double check the code. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions