Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in user path replacement in stacktrace #39674

Closed
akosuas opened this issue Feb 15, 2021 · 1 comment · Fixed by #40274
Closed

Bug in user path replacement in stacktrace #39674

akosuas opened this issue Feb 15, 2021 · 1 comment · Fixed by #40274
Labels
bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects. regression Regression in behavior compared to a previous version

Comments

@akosuas
Copy link

akosuas commented Feb 15, 2021

My home directory, /home/akosuas, is a symlink to /data/home/akosuas.

In 1.6, the new stacktrace printing is broken when the code is being run from /data/home/akosuas. It prints paths like:

....
 [5] top-level scope
  @ /data~/foo/bar

Because it is doing a replace("/data/home/akosuas", "/home/akosuas" => "~") rather than a prefix-replace:
https://github.com/JuliaLang/julia/blob/master/base/errorshow.jl#L556

At minimum, it would be nice to avoid this bug. Even better, perhaps, would be to resolve whether any prefix of the path, after resolving symlinks, is the home directory.

@vtjnash vtjnash added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version labels Feb 15, 2021
@fredrikekre
Copy link
Member

There is a Base.contractuser function for this.

@vtjnash vtjnash added this to the 1.6 blockers milestone Mar 18, 2021
@vtjnash vtjnash added the display and printing Aesthetics and correctness of printed representations of objects. label Mar 18, 2021
@KristofferC KristofferC removed this from the 1.6 blockers milestone Mar 25, 2021
KristofferC pushed a commit that referenced this issue Apr 4, 2021
KristofferC pushed a commit that referenced this issue Apr 4, 2021
KristofferC pushed a commit that referenced this issue Apr 4, 2021
staticfloat pushed a commit that referenced this issue Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects. regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants