Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Assertion 'local_tza == ecma_date_local_time_zone_adjustment (date_value)' failed at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c(ecma_builtin_date_prototype_dispatch_routine):689. #4940

Closed
SwtWld opened this issue Jan 4, 2022 · 0 comments · Fixed by #4955
Assignees
Labels
bug Undesired behaviour

Comments

@SwtWld
Copy link

SwtWld commented Jan 4, 2022

JerryScript revision

Commit: a6ab5e9

Version: v3.0.0

Build platform

Ubuntu 18.04.5 LTS (Linux 4.19.128-microsoft-standard x86_64)

Ubuntu 18.04.5 LTS (Linux 5.4.0-44-generic x86_64)

Build steps
python ./tools/build.py --clean --debug --compile-flag=-fsanitize=address --compile-flag=-m32 --compile-flag=-g --strip=off --lto=off --logging=on --line-info=on --error-message=on --system-allocator=on --stack-limit=20
Test case
poc.js

var mydate = new Date();
var myyear = mydate.getFullYear();
var mymonth = mydate.setYear() + 1;
var myday = mydate.getDate();
var sum = 0;
var avg;
var weekday = [
    'Sun',
    'Mon',
    'Tue',
    'Wed',
    'Thu',
    'Fri',
    'Sat'
];
var scoreStr = 'X1:87;X2:81;X3:97;X4:76;X5:74;X6:94;X7:90;X8:76;X9:64;XX:76';
var arr = Date();
for (var i = 0; i < arr.length; i++) {
    var index = arr[i].indexOf(':');
    sum += parseInt(arr[i].substr(Symbol(''), Symbol(''), 'empty string'));
}
avg = sum / arr.length;
avg = Math.floor(avg);

Execution steps & Output
$ ./jerryscript/build/bin/jerry poc.js

ICE: Assertion 'local_tza == ecma_date_local_time_zone_adjustment (date_value)' failed at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c(ecma_builtin_date_prototype_dispatch_routine):689.
Error: ERR_FAILED_INTERNAL_ASSERTION
[1]    209 abort      jerry poc.js

Credits: Found by OWL337 team.

@rerobika rerobika added the bug Undesired behaviour label Jan 4, 2022
rerobika pushed a commit to rerobika/jerryscript that referenced this issue Jan 4, 2022
This patch fixes jerryscript-project#4939 and fixes jerryscript-project#4940.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
@rerobika rerobika self-assigned this Jan 4, 2022
dbatyai pushed a commit that referenced this issue Jan 10, 2022
This patch fixes #4939 and fixes #4940.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Undesired behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants