Skip to content

Conversation

@visr
Copy link
Contributor

@visr visr commented Jul 7, 2025

Fixes #3085

That issue was already closed by #3087 but I still ran into the same issue, it seems the fix was wrong.

The stack overflow can still be triggered on Windows by

using Pkg: safe_realpath
safe_realpath("some-non-existing-drive:")

It keeps on recursing trying to make it smaller with splitdir, but it can't. We know we cannot make it smaller if the returned "filename" is empty.

On Linux we have:

julia> splitdir("/")
("/", "")

On Windows:

julia> splitdir("C://")
("C:/", "")

Fixes JuliaLang#3085

That issue was already closed by JuliaLang#3087 but I still ran into the same issue, it seems the fix was wrong.

The stack overflow can still be triggered on Windows by

```jl
using Pkg: safe_realpath
safe_realpath("some-non-existing-drive:")
```

It keeps on recursing trying to make it smaller with `splitdir`, but it can't. We know we cannot make it smaller if the returned "filename" is empty.

On Linux we have:
```jl
julia> splitdir("/")
("/", "")
```

On Windows:
```jl
julia> splitdir("C://")
("C:/", "")
```
@IanButterworth IanButterworth merged commit 6ae6499 into JuliaLang:master Jul 7, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Pkg.jl Jul 7, 2025
@visr visr deleted the real-safe-path branch July 8, 2025 00:45
KristofferC pushed a commit that referenced this pull request Jul 12, 2025
@KristofferC KristofferC mentioned this pull request Jul 12, 2025
9 tasks
@DilumAluthge DilumAluthge removed the merge me Merge when tests pass label Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Stackoverflow if manifest contains references to removed drive

4 participants