Assertion `nwritten == buf_size' assertion failed
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.7k
- Forks
- 662
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 2
Description
Using a VMWare guest (configured as suggested) on an OS/X host, I have been seeing this assertion pretty regularly, using 3a9e68ce2d4c688fe4c22c7a73ea9368fe09fcd7
[FATAL /home/mgaudet/rr/src/Task.cc:2236:write_bytes_helper() errno: EIO]
(task 95064 (rec:94946) at time 832)
-> Assertion `nwritten == buf_size' failed to hold. Should have written 1 bytes to 0x3ad9a8252b80, but only wrote -1
[FATAL /home/mgaudet/rr/src/Task.cc:2236:write_bytes_helper() errno: EIO]
(task 95064 (rec:94946) at time 832)
-> Assertion `nwritten == buf_size' failed to hold. Should have written 1 bytes to 0x3ad9a8252b80, but only wrote -1
[FATAL /home/mgaudet/rr/src/Task.cc:2236:write_bytes_helper() errno: EIO]
(task 95064 (rec:94946) at time 832)
-> Assertion `nwritten == buf_size' failed to hold. Should have written 1 bytes to 0x3ad9a8252b80, but only wrote -1
(repeats a couple thousand times unfortunately)
Unfortunately, I don't have a reliable set of steps to reproduce on a generic program, though I have found that when I do encounter this issue, I encounter it again when repeating the same steps.
One thing I can point out that seems to be pretty common: When I see this it's often because I have set a breakpoint on JIT compiled code; in the above message, 0x3ad9a8252b80 is a code pointer where I set a breakpoint just prior.
Unlike in #2161 I don't get an RR backtrace, and the child seems to be dead immediately, so I've been unable to follow similar debugging steps.
I have run rr pack and archived the directory, and can pass it on in case that's desired.
(Honestly, the biggest bother so far about this bug has been the incredibly large spew of the same assertion failure)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Task.cc at write_bytes_helper(), especially around line 2236, and inspect how the failed write is handled when errno is EIO. Use the archived directory from rr pack if available and investigate the JIT breakpoint scenario described in the report. Done means identifying a reproducible cause and preventing the repeated assertion spew or handling the failure appropriately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100