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

conditional @warn("...") leads to a segfault #28746

Closed
kafisatz opened this issue Aug 18, 2018 · 3 comments
Closed

conditional @warn("...") leads to a segfault #28746

kafisatz opened this issue Aug 18, 2018 · 3 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@kafisatz
Copy link

I have made a PR to my package which only adds a @warn("...some text...") statement (inside an if end clause).
This leads to a segfault.
See travis of this PR: kafisatz/DecisionTrees.jl#22

Any ideas why that would happen?
The change seems so minor, I am puzzled why this crashes Julia.
Am I missing something?

Notably the all tests ran fine before that change.
This can be seen in build 304 on travis:
https://travis-ci.org/kafisatz/DecisionTrees.jl/builds/417735978

@kafisatz
Copy link
Author

kafisatz commented Aug 19, 2018

On second thought it might be the if condition itself that leads to the crash of Julia (and not the warn).
But the if condition is so simple. It is unclear to me why it crashes Julia.

I quickly ran all the tests with this snippet of code (at the right location). It runs through fine.

    @show obstrn+obsval
    @show typeof(obstrn+obsval)
    @show typeof(size(features,1))
    @assert isa(obstrn+obsval,Int)
    @assert isa(size(features,1),Int)
    if size(features,1) != obstrn+obsval 
    #    @warn("DTM: obstrn+obsval != size(features,1). This is experimental.")
    end

@KristofferC KristofferC added the bug Indicates an unexpected problem or unintended behavior label Aug 19, 2018
@KristofferC
Copy link
Member

But the if condition is so simple. It is unclear to me why it crashes Julia.

While it might look simple, compilers and optimizers are complex systems so adding something innocent looking might still trigger a bad path due to how all the surrounding code happen to look.

It is great to have a reproducible example like the one you provided.

@Keno
Copy link
Member

Keno commented Sep 3, 2018

I suspect this is another instance of the bug you reported in #28536 (fixed by #29015). Your code has patterns that is likely to trigger that issue. If you run into this again on a version that includes that fix, please file a new issue.

@Keno Keno closed this as completed Sep 3, 2018
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

3 participants