
leak-finder-for-javascript - issue #8
Container not found: goog.Disposable.instances_
What steps will reproduce the problem? C:\Projects\retail\depot_tools\file\leak-finder\src>python jsleakcheck.py -d closure-disposable -v
Output:
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: <class 'leak_finder.Error'> Traceback (most recent call last): File "jsleakcheck.py", line 345, in <module> sys.exit(main()) File "jsleakcheck.py", line 340, in main result = leak_checker.Run(inspector_client) 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 "C:\Projects\retail\depot_tools\file\leak-finder\src\leak_finder.py", lin e 571, in FindLeaks raise Error('Container not found: %s' % edge_description) leak_finder.Error: Container not found: goog.Disposable.instances_
What is the expected output? What do you see instead? leak if any should be detected
What version of the product are you using? On what operating system? I m using Python 25 on Windows 7
I m not getting how do i deal with this error.Tried out things but it dint work. Please help
Comment #1
Posted on Sep 3, 2012 by Massive GiraffeDid you try out with the test page ($repo/leak-finder/doc/test-page.html)?
Does your page use Closure?
Comment #2
Posted on Sep 3, 2012 by Massive Rhinoyes i my page do use closure. I tried out the test-page but instead of giving me a leak it says
C:\Projects\retail\depot_tools\file\leak-finder\src>python jsleakcheck.py -d clo sure-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 INFO:root:Retrieving creating stack traces for leaking objects INFO:root:No leaks found.
I m not gettign what is wrong.It should at least give me a proper output for the test page.please help :)
Comment #3
Posted on Sep 3, 2012 by Massive GiraffeWhich Chrome version are you using?
Comment #4
Posted on Sep 3, 2012 by Massive RhinoChrome version : 21.0.1180.89 m I m using python 2.5. Can this be a reason for such an error??
Comment #5
Posted on Sep 3, 2012 by Massive GiraffeThat shouldn't be the reason. Are you sure you have the web page open in the first tab, and no Developer Tools open?
Comment #6
Posted on Sep 3, 2012 by Massive RhinoComment deleted
Comment #7
Posted on Sep 3, 2012 by Massive RhinoFor my application i m using 127.0.0.1 as localhost and 8500 as my port. If i open a single tab with my application open then the execution of file hangs up at
INFO:root:Taking heap snapshot
and then if i open another tab wit localhost:9222 then it runs but gives me the main error
Container not found: goog.Disposable.instances_
Comment #8
Posted on Sep 3, 2012 by Massive Giraffejsleakcheck will always inspect the first tab (and having developer tools open on that tab) confuses it. If the first tab is not the page you want to inspect, then jsleakcheck will very likely print out the "Container not found" warning.
Anyway, the real problem seems to be that when you open the test page on the first tab, and run jsleakcheck, the execution hangs. Can you rerun with --remote-inspector-client-debug and attach the logs here?
Comment #9
Posted on Sep 3, 2012 by Massive RhinoSorry but how do i run with remote-inspector-client-debug. i just have a remote-inspector-client file.Am i missing some files in my repo.
Comment #10
Posted on Sep 3, 2012 by Massive GiraffeYou add it to the command line. Like this:
python jsleakcheck.py -d closure-disposable -v --remote-inspector-client-debug
Comment #11
Posted on Sep 3, 2012 by Massive RhinoNow for my application if i use this command it gives me
INFO:root:Using leak definition closure-disposable Traceback (most recent call last): File "jsleakcheck.py", line 345, in sys.exit(main()) File "jsleakcheck.py", line 337, in main show_socket_messages=options.remote_inspector_client_debug) File "C:/Projects/retail/depot_tools/file/pyautolib/remote_inspector_client.py ", line 752, in init tab_index, verbose, show_socket_messages) File "C:/Projects/retail/depot_tools/file/pyautolib/remote_inspector_client.py ", line 307, in init result = self._IdentifyDevToolsSocketConnectionInfo(tab_index) File "C:/Projects/retail/depot_tools/file/pyautolib/remote_inspector_client.py ", line 546, in _IdentifyDevToolsSocketConnectionInfo 'Error accessing Chrome instance debugging port: ' + str(e)) RuntimeError: Error accessing Chrome instance debugging port:
Just as a reminder:I m using 8500 as a port to run my application but set chrome debugging port as 9222.Is it creating prob.
Comment #12
Posted on Sep 3, 2012 by Massive GiraffeThe port where you run your web server shouldn't affect this. Chrome will happily retrieve your web page from where ever you point it to, and once it has retrieved it, it can be snapshotted via the remote inspector protocol.
Can you first try out with the test page to get that working, and then try out with your application?
It seems like chrome can't listen to the port 9222 or the jsleakcheck is not allowed to connect to it. I don't know how to debug this on Windows, maybe check your system / firewall settings about which apps are allowed to own which ports and connect to which ports.
Comment #13
Posted on Sep 5, 2012 by Massive Rhinohey so finally now test-page as well as some other pages run properly.
But one more thing now is that my home page contains 60 MB of .js files loading at once. So if i check for these, does it actually takes long time to take snapshot or is there some error that makes it to go into a hang state. Bcoz when i run the leakcheck for my application it is taking ample of time so i don't really know is it hanging up or doing it's work correctly.
Thanks for your previous help :):)
Comment #14
Posted on Sep 5, 2012 by Massive GiraffeCan you run jsleakcheck with --remote-inspector-client-debug and paste the logs into this bug? Thanks.
Comment #15
Posted on Sep 5, 2012 by Massive RhinoIt is giving some strange output of long digits and then hangs up ending with no message.
Comment #16
Posted on Sep 5, 2012 by Massive GiraffeYes, can you please direct that output into this file and attach the file on the this bug ("Attach a file" below).
Comment #17
Posted on Sep 5, 2012 by Massive RhinoCommand promt doesn't show me the entire output but here is what i can see:
- log.txt 23.82KB
Comment #18
Posted on Sep 5, 2012 by Massive GiraffeOk, thanks, can you direct the log into a file:
python jsleakcheck.py -d closure-disposable -v --remote-inspector-client-debug 2>&1 > logfile.txt
and attach that?
It seems though that the heap snapshot is received but jsleakcheck fails to notice it's received. (I've seen this before; there might be some quirk in the remote inspecting protocol.)
Comment #19
Posted on Sep 5, 2012 by Massive RhinoIt hangs up at this point:
C:\Projects\retail\depot_tools\file\leak-finder\src>python jsleakcheck.py -d clo sure-disposable -v --remote-inspector-client-debug 2>&1 > logfile.txt INFO:root:Using leak definition closure-disposable INFO:root:Reading suppressions from "closure-disposable-suppressions.txt" INFO:root:Taking heap snapshot
Comment #20
Posted on Sep 5, 2012 by Massive GiraffeOops, not "2>&1 > logfile.txt" but "> logfile.txt 2>&1".
So: python jsleakcheck.py -d closure-disposable -v --remote-inspector-client-debug > logfile.txt 2>&1
Comment #21
Posted on Sep 5, 2012 by Massive RhinoNoops, even this command doesn't work. Hangs up after the command :(
Comment #22
Posted on Sep 5, 2012 by Massive GiraffeYes, but it should produce some logs though?
Comment #23
Posted on Sep 5, 2012 by Massive RhinoNo, it doesn't show any log neither it generates a logfile.txt
What it does is just stops after command.
Comment #24
Posted on Sep 6, 2012 by Massive RhinoHow does leak-finder works?
I mean does it check only the tab page which is opened in the browser or it also checks for leak in all .js files which are just imported by the page?
For me it seems like it just check the tab page.
Comment #25
Posted on Sep 6, 2012 by Massive GiraffeIt doesn't do any analysis of the code, it just checks which JS objects are alive at the point when it's run, and computes if they are leaks or not.
That is, in the closure-disposable configuration, it checks which Disposable objects have been created but not yet dispose()d, and detects if they are leaks or not. So, this is run-time analysis.
So, it doesn't check leaks "on the page" or "on the js files"; it analyses objects which are alive at the moment, and it doesn't depend on whether the "page" or an imported .js created them.
Comment #26
Posted on Dec 3, 2012 by Swift BirdShit , could any body tell me where is the result ? I just run it with test-page.html, then , what will happen ? There is nothing in the document , holly shit , it takes me half day to analyze it , but finally I don't know which is the result!!! Is this the shit which google release , I can't belive it.
Comment #27
Posted on Dec 3, 2012 by Massive GiraffeThe result for the test page is that the tool prints out information about a leak on the test page (a stack trace etc.)
Comment #28
Posted on Jun 3, 2013 by Happy GiraffeI'm still running into a similar issue on windows. Python 2.7.3, Chrome 27.0.145.94 m.
$ python jsleakcheck.py -d closure-disposable -v --remote-inspector-client-debug INFO:root:Using leak definition closure-disposable Traceback (most recent call last): File "jsleakcheck.py", line 367, in sys.exit(main()) File "jsleakcheck.py", line 357, in main show_socket_messages=options.remote_inspector_client_debug) File "../../pyautolib/remote_inspector_client.py", line 861, in init self._version = self._GetVersion(url) File "../../pyautolib/remote_inspector_client.py", line 1323, in _GetVersion 'Error accessing Chrome instance debugging port: ' + str(e)) RuntimeError: Error accessing Chrome instance debugging port: HTTP Error 503: Service Temporarily Unavailable
Any ideas would be appreciated.
Comment #29
Posted on Jun 3, 2013 by Massive BirdIt seems that jsleakcheck cannot connect to Chrome. You should try closing all Chrome processes (with the task manager, if nothing else helps) and restarting with --remote-debugging-port=9222
Comment #30
Posted on Nov 18, 2013 by Helpful ElephantI have the same issue as #28, using windows 7 with Chrome developer version 33.0.1712.0:
Started Chrome with --remote-debugging-port=9222 --js-flags=--stack_trace_limit=-1 --user-data-dir=F://tmp
INFO:root:Using leak definition closure-disposable Traceback (most recent call last): File "jsleakcheck.py", line 367, in sys.exit(main()) File "jsleakcheck.py", line 357, in main show_socket_messages=options.remote_inspector_client_debug) File "../../pyautolib/remote_inspector_client.py", line 780, in init self._version = self._GetVersion(url) File "../../pyautolib/remote_inspector_client.py", line 1129, in _GetVersion 'Error accessing Chrome instance debugging port: ' + str(e)) RuntimeError: Error accessing Chrome instance debugging port: HTTP Error 503: Service Unavailable
There are no other instances of Chrome; only test-page.html open in 1st tab. If I open 2nd tab with http://localhost:9222/json/version, the Chrome version is displayed:
{ "Browser": "Chrome/33.0.1712.0", "Protocol-Version": "1.0", "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1712.0 Safari/537.36", "WebKit-Version": "537.36 (@162160)" }
If I just enter localhost:9222, I see test-page.html as an inspectable page.
Should I give up on the Window environment for leak-finder and switch to Linux, or has anyone resolved this issue with Windows?
- logfile.txt 631
Comment #31
Posted on Nov 19, 2013 by Massive Giraffeyurys@, pls see comment 30; do you have an idea why we'd get "Error accessing Chrome instance debugging port: HTTP Error 503: Service Unavailable" on Windows, and how to debug this further?
Comment #32
Posted on Nov 19, 2013 by Swift ElephantPavel, do you have any clue on why we may get "HTTP Error 503" when trying to connect to a tab over remote debugging protocol?
On Tue, Nov 19, 2013 at 5:12 AM, wrote:
Comment #33
Posted on Nov 19, 2013 by Swift RabbitDevTools HTTP handler never returns 503 (SERVICE_UNAVAILABLE), jsleakcheck.py must be talking to a different host/port.
Comment #34
Posted on Nov 19, 2013 by Helpful ElephantI have tried changing the code in remote_inspector_client.py as follows to make sure the host/port are correct and it makes no difference:
Raises:
RuntimeError: When Browser version info can't be fetched or parsed.
"""
try:
f = urllib2.urlopen('http://127.0.0.1:9222/json/version')
result = f.read();
result = simplejson.loads(result)
except urllib2.URLError, e:
raise RuntimeError(
'Error accessing Chrome instance debugging port: ' + str(e))
Comment #35
Posted on Nov 19, 2013 by Helpful ElephantAnd now I changed remote_inspector_client.py back, but am dumping out 'endpoint' which is the url that is being opened. You can see in the output that it is correctly set to localhost:9222:
File "../../pyautolib/remote_inspector_client.py", line 1129, in _GetVersion 'Error accessing Chrome instance debugging port: ' + str(e) + ' ' + str(endpoint)) RuntimeError: Error accessing Chrome instance debugging port: HTTP Error 503: Service Unavailable http://localhost:9222
Status: New
Labels:
Type-Defect
Priority-Medium