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

An warning about ccall occurs #5215

Closed
zhujinxuan opened this issue Dec 22, 2013 · 6 comments
Closed

An warning about ccall occurs #5215

zhujinxuan opened this issue Dec 22, 2013 · 6 comments

Comments

@zhujinxuan
Copy link

After upgrading julia from 0.3.0-prerelease+91 to 0.3.0-prerelease+618 , an error occurs when I'm reading NetCDF with NetCDF.jl:

julia> ncinfo("HadISST_sst.nc")
 warning: literal address used in ccall for (null); code cannot be statically compiled 
 warning: literal address used in ccall for (null); code cannot be statically compiled 
 warning: literal address used in ccall for (null); code cannot be statically compiled 

Does this warn me that julia have not been compiled correctly in my computer?

@timholy
Copy link
Member

timholy commented Dec 22, 2013

No, there's no major problem here. To eliminate the warning, the NetCDF.jl package should be modified to use a string rather than a pointer for the library in the ccall. I'd recommend filing an issue with the package.

To the rest: I'd close this, but it prompts a thought: should we have a documentation page that expands on the meaning of particular errors? Julia's error messages are brief and effective, but employ a fair amount of assumed knowledge/jargon:

  • "What's a literal address?"
  • "What does 'statically compiled' mean?"
  • "Wait, I thought Julia was JIT-compiled?!"
  • "I didn't write a ccall to (null)."
  • "I'm not trying to statically-compile my package"

etc.

@JeffBezanson
Copy link
Member

We should probably not show that error outside of "imaging mode".

@ivarne
Copy link
Member

ivarne commented Dec 22, 2013

@timholy Usually google does a very good job of finding a discussion about what the root cause of a error is in a particular instance, but if Julia erros/exceptions could include a link to a page on julialang.org with some discussion that would be wonderful. The trouble is that it needs to be kept up to date.

@timholy
Copy link
Member

timholy commented Dec 22, 2013

@ivarne, good point.

@JeffBezanson, agreed. Out of curiosity, when not in "imaging mode", is there a performance difference between pointer-ccalls and string-ccalls? Several libraries have recently switched (due to this warning).

@JeffBezanson
Copy link
Member

I don't think there is a performance difference, but you should avoid
calling direct pointers when possible.
On Dec 22, 2013 1:10 PM, "Tim Holy" [email protected] wrote:

@ivarne https://github.com/ivarne, good point.

@JeffBezanson https://github.com/JeffBezanson, agreed. Out of
curiosity, when not in "imaging mode", is there a performance difference
between pointer-ccalls and string-ccalls? Several libraries have recently
switched (due to this warning).


Reply to this email directly or view it on GitHubhttps://github.com//issues/5215#issuecomment-31092407
.

gitfoxi pushed a commit to gitfoxi/julia that referenced this issue Dec 23, 2013
* upstream/master: (89 commits)
  fix JuliaLang#5225
  update pcre
  fix off-by-1 in isqrt. closes JuliaLang#4884
  Add more keywords to ctags regex, plus README
  annotate the types of arguments for derived trigonometric & hyperbolic functions
  fix doc for && and || and update helpdb
  only show ccall literal address warning in imaging mode. closes JuliaLang#5215
  minor update of hypot to ensure consistency of output types
  Fix JuliaLang#5217
  silence compiler warning
  hopefully more robust way of getting github URL (don't assume module name is Pkg name)
  add text/html writemime for MethodList and Method (fix JuliaLang#4952)
  update NEWS
  doc: `import M: single,name` syntax, close JuliaLang#5214
  clean up native finalizers code
  specialized abs2 for bool
  remove use of callback API in REPL
  Some error message cleanup to fix segfault when transposing sparse vector with illegal values.
  test/git*.jl: don't use `echo` to read-and-write from processes.
  test/git*.jl: don't use `echo` to read-and-write from processes.
  ...
@vtjnash
Copy link
Member

vtjnash commented Apr 3, 2014

Pointer-ccalls that got this warning would segfault if compiled into the system image. I added this warning specifically for the non-imaging mode case so that packages code would get this deprecation warning, especially since they can already be added to the sysimg. Can we instead improve the error message & add a link to some added documentation to help the user? (actually, can we just add error codes to all of our error messages and write a cross-reference page with extended documentation describing the error -- #6386)

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

5 participants