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

Crystal 1.8 : Enumerable(Range) error #13340

Closed
hutou opened this issue Apr 18, 2023 · 2 comments
Closed

Crystal 1.8 : Enumerable(Range) error #13340

hutou opened this issue Apr 18, 2023 · 2 comments
Assignees
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. status:duplicate topic:stdlib:collection

Comments

@hutou
Copy link
Contributor

hutou commented Apr 18, 2023

The following code compiles

class Test(T)
  def initialize(@sources : Enumerable(T))
    @count = @sources.size
  end
end
p! Test.new(1..3)

Running the binary gives the following error message:

Test.new(1..3) # => Invalid memory access (signal 11) at address 0x0
[0x56474885c666] *Exception::CallStack::print_backtrace:Nil +118 in ./range
[0x56474884bdd6] ~procProc(Int32, Pointer(LibC::SiginfoT), Pointer(Void), Nil) +310 in ./range
[0x7fac7266cf50] ?? +140378630442832 in /usr/lib/libc.so.6
[0x564748872b63] *Slice(T)::new:read_only<Pointer(UInt8), Int32, Bool>:Slice(UInt8) +35 in ./range
[0x5647488685c5] *String#to_slice:Slice(UInt8) +37 in ./range
[0x564748871538] *String#to_sIO::FileDescriptor:Nil +24 in ./range
[0x5647488c33fb] *IO::FileDescriptor +27 in ./range
Erreur de segmentation (core dumped)

This refers to #13121

@hutou hutou added the kind:bug A bug in the code. Does not apply to documentation, specs, etc. label Apr 18, 2023
@straight-shoota straight-shoota self-assigned this Apr 18, 2023
@beta-ziliani
Copy link
Member

Duplicate of #10518

@beta-ziliani beta-ziliani marked this as a duplicate of #10518 Apr 18, 2023
@beta-ziliani beta-ziliani closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2023
@straight-shoota
Copy link
Member

For the record: This has nothing to do with #13121. The code already fails with 1.7.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. status:duplicate topic:stdlib:collection
Projects
None yet
Development

No branches or pull requests

4 participants