ICE: Assertion 'buff_index <= buff_size' failed at (ecma_builtin_number_prototype_object_to_string):309
Version: 17a5dd27bbbadc036d83be0448f9edfa90800147
System:
Linux eg 4.2.0-18-generic #22-Ubuntu SMP Fri Nov 6 18:25:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Output:
ICE: Assertion 'buff_index <= buff_size' failed at /home/eg/dev/jr/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.cpp(ecma_builtin_number_prototype_object_to_string):309.
Error: ERR_FAILED_INTERNAL_ASSERTION
Test case:
// Cj
var big = 2147483646;
big++;
assert(big == 2147483647);
big += 1;
assert(big == 2147483648); // s
big++;
assert(big == 2147483649); // s
assert ((1152921504606846600).toString([1,2,3,4].slice(1,2)) === "11506847000")
rt (1.79e+308 === Infinity);
Fails on current master (91a0514).
Minimal testcase:
assert ((1152921504606846600).toString([1,2,3,4].slice(1,2)) === "11506847000");
Still fails on current master (9bce5b0).
The issue is still valid on current master (8edab96).
Still fails on master (62a581f).
$ build/bin/jerry
jerry> assert ((1152921504606846600).toString([1,2,3,4].slice(1,2)) === "11506847000");
ICE: Assertion 'buff_index <= buff_size' failed at /home/t/jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c(ecma_builtin_number_prototype_object_to_string):409.
Error: ERR_FAILED_INTERNAL_ASSERTION
I have no idea how to fix this. Problem is:
log (115292150460684000) / log (2) = 59.999999999999999529496732252183888148671846990644
(Computed by: http://keisan.casio.com/calculator )
floor(log (115292150460684000) / log (2)) -> should be 59.
However, it is 60 with double precision.
@zherczeg : That's right! The problem comes from the inaccuracy of the log (115292150460684660) / log (2) division. I've added a PR above, which fixes it.
Fixed in #1650.