Fails to load in JRuby: RangeError (bignum too big to convert into `long')
- 主要语言
- Ruby
- 星标
- 98
- 派生
- 54
- PR 合并指标
- 30 天内没有已合并 PR
描述
This module expects in multiple locations that it can convert the special numbers 0 and 2^64-1 into a time stamp. This does not work in JRuby, where it uses a signed long to work on times.
```
irb(main):002:0> require "ssh_data"
Traceback (most recent call last):
16: from org/jruby/RubyKernel.java:1052:in `load'
15: from /usr/share/jruby/bin/irb:11:in `'
14: from org/jruby/RubyKernel.java:1237:in `catch'
13: from org/jruby/RubyKernel.java:1237:in `catch'
12: from org/jruby/RubyKernel.java:1507:in `loop'
11: from org/jruby/RubyKernel.java:1091:in `eval'
10: from (irb):2:in `evaluate'
9: from /usr/share/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:160:in `require'
8: from org/jruby/RubyKernel.java:1017:in `require'
7: from /var/lib/puppetserver/jruby-gems/gems/ssh_data-1.3.0/lib/ssh_data.rb:33:in `'
6: from /usr/share/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85:in `require'
5: from org/jruby/RubyKernel.java:1017:in `require'
4: from /var/lib/puppetserver/jruby-gems/gems/ssh_data-1.3.0/lib/ssh_data/certificate.rb:4:in `'
3: from /var/lib/puppetserver/jruby-gems/gems/ssh_data-1.3.0/lib/ssh_data/certificate.rb:5:in `'
2: from /var/lib/puppetserver/jruby-gems/gems/ssh_data-1.3.0/lib/ssh_data/certificate.rb:8:in `'
1: from org/jruby/RubyTime.java:1336:in `at'
RangeError (bignum too big to convert into `long')
```
贡献指南
调研方向
首先,在 JRuby 下使用 `require "ssh_data"` 重现该故障,然后检查 `lib/ssh_data/certificate.rb`,目前加载过程会到达其中的 `Time.at`,以及 `lib/ssh_data.rb` 中相关的加载路径。找出将 0 和 2^64-1 转换为时间戳的其他位置,并验证该库能够在 JRuby 下成功加载且不会出现 RangeError。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- ruby
- 领域
- security
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100