Skip to content

task-comm-15 fails when run with multiple threads #737

Closed
@brson

Description

@brson

With RUST_THREADS=16, task-comm-15 occasionally produces valgrind errors like

==8944== Thread 3:
==8944== Invalid read of size 4
==8944==    at 0x4AC73CD: pthread_mutex_lock (pthread_mutex_lock.c:50)
==8944==    by 0x4A2E415: pthread_mutex_lock (forward.c:182)
==8944==    by 0x48E0D27: lock_and_signal::lock() (lock_and_signal.cpp:46)
==8944==    by 0x48E10C1: scoped_lock::scoped_lock(lock_and_signal&) (lock_and_signal.cpp:121)
==8944==    by 0x48E7BF8: rust_chan::send(void*) (rust_chan.cpp:82)
==8944==    by 0x48E9D11: upcall_send (rust_upcall.cpp:203)
==8944==    by 0x8048A24: start (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x8048DD7: main::spawn_wrapper5 (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x48E72B0: task_start_wrapper (rust_task.cpp:128)
==8944==    by 0xDEADBEEE: ???
==8944==  Address 0x712bebc is 132 bytes inside a block of size 152 free'd
==8944==    at 0x48CCC02: free (vg_replace_malloc.c:366)
==8944==    by 0x48EE42C: rust_srv::free(void*) (rust_srv.cpp:12)
==8944==    by 0x48F14E1: memory_region::free(void*) (memory_region.cpp:58)
==8944==    by 0x48EE9D6: rust_kernel::free(void*) (rust_kernel.cpp:213)
==8944==    by 0x48E95E9: upcall_del_port (rust_internal.h:173)
==8944==    by 0x8048F88: glue_free11 (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x8048F42: glue_drop10 (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x8048C63: _rust_main (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x8048FBB: _rust_main_wrap (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0xDEADBEEE: ???
==8944==
==8944== Invalid read of size 4
==8944==    at 0x4AC6DAF: __pthread_mutex_lock_full (pthread_mutex_lock.c:139)
==8944==    by 0x4A2E415: pthread_mutex_lock (forward.c:182)
==8944==    by 0x48E0D27: lock_and_signal::lock() (lock_and_signal.cpp:46)
==8944==    by 0x48E10C1: scoped_lock::scoped_lock(lock_and_signal&) (lock_and_signal.cpp:121)
==8944==    by 0x48E7BF8: rust_chan::send(void*) (rust_chan.cpp:82)
==8944==    by 0x48E9D11: upcall_send (rust_upcall.cpp:203)
==8944==    by 0x8048A24: start (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x8048DD7: main::spawn_wrapper5 (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x48E72B0: task_start_wrapper (rust_task.cpp:128)
==8944==    by 0xDEADBEEE: ???
==8944==  Address 0x712bebc is 132 bytes inside a block of size 152 free'd
==8944==    at 0x48CCC02: free (vg_replace_malloc.c:366)
==8944==    by 0x48EE42C: rust_srv::free(void*) (rust_srv.cpp:12)
==8944==    by 0x48F14E1: memory_region::free(void*) (memory_region.cpp:58)
==8944==    by 0x48EE9D6: rust_kernel::free(void*) (rust_kernel.cpp:213)
==8944==    by 0x48E95E9: upcall_del_port (rust_internal.h:173)
==8944==    by 0x8048F88: glue_free11 (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x8048F42: glue_drop10 (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)
==8944==    by 0x8048C63: _rust_main (in /home/banderson/Dev/rust/build/test/run-pass/task-comm-15.stage1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions