node0.8.0 amd64 #16

Closed
madisparn opened this Issue Jun 28, 2012 · 32 comments

Projects

None yet
@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
noonat commented Jul 3, 2012

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
touv commented Jul 6, 2012

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
bsnote commented Jul 26, 2012

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
NARKOZ commented Aug 1, 2012

Fedora 16 x86_64, node v0.6.18

@remy
remy commented Aug 2, 2012

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
image72 commented Aug 12, 2012

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 ==========
@timoxley

+1

@zzo
zzo commented Aug 22, 2012

+1

@gendalf
gendalf commented Aug 23, 2012

+10000

@herrfricke

+1

@alexbirkett

+1

@alexbirkett

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

@pdiemert
pdiemert commented Sep 8, 2012

+1

@leebyron

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

@NARKOZ
NARKOZ commented Sep 10, 2012

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

@hbrls
hbrls commented Sep 14, 2012

+1 on Windows 2008, node 0.8.9, vs2010 express

@emente
emente commented Sep 19, 2012

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
matsukaz commented Oct 3, 2012

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
nodejs/node-v0.x-archive@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
ttezel commented Oct 4, 2012

+1

@samitny
samitny commented Oct 18, 2012

+100000 :)

@changeYi

+1 on 0.8.4

@NachoSoto

+1

@image72 image72 referenced this issue Nov 15, 2012
Closed

graph_node error #19

@enw
enw commented Dec 19, 2012

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

@pawsong pawsong referenced this issue in NetEase/pomelo Jan 17, 2013
Closed

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

@doubaokun

+1

@bitmage
bitmage commented Feb 4, 2013

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
Member
3y3 commented Apr 3, 2014

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

@3y3 3y3 closed this Apr 3, 2014
@SkeLLLa
SkeLLLa commented Mar 18, 2015

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