maheshtalada / leak-finder-for-javascript

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

doc: command line under macosx #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. start google chrome under macosx with following command line :
google-chrome --remote-debugging-port=9222 --js-flags=--stack_trace_limit=-1
2.
3.

What is the expected output? What do you see instead?
Chrome may runs but... "command not found"

What version of the product are you using? On what operating system?
the last one for macosx Lion

Please provide any additional information below.
the good command
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

Original issue reported on code.google.com by maxproc...@gmail.com on 10 Aug 2012 at 1:36

GoogleCodeExporter commented 8 years ago
I answered too quickly ... 

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome 
--remote-debugging-port=9222 --js-flags=--stack_trace_limit=-1
[11648:-1406500160:138973865099074:ERROR:process_singleton_mac.cc(106)] Unable 
to obtain profile lock.

Original comment by maxproc...@gmail.com on 10 Aug 2012 at 1:42

GoogleCodeExporter commented 8 years ago
When i tried to run the previous command, Chrome was already stated. So the 
response unable to obtain lock seem to be the expected behaviour. But in a 
comment i read that if chrome is already opened, we must use the 
--user-data-dir option ... but i didn't succeed in using it

Original comment by maxproc...@gmail.com on 10 Aug 2012 at 1:48

GoogleCodeExporter commented 8 years ago
Thanks for the report; the documentation didn't take into account the case 
where Chrome is already running. I'll take care of updating the docs (and I'll 
update this bug, too).

Original comment by marja@google.com on 11 Aug 2012 at 11:48

GoogleCodeExporter commented 8 years ago
Does the following command work for you:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome 
--remote-debugging-port=9222 --js-flags=--stack_trace_limit=-1 
--user-data-dir=/tmp/jsleakcheck

Original comment by marja@google.com on 12 Aug 2012 at 3:27

GoogleCodeExporter commented 8 years ago
Hi when i enter your command, i get a chrome window who ask me if i want
Chrome to be my default browser and another tab ask me to open a session so
i guess it's okay but here is the console i get 2 warnings :

--remote-debugging-port=9222 --js-flags=--stack_trace_limit=-1
--user-data-dir=/tmp/jsleakcheck*
Aug 13 09:04:20 iMac-de-Maxime.local Google Chrome Helper[530] <Warning>:
CGSLookupServerRootPort: Failed to look up the port for
"com.apple.windowserver.active" (1100)
[525:-1406500160:753118431229:ERROR:extension_prefs.cc(1274)] Bad or
missing pref 'version' for extension 'blpcfgokakmgnkcojhhkbfbldkacnbeo'
[525:-1406500160:753129704061:ERROR:extension_prefs.cc(1274)] Bad or
missing pref 'version' for extension 'coobgpohoikkiipiblmjeljniedjpjpf'
Aug 13 09:04:20 iMac-de-Maxime.local Google Chrome Helper[531] <Warning>:
CGSLookupServerRootPort: Failed to look up the port for
"com.apple.windowserver.active" (1100)
[525:-1406500160:753460617738:ERROR:extension_prefs.cc(1274)] Bad or
missing pref 'version' for extension 'pjkljhegncpnkpknbcohdijeoejaedia'

Thank's for your help :)

*Maxime Frysou*
06 49 66 70 69
http://www.doyoubuzz.com/*maxime*-*frysou*<http://www.doyoubuzz.com/maxime-fryso
u>
http://www.viadeo.com/fr/profile/*maxime*.*frysou*<http://www.viadeo.com/fr/prof
ile/maxime.frysou>
http://fr.linkedin.com/in/*maximefrysou*<http://fr.linkedin.com/in/maximefrysou>

** <http://www.doyoubuzz.com/maxime-frysou>

Original comment by maxproc...@gmail.com on 13 Aug 2012 at 7:07

GoogleCodeExporter commented 8 years ago
Hi when i enter your command, i get a chrome window who ask me if i want Chrome 
to be my default browser and another tab ask me to open a session so i guess 
it's okay but here is the console i get 2 warnings :

> /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome 
--remote-debugging-port=9222 --js-flags=--stack_trace_limit=-1 
--user-data-dir=/tmp/jsleakcheck
Aug 13 09:04:20 iMac-de-Maxime.local Google Chrome Helper[530] <Warning>: 
CGSLookupServerRootPort: Failed to look up the port for 
"com.apple.windowserver.active" (1100)
[525:-1406500160:753118431229:ERROR:extension_prefs.cc(1274)] Bad or missing 
pref 'version' for extension 'blpcfgokakmgnkcojhhkbfbldkacnbeo'
[525:-1406500160:753129704061:ERROR:extension_prefs.cc(1274)] Bad or missing 
pref 'version' for extension 'coobgpohoikkiipiblmjeljniedjpjpf'
Aug 13 09:04:20 iMac-de-Maxime.local Google Chrome Helper[531] <Warning>: 
CGSLookupServerRootPort: Failed to look up the port for 
"com.apple.windowserver.active" (1100)
[525:-1406500160:753460617738:ERROR:extension_prefs.cc(1274)] Bad or missing 
pref 'version' for extension 'pjkljhegncpnkpknbcohdijeoejaedia'

Thank's for your help :)

Original comment by maxproc...@gmail.com on 13 Aug 2012 at 7:07

GoogleCodeExporter commented 8 years ago
Ok, thanks. It's normal that it asks about the default browser and other "on 
the first run" stuff. Also, I wouldn't worry too much about the console prints 
if everything works.

Original comment by marja@google.com on 13 Aug 2012 at 7:59

GoogleCodeExporter commented 8 years ago
Have a nice day !

Original comment by maxproc...@gmail.com on 13 Aug 2012 at 8:04

GoogleCodeExporter commented 8 years ago
Hi,
I got the same problem with maxproc and then when i try "python jsleakcheck.py 
-d closure-disposable -v" command in "depot_tools/leak-finder/src" i get these 
errors:

python jsleakcheck.py -d closure-disposable -v
INFO:root:Using leak definition closure-disposable
INFO:root:Reading suppressions from "closure-disposable-suppressions.txt"
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 148, in Run
    'message: %s' % e.__str__())
leak_finder.Error: Cannot create RemoteInspectorClient; most probably you have 
DevTools open on the tab we're trying to inspect. Original error message: Error 
accessing Chrome instance debugging port: <urlopen error [Errno 8] nodename nor 
servname provided, or not known>

Please help,
Thanks :)

Original comment by dungltk...@gmail.com on 20 Aug 2012 at 9:17

GoogleCodeExporter commented 8 years ago
That's not the same problem really, can you file a different bug? (This bug was 
about goog.Disposable.instances_ not being found.)

Which command line do you start your chrome with? Do you have DevTools open as 
the error message suggets? :)

Original comment by marja@google.com on 20 Aug 2012 at 9:19

GoogleCodeExporter commented 8 years ago
The same problem i mean when i start chrome by this command:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome 
--remote-debugging-port=9222 --js-flags=--stack_trace_limit=-1 
--user-data-dir=Downloads/tmp/jsleakcheck

then i get the same warning:

Aug 20 15:07:57 Dungs-Mac-mini.local Google Chrome Helper[1374] <Warning>: 
CGSLookupServerRootPort: Failed to look up the port for 
"com.apple.windowserver.active" (1100)
[1370:-1396337984:22241998852330:ERROR:extension_prefs.cc(1274)] Bad or missing 
pref 'version' for extension 'pjkljhegncpnkpknbcohdijeoejaedia'
[1370:-1396337984:22242030029216:ERROR:extension_prefs.cc(1274)] Bad or missing 
pref 'version' for extension 'coobgpohoikkiipiblmjeljniedjpjpf'
[1370:-1396337984:22242148420183:ERROR:extension_prefs.cc(1274)] Bad or missing 
pref 'version' for extension 'blpcfgokakmgnkcojhhkbfbldkacnbeo'
Aug 20 15:07:59 Dungs-Mac-mini.local Google Chrome Helper[1375] <Warning>: 
CGSLookupServerRootPort: Failed to look up the port for 
"com.apple.windowserver.active" (1100)
Aug 20 15:08:25 Dungs-Mac-mini.local Google Chrome Helper[1383] <Warning>: 
CGSLookupServerRootPort: Failed to look up the port for 
"com.apple.windowserver.active" (1100)

After that i try command "python jsleakcheck.py -d closure-disposable -v" and 
it throws error:

leak_finder.Error: Cannot create RemoteInspectorClient; most probably you have 
DevTools open on the tab we're trying to inspect. Original error message: Error 
accessing Chrome instance debugging port: <urlopen error [Errno 8] nodename nor 
servname provided, or not known>

I don't open DevTools, maybe this bug of goog.Disposable is caused by accessing 
Chrome instance debugging port so i think this can be the consequence of look 
up the port for "com.apple.windowserver.active" failure. 

Thanks for your help :)

Original comment by dungltk...@gmail.com on 20 Aug 2012 at 9:39

GoogleCodeExporter commented 8 years ago
(Oops, I was confused about which bug this is, this was not the 
Disposable.instances_ not found bug. Pls ignore that part.)

Which tabs do you have open in the chrome instance?

Are there more chrome instances running? Maybe you could just try closing 
them... although, which user-data-dir it shouldn't matter.

And, you could see if somebody is listening to the port 9222. I don't know how 
you do that on mac.

Original comment by marja@google.com on 20 Aug 2012 at 10:01

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I run my app on the first tab (and i open only one tab. There's no more chrome 
instances running). The port 9222 is listening and free. I also have tried 
closing and reopening Chrome several time but I still get the same error. hix 
hix. I don't what to do next T__T

Thanks for your help :D

Original comment by dungltk...@gmail.com on 20 Aug 2012 at 10:42

GoogleCodeExporter commented 8 years ago
What do you mean by "listening and free" and how did you check that?

Could you try:
sudo lsof -i | grep 9222

Hmm, interesting, the error message is: "urlopen error [Errno 8] nodename nor 
servname provided, or not known"

If I don't have anything listening on 9222 (on linux), the error is:
"urlopen error [Errno 111] Connection refused".

Original comment by marja@google.com on 20 Aug 2012 at 11:39

GoogleCodeExporter commented 8 years ago
Also, could you try opening your-repo-dir/pyautolib/remote_inspector_client.py 
and replacing this line:
f = urllib2.urlopen('http://localhost:9222/json')
with:
f = urllib2.urlopen('http://127.0.0.1:9222/json')

Original comment by marja@google.com on 20 Aug 2012 at 11:48

GoogleCodeExporter commented 8 years ago
I try "netstat -an | grep 9222" to check and the result is:

tcp4       0      0  127.0.0.1.9222         *.*                    LISTEN  

I try "sudo lsof -i | grep 9222" but the console prints nothing :( (I use mac 
os X)

Original comment by dungltk...@gmail.com on 20 Aug 2012 at 11:56

GoogleCodeExporter commented 8 years ago
I replaced the url as your suggestion and it works. 

Thanks for your support,
Have a nice day^^

Original comment by dungltk...@gmail.com on 21 Aug 2012 at 2:33

GoogleCodeExporter commented 8 years ago
I am sorry to annoy you again. I run leak checking command and i get an 
exception: 

Dungs-Mac-mini:src dungltk$ 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
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 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')

INFO:root:No leaks found.

Could you help me figure it out.
Thank you very much :)

Original comment by dungltk...@gmail.com on 21 Aug 2012 at 3:11

GoogleCodeExporter commented 8 years ago
Okay, cool that replacing localhost with 127.0.0.1 works. That plus the error 
message you get suggest that you're having some issues with the DNS.

Then, it also seems the stack traces cannot be retrieved... You could just try 
to retrieve the leaking objects without the stack traces, to get started:

python jsleakcheck.py --containers="goog.Disposable.instances_" 
--bad-nodes="goog.events"

Btw, does the error occur every time you run the program? And every time the 
same way?

Original comment by marja@google.com on 21 Aug 2012 at 12:04

GoogleCodeExporter commented 8 years ago
The error doesn't occur every time in the same way. Sometime the terminal hangs 
forever at Taking heap snapshot step:

Dungs-Mac-mini:src dungltk$ 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

At that time, the terminal tab running Chrome prints out an error:

[3033:-1256083456:978872428323:ERROR:stream_listen_socket.cc(136)] send failed: 
buffer overrun 

Original comment by dungltk...@gmail.com on 22 Aug 2012 at 8:11

GoogleCodeExporter commented 8 years ago
Ok, I might have seen the problem where it just hangs when trying to get a heap 
snapshot. However, I've never been able to reproduce it myself :/

Which version of chrome are you using? Can you try out the most recent chrome 
you can get (canary seems to be version 23, dev version 22)?

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

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Ok, I will try the most update chrome. Btw, currently I use chrome version 
21.0.1180.82

Original comment by dungltk...@gmail.com on 22 Aug 2012 at 11:09

GoogleCodeExporter commented 8 years ago
If anybody is still having problems,could you update your checkout, and run 
jsleakcheck.py with the command line option --remote-inspector-client-debug (in 
addition to the ones your normally use), and attach the log into this bug (or 
send it to me).

Original comment by marja@google.com on 28 Aug 2012 at 8:06

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This steps didn't work for me. I have an other option:
No extentions installed in chrome v.21!

https://groups.google.com/forum/#!topic/jsleakcheck/isfeC3MWKbg

Only open chrome with this:

open -a "Google Chrome" --args -remote-debugging-port=9222 
-js-flags=--stack_trace_limit=-1 -user-data-dir=/tmp/jsleakcheck

activate developer modus (Tools > ... checkbox[true] )

open developer tools with (press Ctrl + Shift + i)

go to the CONSOLE (developer tools) and write:

goog.Disposable.MONITORING_MODE=goog.Disposable.MonitoringMode.INTERACTIVE

close the developer tools (press Ctrl + Shift + i)

open an other tab in the terminal and write:
python jsleakcheck.py -d closure-disposable -v --remote-inspector-client-debug

thats all :) i hope it help

Original comment by Emanuel....@googlemail.com on 4 Sep 2012 at 9:32