Skip to content

Conversation

@Drieger
Copy link
Contributor

@Drieger Drieger commented Apr 17, 2018

Fixes: #158

bnoordhuis

This comment was marked as off-topic.

@mmarchini
Copy link
Contributor

@bnoordhuis are you getting "Zlib: onerror" should be in findjsobjects -d as well? That's the only failure I'm getting on my machine, but it's also happening on V9.x, so I think it's unrelated.

@Drieger
Copy link
Contributor Author

Drieger commented Apr 19, 2018

@bnoordhuis I ran make format and updated this PR, the only thing that I think might looks misleading is the line break inside an argument. It might be just because I'm not used to it as well.

Running test suite here didn't present any error.

@joyeecheung
Copy link
Member

@Drieger The test suites here only test up to v9.x (v8 v6.2)

@Drieger
Copy link
Contributor Author

Drieger commented Apr 20, 2018

@joyeecheung I ran tests against Node.js master, using the following command:

TEST_LLDB_BINARY=`which lldb-5.0` LLNODE_NODE_EXE=/Workspace/node/node npm run test

Is that right? How could I run test suite against the correct V8 version?

@joyeecheung
Copy link
Member

joyeecheung commented Apr 20, 2018

@Drieger LLNODE_NODE_EXE is used to match the executable generating a prepared core dump e.g. you can point it to a Linux executable on macOS to match a Linux core dump. It is not used to run tests.

You can alter your $PATH or use nvm to install nightlies to make sure your global node points to a more recent build. I usually use something like PATH=/path/to/node/project:$PATH /path/to/node/project/deps/npm/bin/npm-cli.js to run npm.

@mmarchini
Copy link
Contributor

@Drieger if you want to use nvm:

https://gist.github.com/chicoxyzzy/77dcbf21485d80b3ad870ed0d3286579

@bnoordhuis
Copy link
Member

are you getting "Zlib: onerror" should be in findjsobjects -d as well?

@mmarchini That, and a few others. With lldb-902.0.79.2:

Details
$ npm test

> llnode@1.7.0 test /Users/bnoordhuis/src/llnode
> tape test/*-test.js

TAP version 13
# v8 stack
ok 1 undefined
ok 2 null
ok 3 frame count
ok 4 eyecatcher frame
ok 5 arguments adapter frame
ok 6 crasher frame
ok 7 exit frame
ok 8 global this
ok 9 undefined this
# v8 inspect
ok 10 method should have `this` and `fn`
ok 11 method[[context]].(previous) should exist
ok 12 method[[context]].(closure) should exist
ok 13 method[[context]].scopedVar should exist
ok 14 method[[context]].scopedAPI should exist
ok 15 method[[context]].scopedArray should exist
ok 16 method[[context]].closure.outerVar should exist
ok 17 method[[context]].(closure) validator should complete
not ok 18 method[[context]].closure.scopedAPI should have internal fields
  ---
    operator: ok
    expected: true
    actual:   false
    at: sess.linesUntil (/Users/bnoordhuis/src/llnode/test/inspect-test.js:339:11)
    stack: |-
      Error: method[[context]].closure.scopedAPI should have internal fields
          at Test.assert [as _assert] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:225:54)
          at Test.bound [as _assert] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:77:32)
          at Test.ok.Test.true.Test.assert (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:346:10)
          at Test.bound [as ok] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:77:32)
          at sess.linesUntil (/Users/bnoordhuis/src/llnode/test/inspect-test.js:339:11)
          at SessionOutput.onLine (/Users/bnoordhuis/src/llnode/test/common.js:110:5)
          at SessionOutput.emit (events.js:182:13)
          at Socket.SessionOutput.stream.on (/Users/bnoordhuis/src/llnode/test/common.js:61:14)
          at Socket.emit (events.js:182:13)
          at addChunk (_stream_readable.js:277:12)
  ...
ok 19 method[[context]].scopedAPI validator should complete
ok 20 method[[context]].scopedArray[0] should be `<Smi: 0>`
ok 21 method[[context]].scopedArray[1] should be a Zlib
ok 22 method[[context]].scopedArray validator should complete
ok 23 v8 inspect -s <method> should return output
ok 24 method source should match
ok 25 address in the detailed view of Class should match the address in the parent's view
========== lldb output ==========

=================================
not ok 26 Error: Test timeout in 10000 waiting for /}>/
  ---
    operator: error
    expected: |-
      undefined
    actual: |-
      [Error: Test timeout in 10000 waiting for /}>/]
    at: teardown (/Users/bnoordhuis/src/llnode/test/inspect-test.js:486:5)
    stack: |-
      Error: Test timeout in 10000 waiting for /}>/
          at Timeout.setTimeout [as _onTimeout] (/Users/bnoordhuis/src/llnode/test/common.js:125:14)
          at ontimeout (timers.js:426:11)
          at tryOnTimeout (timers.js:289:5)
          at unrefdHandle (timers.js:511:7)
          at Timer.processTimers (timers.js:211:12)
  ...
# v8 findrefs and friends
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: '/var/folders/8j/6fvr0kkj4yjdsdzmrmyjzkyh0000gn/T/core': truncated or malformed object (load command 0 unknown flavor (6) for flavor number 1 in LC_THREAD command)
ok 27 null
ok 28 Saved core
ok 29 null
ok 30 Loaded core
ok 31 null
ok 32 Zlib should be in findjsobjects
ok 33 null
ok 34 Zlib should be in findjsobjects -d
not ok 35 "Zlib: onerror" should be in findjsobjects -d
  ---
    operator: ok
    expected: true
    actual:   false
    at: sess.linesUntil (/Users/bnoordhuis/src/llnode/test/scan-test.js:50:7)
    stack: |-
      Error: "Zlib: onerror" should be in findjsobjects -d
          at Test.assert [as _assert] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:225:54)
          at Test.bound [as _assert] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:77:32)
          at Test.ok.Test.true.Test.assert (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:346:10)
          at Test.bound [as ok] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:77:32)
          at sess.linesUntil (/Users/bnoordhuis/src/llnode/test/scan-test.js:50:7)
          at SessionOutput.onLine (/Users/bnoordhuis/src/llnode/test/common.js:110:5)
          at SessionOutput.emit (events.js:182:13)
          at Socket.SessionOutput.stream.on (/Users/bnoordhuis/src/llnode/test/common.js:61:14)
          at Socket.emit (events.js:182:13)
          at addChunk (_stream_readable.js:277:12)
  ...
ok 36 null
ok 37 Zlib should be in findjsinstances  
ok 38 null
not ok 39 Should find reference
  ---
    operator: ok
    expected: true
    actual:   false
    at: sess.linesUntil (/Users/bnoordhuis/src/llnode/test/scan-test.js:86:7)
    stack: |-
      Error: Should find reference
          at Test.assert [as _assert] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:225:54)
          at Test.bound [as _assert] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:77:32)
          at Test.ok.Test.true.Test.assert (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:346:10)
          at Test.bound [as ok] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:77:32)
          at sess.linesUntil (/Users/bnoordhuis/src/llnode/test/scan-test.js:86:7)
          at SessionOutput.onLine (/Users/bnoordhuis/src/llnode/test/common.js:110:5)
          at SessionOutput.emit (events.js:182:13)
          at Socket.SessionOutput.stream.on (/Users/bnoordhuis/src/llnode/test/common.js:61:14)
          at Socket.emit (events.js:182:13)
          at addChunk (_stream_readable.js:277:12)
  ...
not ok 40 Should find reference #2
  ---
    operator: ok
    expected: true
    actual:   false
    at: sess.linesUntil (/Users/bnoordhuis/src/llnode/test/scan-test.js:87:7)
    stack: |-
      Error: Should find reference #2
          at Test.assert [as _assert] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:225:54)
          at Test.bound [as _assert] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:77:32)
          at Test.ok.Test.true.Test.assert (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:346:10)
          at Test.bound [as ok] (/Users/bnoordhuis/src/llnode/node_modules/tape/lib/test.js:77:32)
          at sess.linesUntil (/Users/bnoordhuis/src/llnode/test/scan-test.js:87:7)
          at SessionOutput.onLine (/Users/bnoordhuis/src/llnode/test/common.js:110:5)
          at SessionOutput.emit (events.js:182:13)
          at Socket.SessionOutput.stream.on (/Users/bnoordhuis/src/llnode/test/common.js:61:14)
          at Socket.emit (events.js:182:13)
          at addChunk (_stream_readable.js:277:12)
  ...
ok 41 Should find reference #3
# v8 stack
ok 42 null
ok 43 Class method name and args
ok 44 Class method file pos
ok 45 null
ok 46 Third function name and args
ok 47 Third function file pos
ok 48 null
ok 49 Second function name and args
ok 50 Second function file pos
ok 51 null
ok 52 first function name
ok 53 first function file pos
# usage messages
ok 54 undefined
ok 55 null
ok 56 print usage message
ok 57 null
ok 58 list usage message
ok 59 null
ok 60 findjsinstances usage message
ok 61 null
ok 62 findrefs usage message

1..62
# tests 62
# pass  57
# fail  5

@joyeecheung joyeecheung merged commit 6dbd9dd into nodejs:master Apr 22, 2018
mmarchini pushed a commit to mmarchini/llnode that referenced this pull request May 1, 2018
findjsobjects -d test relies on how the hidden-class it tests is built.
Zlib is a builtin from Node.js, therefore we cannot be sure about the
order attributes are assigned to the class, making its hidden-class
unpredictable. Using a class from our fixtures (in this case, Class)
makes the test more predictable across Node.js versions and across
multiple Operating Systems.

Ref: nodejs#186
joyeecheung pushed a commit that referenced this pull request May 2, 2018
findjsobjects -d test relies on how the hidden-class it tests is built.
Zlib is a builtin from Node.js, therefore we cannot be sure about the
order attributes are assigned to the class, making its hidden-class
unpredictable. Using a class from our fixtures (in this case, Class)
makes the test more predictable across Node.js versions and across
multiple Operating Systems.

Ref: #186
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants