Export to GitHub

leak-finder-for-javascript - issue #5

Container not found: goog.Disposable.instances_


Posted on Aug 14, 2012 by Happy Camel

What steps will reproduce the problem? 1. include the script in the index file like this : <body> <script type="text/javascript"> goog.Disposable.prototype.dispose = function() { if (!this.disposed_) { this.disposed_ = true; this.disposeInternal(); if (goog.Disposable.ENABLE_MONITORING) { var uid = goog.getUid(this); delete goog.Disposable.instances_[uid]; } } }; goog.Disposable.ENABLE_MONITORING=true; </script> ... 2. Launch Chrome in remote debug mode /Applications/Google\ rome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --js-flags=--stack_trace_limit=-1 --user-data-dir=/tmp/jsleakcheck 3. goTo the webApp URL in the first tab of Chrome 4. python jsleakcheck.py -d closure-disposable -v

What is the expected output? What do you see instead? leak finder may runs

What version of the product are you using? On what operating system? A fresh version of closure (downloaded near the 2012/08/09) Leak Finder downloaded near the 2012/08/09 too Mac OSX Lion

Please provide any additional information below. python jsleakcheck.py -d closure-disposable -v INFO:root:Using leak definition closure-disposable INFO:root:Reading suppressions from "closure-disposable-suppressions.txt" INFO:root:Taking heap snapshot INFO:root:Analyzing heap snapshot ERROR:root:Error analyzing snapshot: Container not found: goog.Disposable.instances_ Exception in thread Thread-2: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner self.run() File "../../pyautolib/remote_inspector_client.py", line 571, in run asyncore.loop(timeout=1, count=1, use_poll=True) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 214, in loop poll_fun(timeout, map) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 140, in poll r, w, e = select.select(r, w, e, timeout) error: (9, 'Bad file descriptor')

Traceback (most recent call last): File "jsleakcheck.py", line 336, in <module> sys.exit(main()) File "jsleakcheck.py", line 332, in main return leak_checker.Run() File "jsleakcheck.py", line 151, in Run leaks = self._FindLeaks(client) File "jsleakcheck.py", line 189, in _FindLeaks self.leak_definition.stacktrace_suffix).FindLeaks(nodes)) File "/Users/maxime/chromium/local-repository/leak-finder/src/leak_finder.py", line 571, in FindLeaks raise Error('Container not found: %s' % edge_description) leak_finder.Error: Container not found: goog.Disposable.instances_

Thanks

Comment #1

Posted on Aug 14, 2012 by Massive Giraffe

How do you include Closure to your web app?

Can you also try out with developer tools, if you just type in goog.Disposable.instances_, is it found?

Comment #2

Posted on Aug 14, 2012 by Massive Giraffe

Oh, and you can also try out with leak-finder/doc/test-page.html, I just added it to the repo.

Comment #3

Posted on Aug 14, 2012 by Happy Camel

Hum ... oups .. i've just downloaded closure from the repos as i thought it was used by leak-finder but my app don't use closure for the moment :( sorry

Comment #4

Posted on Aug 14, 2012 by Massive Giraffe

The leak definition closure-disposable can only be used with web apps which use Closure.

Comment #5

Posted on Aug 24, 2012 by Grumpy Rabbit

Comment deleted

Comment #6

Posted on Aug 24, 2012 by Grumpy Rabbit

I have tried out with leak-finder/doc/test-page.html and got the right result. But the python's " Bad file descriptor" still exists as below:

NFO:root:Using leak definition closure-disposable INFO:root:Reading suppressions from "closure-disposable-suppressions.txt" INFO:root:Taking heap snapshot INFO:root:Analyzing heap snapshot INFO:root:Retrieving creating stack traces for leaking objects Exception in thread Thread-2: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 552, in __bootstrap_inner self.run() File "../../pyautolib/remote_inspector_client.py", line 582, in run asyncore.loop(timeout=1, count=1, use_poll=True) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 218, in loop poll_fun(timeout, map) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 144, in poll r, w, e = select.select(r, w, e, timeout) error: (9, 'Bad file descriptor')

INFO:root:Scanning for new leaks. New memory leaks found: Leak: 1 MyObj allocated at: goog.Disposable Object.goog.base new MyObj MyObjCreator.Create http://tmp.com/leak-finder/doc/test-page.html:23:23


As you see, my python version is 2.7 and my OS is OSX 10.8 Could you tell me whether your leak-finder works fine or not ?

Comment #7

Posted on Aug 24, 2012 by Massive Giraffe

Issue 6 is about the bad file descriptor error, please comment there. It also contains some instructions on how to debug this, could you run the program with the debug informatino on and send me the logs?

And no, jsleakcheck (or some other component) is not working like it should; we should not print out the "bad file descriptor" message. :)

Status: Invalid

Labels:
Type-Defect Priority-Medium