-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Segfault issue #5125
Comments
You are using generic class inheritance. That's probably the reason for the segfault. I see you don't use It the segfault still happens, report back. Otherwise, I'm sure this is a duplicate of one of the existing bugs related to generic types and inheritance. (I don't have time to try this today) |
I just tried it with this (it took me 1 minute): class Clear::Expression::Node::Literal < Clear::Expression::Node
def initialize(@lit : Bool | Int32 | String | Time)
end
def resolve
Clear::Expression[@lit]
end
end The segfault is gone. Maybe a duplicate of #3299 But generally related to #2665 I might try to fix this (maybe not very hard) but I can't promise anything. My only advice is to avoid generic inheritance for now. |
Why is this closed? |
@straight-shoota I think he gave up on Crystal because of bugs that never get fixed. That happens to me sometimes. |
I closed it because:
Anyway, the lack of concise reproductible code makes this issue difficult to check if yes or no this is working through spec or else. |
I'm currently working on an open source project and I face a segfault issue in my specs; this bug happens pseudo-randomly, as changing the order of the specs would lead to success or crashing of the test-case.
I tried to "isolate" the issue for hours, and managed to clear some features which are known to be buggy (e.g.
method missing) but I cannot figure out what's wrong here.
Sadly I'm not able to paste here a small reproductible code, however I have full reproductible case of the bug in the full library.
Since it's an open source / on my free time project, I just commited it on github here:
https://github.com/anykeyh/clear
Thankfully the event is fully reproduceable:
To make it crash (see stacktrace below)
crystal run spec/sql/select.cr
To make it behave strangely. Here it won't crash but the spec will fail with "random" data (a date where an array is pushed in parameters)
crystal run --release spec/sql/select.cr
If you change the order of the spec in the source code, it will not crash anymore. Or it will. Well, it depends of the order of the spec...
PS: I've made a branch "segfault" to keep track of the buggy code, in case I continue to develop on it.
Additional informations:
Stacktrace
Weird output in
--release
mode :there's typo in date format, however (07:11.962 = 431.962 seconds just fyi)
The text was updated successfully, but these errors were encountered: