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

cglobal only shows result on assignment #8464

Closed
ViralBShah opened this issue Sep 24, 2014 · 4 comments
Closed

cglobal only shows result on assignment #8464

ViralBShah opened this issue Sep 24, 2014 · 4 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@ViralBShah
Copy link
Member

Trying the example in http://julia.readthedocs.org/en/latest/manual/calling-c-and-fortran-code/#accessing-global-variables gives on mac:

julia> cglobal((:errno, :libc), Int32)
()

but

julia> x = cglobal((:errno, :libc), Int32)
Ptr{Int32} @0x00007fff73f4f280

Is this a bug or does the documentation need updating?

@ViralBShah ViralBShah added docs This change adds or pertains to documentation system:mac Affects only macOS and removed system:mac Affects only macOS labels Sep 24, 2014
@ViralBShah
Copy link
Member Author

On ARM, the non-assignment case fails, while the one with assignment works.

julia> x = cglobal((:errno, :libc), Int32)
Ptr{Int32} @0xb6feb4d0

julia> cglobal((:errno, :libc), Int32)
julia: cgutils.cpp:1501: jl_value_t* static_constant_instance(llvm::Constant*, jl_value_t*): Assertion `((((jl_value_t*)(jt))->type)==(jl_value_t*)(jl_tuple_type))' failed.

signal (6): Aborted
Aborted (core dumped)

@JeffBezanson JeffBezanson added bug Indicates an unexpected problem or unintended behavior and removed docs This change adds or pertains to documentation labels Sep 25, 2014
@JeffBezanson JeffBezanson self-assigned this Sep 25, 2014
@JeffBezanson
Copy link
Member

cc @JuliaBackports

JeffBezanson added a commit that referenced this issue Sep 25, 2014
backport of 94093ce
@ivarne
Copy link
Member

ivarne commented Sep 25, 2014

Backported in d66708f

@tkelman
Copy link
Contributor

tkelman commented Sep 25, 2014

can/should this be tested?

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
Projects
None yet
Development

No branches or pull requests

4 participants