strings-test.js fails on s390x

Bug #1967589 reported by Bryce Harrington
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nodejs nan
New
Unknown
node-nan (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

https://autopkgtest.ubuntu.com/results/autopkgtest-jammy/jammy/s390x/n/node-nan/20220306_113841_a17b2@/log.gz

  534 passing (12s)
  1 failing

  1) test/js/strings-test.js FromV8String should be equal:

      Error: should be equal
      + expected - actual

      -栀攀氀氀漀
      +hello

      at Test.<anonymous> (test/js/strings-test.js:36:5)
      at Object.<anonymous> (test/js/strings-test.js:14:1)

Google translate says "栀攀氀氀漀" means "gardenia" in English. I'm guessing instead the result is just garbage data. There's no indication from the test that this could resolve to anything other than "hello". The test's code is:

  /* we check Buffer.alloc rather than Buffer.from because
   * we don't want the base class Uint8Array.from */
  if (typeof(Buffer.alloc) === "function") {
    buf = Buffer.from('hello');
  } else {
    buf = new Buffer('hello');
  }
  t.equal(bindings.encodeHex(), buf.toString('hex'));
  t.equal(bindings.encodeUCS2(), 'hello');

Upstream issues https://github.com/nodejs/nan/issues/481 and https://github.com/nodejs/nan/issues/507, while fairly ancient and unlikely to relate to this particular issue, do suggest that big endian issues may not be as thoroughly tested. So perhaps this is an endian issue with this usage of the Buffer class?

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package node-nan - 2.15.0-1ubuntu1

---------------
node-nan (2.15.0-1ubuntu1) jammy; urgency=medium

  * d/p/disable-test-for-s390x.patch: Disable part of strings-test
    - This test case breaks on s390x, presumably due to endian issue
      (LP: #1967589)

 -- Bryce Harrington <email address hidden> Sat, 02 Apr 2022 02:16:42 +0000

Changed in node-nan (Ubuntu):
status: New → Fix Released
Changed in node-nan:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.