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

[Julia 1.8] Opaque pointers are here #279

Closed
vchuravy opened this issue Jan 18, 2022 · 3 comments
Closed

[Julia 1.8] Opaque pointers are here #279

vchuravy opened this issue Jan 18, 2022 · 3 comments

Comments

@vchuravy
Copy link
Collaborator

vchuravy@odin ~/b/julia> set -x JULIA_LLVM_ARGS "-force-opaque-pointers"
vchuravy@odin ~/b/julia> ./julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.0-DEV.1335 (2022-01-17)
 _/ |\__'_|_|_|\__'_|  |  Commit 591f0664e2* (1 day old master)
|__/                   |

(@v1.8) pkg> test LLVM
     Testing LLVM
      Status `/tmp/jl_4616hJ/Project.toml`
  [929cbde3] LLVM v4.7.1
  [dad2f222] LLVMExtra_jll v0.0.13+1
  [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
  [8dfed614] Test `@stdlib/Test`
  [4ec0a83e] Unicode `@stdlib/Unicode`
      Status `/tmp/jl_4616hJ/Manifest.toml`
  [fa961155] CEnum v0.4.1
  [692b3bcd] JLLWrappers v1.4.0
  [929cbde3] LLVM v4.7.1
  [21216c6a] Preferences v1.2.3
  [dad2f222] LLVMExtra_jll v0.0.13+1
  [0dad84c5] ArgTools v1.1.1 `@stdlib/ArgTools`
  [56f22d72] Artifacts `@stdlib/Artifacts`
  [2a0f44e3] Base64 `@stdlib/Base64`
  [ade2ca70] Dates `@stdlib/Dates`
  [f43a241f] Downloads v1.6.0 `@stdlib/Downloads`
  [7b1f6079] FileWatching `@stdlib/FileWatching`
  [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
  [b27032c2] LibCURL v0.6.3 `@stdlib/LibCURL`
  [76f85450] LibGit2 `@stdlib/LibGit2`
  [8f399da3] Libdl `@stdlib/Libdl`
  [56ddb016] Logging `@stdlib/Logging`
  [d6f4376e] Markdown `@stdlib/Markdown`
  [ca575930] NetworkOptions v1.2.0 `@stdlib/NetworkOptions`
  [44cfe95a] Pkg v1.8.0 `@stdlib/Pkg`
  [de0858da] Printf `@stdlib/Printf`
  [3fa0cd96] REPL `@stdlib/REPL`
  [9a3f8284] Random `@stdlib/Random`
  [ea8e919c] SHA v0.7.0 `@stdlib/SHA`
  [9e88b42a] Serialization `@stdlib/Serialization`
  [6462fe0b] Sockets `@stdlib/Sockets`
  [fa267f1f] TOML v1.0.0 `@stdlib/TOML`
  [a4e569a6] Tar v1.10.0 `@stdlib/Tar`
  [8dfed614] Test `@stdlib/Test`
  [cf7118a7] UUIDs `@stdlib/UUIDs`
  [4ec0a83e] Unicode `@stdlib/Unicode`
  [deac9b47] LibCURL_jll v7.73.0+4 `@stdlib/LibCURL_jll`
  [29816b5a] LibSSH2_jll v1.9.1+2 `@stdlib/LibSSH2_jll`
  [c8ffd9c3] MbedTLS_jll v2.24.0+2 `@stdlib/MbedTLS_jll`
  [14a3606d] MozillaCACerts_jll v2020.7.22 `@stdlib/MozillaCACerts_jll`
  [83775a58] Zlib_jll v1.2.12+1 `@stdlib/Zlib_jll`
  [8e850ede] nghttp2_jll v1.41.0+1 `@stdlib/nghttp2_jll`
  [3f19e933] p7zip_jll v16.2.1+1 `@stdlib/p7zip_jll`
     Testing Running tests...
┌ Warning: It is recommended to run the LLVM.jl test suite with -g2
└ @ Main ~/.julia/packages/LLVM/vQ98J/test/runtests.jl:14
[ Info: Using libLLVMExtra from /home/vchuravy/.julia/artifacts/c6d8b508333914c01ce12288e7437a555b22fb82/lib/libLLVMExtra-13.so
type: Error During Test at /home/vchuravy/.julia/packages/LLVM/vQ98J/test/core.jl:81
  Test threw exception
  Expression: eltype(ptrtyp) == eltyp
  UndefRefError: access to undefined reference
  Stacktrace:
   [1] LLVMType(ref::Ptr{LLVM.API.LLVMOpaqueType})
     @ LLVM ~/.julia/packages/LLVM/vQ98J/src/core/type.jl:33
   [2] eltype
     @ ~/.julia/packages/LLVM/vQ98J/src/core/type.jl:138 [inlined]
   [3] macro expansion
     @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:463 [inlined]
   [4] (::var"#5#71")(ctx::Context)
     @ Main ~/.julia/packages/LLVM/vQ98J/test/core.jl:81
constant expressions: Test Failed at /home/vchuravy/.julia/packages/LLVM/vQ98J/test/helpers.jl:3
  Expression: occursin($(Expr(:escape, "void ()* asm \"nop\", \"\"")), string($(Expr(:escape, :asm))))
   Evaluated: occursin("void ()* asm \"nop\", \"\"", "ptr asm \"nop\", \"\"")
Stacktrace:
 [1] macro expansion
   @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:463 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/LLVM/vQ98J/test/helpers.jl:3 [inlined]
 [3] macro expansion
   @ ~/.julia/packages/LLVM/vQ98J/test/core.jl:511 [inlined]
 [4] macro expansion
   @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:1356 [inlined]
 [5] (::var"#24#90")(ctx::Context)
   @ Main ~/.julia/packages/LLVM/vQ98J/test/core.jl:508
constant expressions: Test Failed at /home/vchuravy/.julia/packages/LLVM/vQ98J/test/helpers.jl:3
  Expression: occursin($(Expr(:escape, "i32* null")), string($(Expr(:escape, :ce))))
   Evaluated: occursin("i32* null", "ptr null")
Stacktrace:
 [1] macro expansion
   @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:463 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/LLVM/vQ98J/test/helpers.jl:3 [inlined]
 [3] macro expansion
   @ ~/.julia/packages/LLVM/vQ98J/test/core.jl:652 [inlined]
 [4] macro expansion
   @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:1356 [inlined]
 [5] (::var"#24#90")(ctx::Context)
   @ Main ~/.julia/packages/LLVM/vQ98J/test/core.jl:508
constant expressions: Test Failed at /home/vchuravy/.julia/packages/LLVM/vQ98J/test/helpers.jl:3
  Expression: occursin($(Expr(:escape, "i32 addrspace(1)* addrspacecast (i32* null to i32 addrspace(1)*)")), string($(Expr(:escape, :ce))))
   Evaluated: occursin("i32 addrspace(1)* addrspacecast (i32* null to i32 addrspace(1)*)", "ptr addrspace(1) addrspacecast (ptr null to ptr addrspace(1))")
Stacktrace:
 [1] macro expansion
   @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:463 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/LLVM/vQ98J/test/helpers.jl:3 [inlined]
 [3] macro expansion
   @ ~/.julia/packages/LLVM/vQ98J/test/core.jl:657 [inlined]
 [4] macro expansion
   @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:1356 [inlined]
 [5] (::var"#24#90")(ctx::Context)
   @ Main ~/.julia/packages/LLVM/vQ98J/test/core.jl:508
constant expressions: Test Failed at /home/vchuravy/.julia/packages/LLVM/vQ98J/test/helpers.jl:3
  Expression: occursin($(Expr(:escape, "i32 addrspace(1)* addrspacecast (i32* null to i32 addrspace(1)*)")), string($(Expr(:escape, :ce))))
   Evaluated: occursin("i32 addrspace(1)* addrspacecast (i32* null to i32 addrspace(1)*)", "ptr addrspace(1) addrspacecast (ptr null to ptr addrspace(1))")
Stacktrace:
 [1] macro expansion
   @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:463 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/LLVM/vQ98J/test/helpers.jl:3 [inlined]
 [3] macro expansion
   @ ~/.julia/packages/LLVM/vQ98J/test/core.jl:657 [inlined]
 [4] macro expansion
   @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:1356 [inlined]
 [5] (::var"#24#90")(ctx::Context)
   @ Main ~/.julia/packages/LLVM/vQ98J/test/core.jl:508
function: Error During Test at /home/vchuravy/.julia/packages/LLVM/vQ98J/test/core.jl:1050
  Test threw exception
  Expression: eltype(llvmtype(fn)) == ft
  UndefRefError: access to undefined reference
  Stacktrace:
   [1] LLVMType(ref::Ptr{LLVM.API.LLVMOpaqueType})
     @ LLVM ~/.julia/packages/LLVM/vQ98J/src/core/type.jl:33
   [2] eltype(typ::LLVM.PointerType)
     @ LLVM ~/.julia/packages/LLVM/vQ98J/src/core/type.jl:138
   [3] macro expansion
     @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:463 [inlined]
   [4] (::var"#51#117"{Context})(mod::LLVM.Module)
     @ Main ~/.julia/packages/LLVM/vQ98J/test/core.jl:1050
function: Error During Test at /home/vchuravy/.julia/packages/LLVM/vQ98J/test/core.jl:1077
  Test threw exception
  Expression: eltype(llvmtype(fn)) == ft
  UndefRefError: access to undefined reference
  Stacktrace:
   [1] LLVMType(ref::Ptr{LLVM.API.LLVMOpaqueType})
     @ LLVM ~/.julia/packages/LLVM/vQ98J/src/core/type.jl:33
   [2] eltype(typ::LLVM.PointerType)
     @ LLVM ~/.julia/packages/LLVM/vQ98J/src/core/type.jl:138
   [3] macro expansion
     @ ~/builds/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:463 [inlined]
   [4] (::var"#53#119"{Context})(mod::LLVM.Module)
     @ Main ~/.julia/packages/LLVM/vQ98J/test/core.jl:1077

signal (11): Segmentation fault
in expression starting at /home/vchuravy/.julia/packages/LLVM/vQ98J/test/instructions.jl:1
_ZNK4llvm10DataLayout12getAlignmentEPNS_4TypeEb at /home/vchuravy/builds/julia/usr/bin/../lib/libLLVM-13jl.so (unknown line)
Allocations: 32728164 (Pool: 32711647; Big: 16517); GC: 39
ERROR: Package LLVM errored during testing (received signal: 11)

(@v1.8) pkg> 
@maleadt
Copy link
Owner

maleadt commented Jan 19, 2022

Yay! How do you check for the (forced) use of opaque pointers?

@vchuravy
Copy link
Collaborator Author

It's a property on the Context.

Ctx->supportsTypedPointers()

@maleadt
Copy link
Owner

maleadt commented Mar 23, 2023

#326

@maleadt maleadt closed this as completed Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants