rlog / leak-finder-for-javascript

Automatically exported from code.google.com/p/leak-finder-for-javascript
Other
0 stars 0 forks source link

Container not found: goog.Disposable.instances_ #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by maxproc...@gmail.com on 14 Aug 2012 at 8:04

GoogleCodeExporter commented 9 years ago
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?

Original comment by marja@google.com on 14 Aug 2012 at 8:19

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

Original comment by marja@google.com on 14 Aug 2012 at 8:20

GoogleCodeExporter commented 9 years ago
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

Original comment by maxproc...@gmail.com on 14 Aug 2012 at 10:19

GoogleCodeExporter commented 9 years ago
The leak definition closure-disposable can only be used with web apps which use 
Closure.

Original comment by marja@google.com on 14 Aug 2012 at 10:22

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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 ?

Original comment by shouqian...@gmail.com on 24 Aug 2012 at 3:41

GoogleCodeExporter commented 9 years ago
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. :)

Original comment by marja@google.com on 24 Aug 2012 at 7:29