You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rsession/server crashes (segfault) when downloading a file with no read permission #18864
In the Files pane, right-click test-export.txt → Export → Download.
Result: The session crashes with a segfault; the browser shows a 502 and the session enters a failed state.
Describe the problem in detail
In core::http::Response::setStreamFile(), when streamResponse_->initialize() fails (opening the file returns EACCES), setError() is called but streamResponse_ is left set. Response::isStreamResponse() therefore still returns true, so the async HTTP server routes the response to StreamWriter, which calls FileStreamResponse::nextBuffer(). That dereferences fileStream_ at Response.cpp:89 — but the file stream was never opened, so it is null → segfault.
Affects the Unix/Linux gzip streaming path. Windows uses a different code path.
Describe the behavior you expected
The download should fail gracefully with an HTTP error, without crashing the session.
I have read the guide for submitting good bug reports.
I have installed the latest version of RStudio, and confirmed that the issue still persists.
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Activity
Add regression tests for setStreamFile() on unopenable files (rstudio…
Send a parseable error when a streamed file cannot be opened (rstudio…
Correct temp-path comment in ResponseTests (rstudio#18864)
Fix crash when downloading a file with no read permission (#18864) (#…