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

Printf regression with pointers that cannot be represented as signed Int #40318

Closed
maleadt opened this issue Apr 2, 2021 · 1 comment
Closed
Assignees
Labels
display and printing Aesthetics and correctness of printed representations of objects. regression Regression in behavior compared to a previous version

Comments

@maleadt
Copy link
Member

maleadt commented Apr 2, 2021

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.1-pre.1 (2021-04-01)
 _/ |\__'_|_|_|\__'_|  |  release-1.6/9283b6c7a7 (fork: 293 commits, 114 days)
|__/                   |

julia> using Printf

julia> @printf "%p" 0xfffffffffffe0000
ERROR: InexactError: check_top_bit(Int64, 18446744073709420544)
Stacktrace:
 [1] throw_inexacterror(f::Symbol, #unused#::Type{Int64}, val::UInt64)
   @ Core ./boot.jl:602
 [2] check_top_bit
   @ ./boot.jl:616 [inlined]
 [3] toInt64
   @ ./boot.jl:677 [inlined]
 [4] Int64
   @ ./boot.jl:752 [inlined]
 [5] fmt(buf::Vector{UInt8}, pos::Int64, arg::UInt64, spec::Printf.Spec{Val{'p'}})
   @ Printf /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Printf/src/Printf.jl:550
 [6] format
   @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Printf/src/Printf.jl:698 [inlined]
 [7] format(io::Base.TTY, f::Printf.Format{Base.CodeUnits{UInt8, String}, Tuple{Printf.Spec{Val{'p'}}}}, args::UInt64)
   @ Printf /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Printf/src/Printf.jl:781
 [8] top-level scope
   @ REPL[2]:1

vs

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3 (2020-11-09)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Printf

julia> @printf "%p" 0xfffffffffffe0000
0xfffffffffffe0000
@maleadt maleadt added regression Regression in behavior compared to a previous version display and printing Aesthetics and correctness of printed representations of objects. labels Apr 2, 2021
@vtjnash vtjnash added the backport 1.6 Change should be backported to release-1.6 label Apr 2, 2021
@quinnj
Copy link
Member

quinnj commented Apr 2, 2021

Fix is up: #40319

@quinnj quinnj closed this as completed in 0d9163b Apr 2, 2021
quinnj added a commit that referenced this issue Apr 2, 2021
Fix #40318 by using UInt to convert instead of Int on Ptr
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
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this issue May 4, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this issue May 9, 2021
johanmon pushed a commit to johanmon/julia that referenced this issue Jul 5, 2021
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Sep 7, 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
display and printing Aesthetics and correctness of printed representations of objects. regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

4 participants