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

Call to cfunction(noop_func, ...) [without using the result pointer] segfaults since 0.7.0-DEV.4497 #26607

Closed
luchr opened this issue Mar 24, 2018 · 4 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version

Comments

@luchr
Copy link

luchr commented Mar 24, 2018

The following few lines produce (for me) a deterministic segfault inside the callthis(Int32(0)) call:

noop_func = () -> nothing

function callthis(args)
  cfunction(noop_func, Cvoid, Tuple{})
  return nothing
end

callthis(Int64(0))
callthis(Int32(0))

Julia-Version:

Julia Version 0.7.0-DEV.4690
Commit 78c7d87369 (2018-03-23 22:25 UTC)
Platform Info:
  OS: Linux (x86_64-redhat-linux)
  CPU: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)
Environment:

I have no idea why. Perhaps the noop_func is "optimized" away?

@ararslan ararslan added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version labels Mar 24, 2018
@ararslan
Copy link
Member

Also note that this doesn't happen on 0.6.

@luchr
Copy link
Author

luchr commented Mar 24, 2018

Oh. I forgot to mention: This bug was introduced somewhere between 0.7.0-DEV.4362 and 0.7.0-DEV.4690.

@luchr
Copy link
Author

luchr commented Mar 25, 2018

After git bisect:
The bug was introduced in commit 7934810 (=0.7.0-DEV.4497).

@luchr luchr changed the title Call to cfunction(noop_func, ...) [without using the result pointer] segfaults on 0.7.0-DEV.4690 Call to cfunction(noop_func, ...) [without using the result pointer] segfaults since 0.7.0-DEV.4497 Mar 25, 2018
@StefanKarpinski
Copy link
Member

cc @vtjnash

vtjnash added a commit that referenced this issue Apr 2, 2018
vtjnash added a commit that referenced this issue Apr 2, 2018
@vtjnash vtjnash closed this as completed in 049b9bc Apr 3, 2018
mbauman added a commit that referenced this issue Apr 19, 2018
* origin/master: (22 commits)
  separate `isbitstype(::Type)` from `isbits` (#26850)
  bugfix for regex matches ending with non-ASCII (#26831)
  [NewOptimizer] track inbounds state as a per-statement flag
  change default LOAD_PATH and DEPOT_PATH (#26804, fix #25709)
  Change url scheme to https (#26835)
  [NewOptimizer] inlining: Refactor todo object
  inference: enable CodeInfo method_for_inference_limit_heuristics support (#26822)
  [NewOptimizer] Fix _apply elision (#26821)
  add test case from issue #26607, cfunction with no args (#26838)
  add `do` in front-end deparser. fixes #17781 (#26840)
  Preserve CallInst metadata in LateLowerGCFrame pass.
  Improve differences from R documentation (#26810)
  reserve syntax that could be used for computed field types (#18466) (#26816)
  Add support for Atomic{Bool} (Fix #26542). (#26597)
  Remove argument restriction on dims2string and inds2string (#26799) (#26817)
  remove some unnecessary `eltype` methods (#26791)
  optimize: ensure merge_value_ssa doesn't drop PiNodes
  inference: improve tmerge for Conditional and Const
  ensure more iterators stay type-stable
  code loading docs (#26787)
  ...
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 regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

4 participants