Skip to content

Unexpected termination (-nan is outside the range) in ext/standard/basic_functions.c #14774

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
$values1 = array(234, false);
$values2 = array(2, false);
for ($i = 0; $i < count($values1); $i++) {
        for ($j = 0; $j < count($values2); $j++) {
        $res = fmod($values1[$i], $values2[$j]);
        }
}
time_sleep_until($res);

Resulted in this output:

Terminated

ASan:

/php-src/ext/standard/basic_functions.c:1207:14: runtime error: -nan is outside the range of representable values of type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/standard/basic_functions.c:1207:14

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions