-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Seg Fault in compile #9475
Comments
Also, if anyone knows how I can fill the joint_states array from within the @nLoops stuff, lemme know! |
I don't think you can do this, because the cartesian macros run at parsing time (e.g., But I haven't looked into the segfault. |
Right, that's why I'm using @eval (@nloops $Tl _t ((_) -> 1:$D) begin
yl = @ntuple $Tl _t
stuff = (yl, $_brute_unnorm_logprob($xl, yl, $θ, $γ))
println(stuff)
end) without any issue and it works as expected. What's the difference between |
You're right, I missed the If you're on julia 0.4, you should be able to do this without any macro-fu with the |
Yeah it's far from ideal. I'm not using 0.4 yet so I ended up just using something along the lines of map(x -> 1 + digits(x, D, Tl), 0:(D^Tl - 1)) I figured I should at least report the segfault though. |
Ok here's a minimal test case using Base.Cartesian
arr = Array(Any, 1)
@eval @eval $arr[1] = 1
@eval @eval $arr = 1 Either of the |
This is very helpful, and many thanks for reporting it. Interestingly, this segfaults: arr = Array(Any, 1)
@eval @eval $arr[1] = 1 but this does not: arr = Array(Any, 1)
@eval $arr[1] = 1
@eval @eval $arr[1] = 1 |
The cause is trying to copy an undefined array element:
A mildly unsatisfying fix:
|
Why do you need the 2nd |
@timholy not sure I follow? (the patch would move that condition to |
@ihnorton i don't see anything wrong with that. checking for NULL is a normal conditional, and it's currently missing here |
@vtjnash is it possible that |
@ihnorton, I read a |
@ihnorton no, julia never leaves a jl_value_t* field uninitialized (to NULL). an isbits field could be uninitialized, but this code shouldn't come across any unboxed data. |
@vtjnash thanks. I'll check this in then if CI passes (just pushed a branch). |
@ihnorton I don't know if there's a good way of telling only Travis but not AppVeyor to skip a build. Right now I have AppVeyor configured to not build branches other than master and release-0.3, but if you want it to build a personal test branch you can add the branch name to the whitelist in appveyor.yml of that branch. |
I have a script that looks something like this:
Attempting to run gives me:
The text was updated successfully, but these errors were encountered: