Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

node0.8.0 amd64 #16

Closed
madisparn opened this Issue · 32 comments
@madisparn

when calling profiler.takeSnapshot I get an error
node: symbol lookup error: xxx/node_modules/v8-profiler/build/Release/profiler.node: undefined symbol: _ZNK2v813HeapGraphNode17GetRetainersCountEv

tried both master and 3.6.2 branches

@noonat

Also seeing this on v0.8.1.

@carter-thaxton

Just in case this helps, here's a full repro and stacktrace from v0.8.1 on Mac OS X 10.6.8.
Encountered this while watching your talk at nodeconf and trying to follow along :)

$ npm install v8-profiler
npm http GET https://registry.npmjs.org/v8-profiler
npm http 200 https://registry.npmjs.org/v8-profiler
npm http GET https://registry.npmjs.org/v8-profiler/-/v8-profiler-3.6.2-1.tgz
npm http 200 https://registry.npmjs.org/v8-profiler/-/v8-profiler-3.6.2-1.tgz

v8-profiler@3.6.2-1 install /Users/cthaxton/prj/nodejs/play/node_modules/v8-profiler
node-gyp rebuild

gyp http GET http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz
CXX(target) Release/obj.target/profiler/cpu_profiler.o
CXX(target) Release/obj.target/profiler/graph_edge.o
In file included from ../graph_edge.cc:1:
../graph_edge.h:26:28: warning: no newline at end of file
CXX(target) Release/obj.target/profiler/graph_node.o
In file included from ../graph_node.cc:2:
../graph_edge.h:26:28: warning: no newline at end of file
CXX(target) Release/obj.target/profiler/heap_profiler.o
CXX(target) Release/obj.target/profiler/profile.o
In file included from ../profile.cc:2:
../profile_node.h:32:30: warning: no newline at end of file
CXX(target) Release/obj.target/profiler/profile_node.o
In file included from ../profile_node.cc:1:
../profile_node.h:32:30: warning: no newline at end of file
../profile_node.cc:126:2: warning: no newline at end of file
CXX(target) Release/obj.target/profiler/profiler.o
CXX(target) Release/obj.target/profiler/snapshot.o
SOLINK_MODULE(target) Release/profiler.node
SOLINK_MODULE(target) Release/profiler.node: Finished
v8-profiler@3.6.2-1 node_modules/v8-profiler

$ node

p = require('v8-profiler')
{ takeSnapshot: [Function],
getSnapshot: [Function],
findSnapshot: [Function],
snapshotCount: [Function],
deleteAllSnapshots: [Function],
startProfiling: [Function],
stopProfiling: [Function],
getProfile: [Function],
findProfile: [Function],
profileCount: [Function],
deleteAllProfiles: [Function] }
s = p.takeSnapshot()

dyld: lazy symbol binding failed: Symbol not found: __ZNK2v813HeapGraphNode17GetRetainersCountEv
Referenced from: /Users/cthaxton/prj/nodejs/play/node_modules/v8-profiler/build/Release/profiler.node
Expected in: flat namespace

dyld: Symbol not found: __ZNK2v813HeapGraphNode17GetRetainersCountEv
Referenced from: /Users/cthaxton/prj/nodejs/play/node_modules/v8-profiler/build/Release/profiler.node
Expected in: flat namespace

Trace/BPT trap

@touv

exactly the same on ubuntu 12.04 & node 0.8.1

@lancejpollard

Also seeing this on Macbook Pro, 10.6.8, node 0.8.2, npm 1.1.32

$ npm install v8-profiler
npm http GET https://registry.npmjs.org/v8-profiler
npm http 200 https://registry.npmjs.org/v8-profiler
npm http GET https://registry.npmjs.org/v8-profiler/-/v8-profiler-3.6.2-1.tgz

> v8-profiler@3.6.2-1 install /Users/viatropos/Documents/git/profile-test/node_modules/v8-profiler
> node-gyp rebuild

  CXX(target) Release/obj.target/profiler/cpu_profiler.o
  CXX(target) Release/obj.target/profiler/graph_edge.o
In file included from ../graph_edge.cc:1:
../graph_edge.h:26:28: warning: no newline at end of file
  CXX(target) Release/obj.target/profiler/graph_node.o
In file included from ../graph_node.cc:2:
../graph_edge.h:26:28: warning: no newline at end of file
  CXX(target) Release/obj.target/profiler/heap_profiler.o
  CXX(target) Release/obj.target/profiler/profile.o
In file included from ../profile.cc:2:
../profile_node.h:32:30: warning: no newline at end of file
  CXX(target) Release/obj.target/profiler/profile_node.o
In file included from ../profile_node.cc:1:
../profile_node.h:32:30: warning: no newline at end of file
../profile_node.cc:126:2: warning: no newline at end of file
  CXX(target) Release/obj.target/profiler/profiler.o
  CXX(target) Release/obj.target/profiler/snapshot.o
  SOLINK_MODULE(target) Release/profiler.node
  SOLINK_MODULE(target) Release/profiler.node: Finished
v8-profiler@3.6.2-1 node_modules/v8-profiler
$ dyld: lazy symbol binding failed: Symbol not found
$ node tmp/leaks.js
Leaks: 100
dyld: lazy symbol binding failed: Symbol not found: __ZNK2v813HeapGraphNode16GetDominatorNodeEv
  Referenced from: /Users/viatropos/Documents/git/profile-test/node_modules/v8-profiler/build/Release/profiler.node
  Expected in: dynamic lookup

dyld: Symbol not found: __ZNK2v813HeapGraphNode16GetDominatorNodeEv
  Referenced from: /Users/viatropos/Documents/git/profile-test/node_modules/v8-profiler/build/Release/profiler.node
  Expected in: dynamic lookup

Trace/BPT trap
// tmp/leaks.js
var profiler = require('v8-profiler');

function LeakingClass() {}

var leaks = [];
setInterval(function() {
  for (var i = 0; i < 100; i++) {
    leaks.push(new LeakingClass);
  }

  console.error('Leaks: %d', leaks.length);
  console.log(profiler.takeSnapshot('first snapshot'))
  //console.log(process.memoryUsage())
}, 1000);
@bsnote

Also seeing this on v0.8.3

@runningskull

I get this on OSX 10.7.3, but not just for Node 0.8.* -- I also get it w/ 0.7.12 and 0.6.20, though the exact undefined symbols is different for each.

@NARKOZ

Fedora 16 x86_64, node v0.6.18

@remy

Still an outstanding issue :(

I tried forking the code, checked out the 3.6.2 branch, but have no idea what I'm doing. This module is super valuable for debugging memory leaks, so I'd love to see it updated soon! Thanks.

@runningskull

@dannycoates Any hunch about where to start hunting down the problem? Is there more information that would be helpful?

@image72

build v8-profiler 3.6.2-1 with nodejs v0.8 in x86/win7 used vc10

>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetExt(.dll) 
does not match the Linker's OutputFile property value (.node). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>     Creating library F:\dannycoates-v8-profiler-dfb6d7f\build\Release\profiler.lib and object F:\dannycoates-v8-profiler-dfb6d7f\build\Release\profiler.exp
1>graph_node.obj : error LNK2001: unresolved external symbol "public: class v8::HeapGraphNode const * __thiscall v8::HeapGraphNode::GetDominatorNode(void)const " (?GetDominatorNode@HeapGraphNode@v8@@QBEPBV12@XZ)
1>graph_node.obj : error LNK2001: unresolved external symbol "public: class v8::HeapGraphEdge const * __thiscall v8::HeapGraphNode::GetRetainer(int)const " (?GetRetainer@HeapGraphNode@v8@@QBEPBVHeapGraphEdge@2@H@Z)
1>graph_node.obj : error LNK2001: unresolved external symbol "public: int __thiscall v8::HeapGraphNode::GetRetainersCount(void)const " (?GetRetainersCount@HeapGraphNode@v8@@QBEHXZ)
1>graph_node.obj : error LNK2001: unresolved external symbol "public: int __thiscall v8::HeapGraphNode::GetRetainedSize(void)const " (?GetRetainedSize@HeapGraphNode@v8@@QBEHXZ)
1>F:\dannycoates-v8-profiler-dfb6d7f\build\Release\profiler.node : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
@zzo

+1

@gendalf

+10000

@alexbirkett

Has anybody got a workaround for this? I can reproduce the problem with Node v0.8.8.

@pdiemert

+1

@leebyron

Subscribe. Running into this problem as well. Is this a v8 problem or a node problem?

@NARKOZ

Installing node from source solved this problem for me.
Previously it was installed using system package manager.

@hbrls

+1 on Windows 2008, node 0.8.9, vs2010 express

@emente

node: symbol lookup error: /var/www/kingdoms/node_modules/v8-profiler/build/Release/profiler.node: undefined symbol: _ZNK2v813HeapGraphNode17GetRetainersCountEv

node 0.8.9 / profiler 3.6.2-1 / Linux Ubuntu-1004-lucid-64-minimal 2.6.32-38-server #83-Ubuntu

@matsukaz

It was V8 problem.
v8-profiler uses some V8 API's, but those API's are eliminated from V8 in version 3.11.5.

commited codes.
v8/v8@d6c6cda

node.js upgraded v8 version from 3.9.24.31 to 3.11.10 in version 0.7.11, so all version later than 0.7.11 doesn't work.

see the changes in deps/v8/src/api.cc
joyent/node@50464cd

In order to use v8-profiler, simplest way is to remove the following methods and SetAccessor call inside constructor from graph_node.cc and rebuild v8-profiler.

  • GraphNode::GetRetainersCount
  • GraphNode::GetRetainedSize
  • GraphNode::GetRetainer
  • GraphNode::GetDominator

But of course, if you do this, you can't see anymore dominator and retainer informations.

@ttezel

+1

@samitny

+100000 :)

@changeYi

+1 on 0.8.4

@image72 image72 referenced this issue
Closed

graph_node error #19

@enw

I see the same with node v0.8.12, v8-profiler@3.6.2-1 when I profile in node-inspector on OS10.7.4 -

dyld: lazy symbol binding failed: Symbol not found: __ZNK2v813HeapGraphNode17GetRetainersCountEv
Referenced from: /Users/elliot.winard/Documents/_PROJECTS/comcast/CODE/frog_git/nodejs/node_modules/v8-profiler/build/Release/profiler.node
Expected in: dynamic lookup

dyld: Symbol not found: __ZNK2v813HeapGraphNode17GetRetainersCountEv
Referenced from: /Users/elliot.winard/Documents/_PROJECTS/comcast/CODE/frog_git/nodejs/node_modules/v8-profiler/build/Release/profiler.node
Expected in: dynamic lookup

@gifff gifff referenced this issue in NetEase/pomelo
Closed

Two problems in 'npm install pomelo -g' #80

@bitmage

I was digging around for where this code actually exists now, and I found it within the inspector in WebKit.

https://trac.webkit.org/browser/trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js#L1342

The problem with moving the functionality from V8 to WebKit is that it's no longer in a reusable module, so everyone is going to end up maintaining different implementations of the retainer/dominator algorithms.

I think it would be good if we had a low level Node library that taps into the V8 profiler code and just returns JSON data structures. That could then be a base for whatever other libraries we need, and the heapdiff, dominator, and retainer code can reside in one place. A separate library could adapt that into a format legible for the graphical profiling tools.

Node-memwatch is a more recent project in this vein, and it seems to have Mozilla's support. Is it a better candidate for the base?

https://github.com/lloyd/node-memwatch
https://hacks.mozilla.org/2012/11/tracking-down-memory-leaks-in-node-js-a-node-js-holiday-season/

@lymanlai

+1 on ubuntu 12.04.2 LTS

@3y3
Owner
3y3 commented

Node Inspector community starts resurrection of project. Please, confirm your issue on last version.

@3y3 3y3 closed this
@SkeLLLa

Same error on latest node-inspector and v8-profiler with node v0.11.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.