[#100284] [Ruby master Bug#17211] Test failures in ruby2.7.2 and ruby3.0~preview1 — utkarsh@...

Issue #17211 has been reported by utkarsh (Utkarsh Gupta).

10 messages 2020/10/02

[#100301] [Ruby master Feature#17215] Backport for arm64 optimizations that exist for power/x86 — jaruga@...

Issue #17215 has been reported by jaruga (Jun Aruga).

10 messages 2020/10/05

[#100329] [Ruby master Bug#17220] Rails Active Job integration test fails with Ruby 3.0.0 since 2038cc6cab6ceeffef3ec3a765c70ae684f829ed — yasuo.honda@...

Issue #17220 has been reported by yahonda (Yasuo Honda).

28 messages 2020/10/07

[#100332] [Ruby master Bug#17221] Relax the Fiber#transfer's limitation — ko1@...

Issue #17221 has been reported by ko1 (Koichi Sasada).

15 messages 2020/10/07

[#100348] [Ruby master Bug#17257] Integer#pow(0, 1) returns 1, which is incorrect — universato@...

Issue #17257 has been reported by universato (Yoshimine Sato).

13 messages 2020/10/09

[#100371] [Ruby master Feature#17260] Promote pattern matching to official feature — kazuki@...

Issue #17260 has been reported by ktsj (Kazuki Tsujimoto).

10 messages 2020/10/11

[#100383] [Ruby master Feature#17261] Software transactional memory (STM) for Threads and Ractors — ko1@...

Issue #17261 has been reported by ko1 (Koichi Sasada).

14 messages 2020/10/12

[#100401] [Ruby master Bug#17263] Fiber context switch degrades with number of fibers, limit on number of fibers — ciconia@...

Issue #17263 has been reported by ciconia (Sharon Rosner).

14 messages 2020/10/15

[#100422] [CommonRuby Feature#17265] Add `Bool` module — marcandre-ruby-core@...

Issue #17265 has been reported by marcandre (Marc-Andre Lafortune).

11 messages 2020/10/19

[#100466] [Ruby master Feature#17273] shareable_constant_value pragma — ko1@...

Issue #17273 has been reported by ko1 (Koichi Sasada).

14 messages 2020/10/21

[#100471] [Ruby master Feature#17277] Make Enumerator#with_index yield row and col indices for Matrix — grzegorz.jakubiak@...

Issue #17277 has been reported by greggzst (Grzegorz Jakubiak).

8 messages 2020/10/21

[#100479] [Ruby master Feature#17278] On-demand sharing of constants for Ractor — daniel@...42.com

Issue #17278 has been reported by Dan0042 (Daniel DeLorme).

13 messages 2020/10/21

[#100534] [Ruby master Feature#17284] Shareable Proc — ko1@...

Issue #17284 has been reported by ko1 (Koichi Sasada).

16 messages 2020/10/25

[#100597] [Ruby master Feature#17288] Optimize __send__ call with a literal method name — muraken@...

Issue #17288 has been reported by mrkn (Kenta Murata).

13 messages 2020/10/27

[#100669] [Ruby master Feature#17295] Feature: Create a directory and file with Pathname#touch — get.codetriage@...

Issue #17295 has been reported by schneems (Richard Schneeman).

9 messages 2020/10/30

[#100673] [Ruby master Feature#17298] Ractor's basket communication APIs — ko1@...

Issue #17298 has been reported by ko1 (Koichi Sasada).

15 messages 2020/10/30

[#100675] [Ruby master Misc#17299] DevelopersMeeting20201120Japan — mame@...

Issue #17299 has been reported by mame (Yusuke Endoh).

11 messages 2020/10/31

[ruby-core:100246] [Ruby master Bug#17205] Misleading error message when comparing NaN with numbers in array

From: shyouhei@...
Date: 2020-10-01 02:38:31 UTC
List: ruby-core #100246
Issue #17205 has been updated by shyouhei (Shyouhei Urabe).


JFYI the reason why "implicit conversion from nil to integer" happens:

```
zsh % LC_ALL=C gdb --args ./miniruby -e'[Float::NAN, 1.0].min'
GNU gdb (Ubuntu 8.2-0ubuntu1~18.04) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./miniruby...done.
(gdb) break rb_raise
Breakpoint 1 at 0xc4520: file error.c, line 2824.
(gdb) run
Starting program: ./miniruby -e\[Float::NAN,\ 1.0\].min
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, rb_raise (exc=93824999143280, fmt=fmt@entry=0x55555583a928 "no implicit conversion from nil to integer") at error.c:2824
2824    {
(gdb) bt
#0  rb_raise (exc=93824999143280, fmt=fmt@entry=0x55555583a928 "no implicit conversion from nil to integer") at error.c:2824
#1  0x00005555556c9421 in rb_num2long (val=<optimized out>) at numeric.c:2885
#2  0x00005555556ca28e in rb_num2int (val=<optimized out>) at numeric.c:2989
#3  rb_num2int_inline (x=<optimized out>) at include/ruby/internal/arithmetic/int.h:95
#4  rb_float_cmp (x=18410715276690587650, y=<optimized out>) at numeric.c:1521
#5  0x0000555555803fa9 in vm_opt_newarray_min (ptr=<optimized out>, num=<optimized out>) at vm_method.c:2293
#6  vm_exec_core (ec=0x555555beb770, initial=93824995273000) at insns.def:863
#7  0x00005555557f4f90 in rb_vm_exec (ec=0x555555b3f5b0, mjit_enable_p=1) at vm.c:1983
#8  0x000055555561b940 in rb_ec_exec_node (ec=ec@entry=0x555555b3f5b0, n=n@entry=0x555555b63dc0) at eval.c:308
#9  0x000055555561fef7 in ruby_run_node (n=0x555555b63dc0) at eval.c:366
#10 0x000055555558165f in main (argc=<optimized out>, argv=<optimized out>) at main.c:50
(gdb)
```

I guess this is a bug of `rb_float_cmp()`.

----------------------------------------
Bug #17205: Misleading error message when comparing NaN with numbers in array
https://bugs.ruby-lang.org/issues/17205#change-87833

* Author: timhwang21 (Tim Hwang)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0dev (2020-09-30T11:43:19Z master 65e8a29389) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The closest issue I could find is this: https://bugs.ruby-lang.org/issues/10424

There is quite a lot of inconsistency when dealing with arrays containing `NaN`, dependent on 1) if comparing against an integer or a float, 2) order of comparison. The one that stands out to me as "least correct" is the last one (`[Float::NAN, 1.0].min`) which raises `TypeError (no implicit conversion from nil to integer)`.

``` ruby
# .sort
[1, Float::NAN].sort
# Most sensible error message
# ArgumentError (comparison of Integer with NaN failed)

[1.0, Float::NAN].sort
# Somewhat sensible error message
# TypeError (no implicit conversion from nil to integer)

[Float::NAN, 1].sort
# Somewhat sensible error message
# TypeError (no implicit conversion from nil to integer)

[Float::NAN, 1.0].sort
# Somewhat sensible error message
# TypeError (no implicit conversion from nil to integer)

# .min
[1, Float::NAN].min
# Most sensible error message
# ArgumentError (comparison of Float with 1 failed)

[1.0, Float::NAN].min
# Somewhat sensible error message
# TypeError (no implicit conversion from nil to integer)

[Float::NAN, 1].min
# Most sensible error message
# ArgumentError (comparison of Integer with NaN failed)

[Float::NAN, 1.0].min
# Very misleading error message
# TypeError (no implicit conversion from nil to integer)
```




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next