Skip to content

panic "entered unreachable code" triggered when iterating over mpsc Receiver #40156

@spacejam

Description

@spacejam

'internal error: entered unreachable code', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sync/mpsc/mod.rs:884

encountered while testing race conditions on a lock-free log store that I'm building:
https://github.com/spacejam/rsdb/tree/a709924150374c340aab0ec9bdfb79194a3191db

triggered by running cargo test log -- --nocapture while simultaneously running a shell script that shuffles thread niceness to trigger different thread interleavings for teasing out races:

#!/bin/sh                                                                                                                                                                                      
while true; do                                                                                                                                                                                 
  PID=`pgrep rsdb`                                                                                                                                                                               
  TIDS=`ls /proc/$PID/task`                                                                                                                                                                    
  TID=`echo $TIDS |  tr " " "\n" | shuf -n1`                                                                                                                                                   
  NICE=$((`shuf -i 0-39 -n 1` - 20))                                                                                                                                                           
  echo "renicing $TID to $NICE"                                                                                                                                                                
  renice -n $NICE -p $TID                                                                                                                                                                      
  sleep 0.1                                                                                                                                                                                    
done 

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions