Skip to content

[ HipHop Debugger ] dict[0 => NAN] equals itself in the debugger, but not cli or server mode #9272

Open
@lexidor

Description

Describe the bug
Comparing the value dict[0 => NAN] to itself is equal in the HipHop debugger hhvm --no-config -a. When running are script from the cli or in a webserver, these values are not equal.

Standalone code, or other way to reproduce the problem

<<__EntryPoint>>
function main(): void {
  echo (dict[0 => NAN] === dict[0 => NAN] ? 'equal' : 'not equal')."\n";
}

Steps to reproduce the behavior:

  1. Run the above code from the cli using hhvm --no-config file.hack
  2. Run the above code in web server mode using hhvm --no-config -m server -p 8080 and visit localhost:8080/file.hack
  3. Observe not equal being printed in both cases.
  4. Start the HipHop debugger using hhvm --no-config -a.
  5. Paste the following statement echo (dict[0 => NAN] === dict[0 => NAN] ? 'equal' : 'not equal')."\n";.
  6. Observe equal being printed.

Expected behavior

The behavior of this comparison should not differ between debugger and script mode. From my understanding, they should compare equal.

See: https://github.com/facebook/hhvm/blob/master/hphp/test/slow/comparisons/nan_array_id_test.php and https://github.com/facebook/hhvm/blob/master/hphp/test/slow/comparisons/nan_array_id_test.php.expect

My understanding could be wrong here, so please verify what the proper behavior should be with someone in the know first.

Actual behavior

Output differs between the debugger and cli / server mode.

Environment

  • Operating system

Ubuntu 18.04

  • Installation method

apt-get with dl.hhvm.com repository

  • HHVM Version
HipHop VM 4.169.0 (rel) (non-lowptr)
Compiler: 1663640616_852546864
Repo schema: ce4145c518e16986e860178941c05dc9f11eab61

Additional context
N/A

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions