Closed sjhcockrell closed 10 years ago
Probably redundant with issue #56. Will close that pull request because it is a silly pull request.
Will add more detailed --verbose crash logs.
https://gist.github.com/sjhcockrell/6471107 https://gist.github.com/sjhcockrell/6471131
CNN Crash Log https://gist.github.com/sjhcockrell/4de01c724a20df7a4949
Washington Post Crash Log https://gist.github.com/sjhcockrell/fbeb779ae36e15ac425e
Potentially related or not, a common message I've seen in verbose logs from time to time is:
ReferenceError: Can't find variable: Kk
:1
A bit odd, since I don't seem to turn up anything inside Phantomas when grepping that has that var name.
Problem seems to happen with spying on sizzle calls when using jQuery 1.7.1.
modules/jQuery.js : 37-41
Interesting thing is that PhantomJS doesn't die on the first call to Sizzle / first DOM query. Does the same happen when you pass --modules=jQuery
as command line option (i.e. only jQuery module is used to gather metrics)?
Seems like I'm getting identical behavior:
$ ./phantomas.js --url={whatever url} --modules=jQuery --verbose
washingtonpost (still fails) https://gist.github.com/sjhcockrell/c7e938d94513cf6999ca
cnn (pass) - using jQuery 1.7.2 now https://gist.github.com/sjhcockrell/f024292567c611bb24d3
meetup (still fails) https://gist.github.com/sjhcockrell/0fcea0e5453bf24d255c
Thanks to #66 we can now disable given module(s), so now let's try the following:
$ ./phantomas.js --url={whatever url} --skip-modules=jQuery --verbose
Thanks @sjhcockrell for debugging this issue!
Diff between jQuery v1.7.1 and 1.7.2 is quite big - https://github.com/jquery/jquery/compare/1.7.1...1.7.2
Getting mixed results with the --skip-modules=jQuery
flag running.
As an example:
washingtonpost.com (Success) https://gist.github.com/sjhcockrell/96b787ede819c7cf950b
washingtonpost.com (Failure) https://gist.github.com/sjhcockrell/a5c4519b5e69c13c2697
meetup.com (Success) https://gist.github.com/sjhcockrell/d800d3e0714feef07658
meetup.com (Failure) https://gist.github.com/sjhcockrell/b120dab95111ca730706
New hypotheses could be:
a) timeout/race condition issues b) non jQuery-related issues (jQuery version being a red herring)
Observation 1:
Another observation is that there was a similar pattern when loading washingtonpost.com, meetup.com, and (not included in gists) nytimes.com:
Run 1: Fail Run 2: Success Run 3: Fail Run 4: Fail
Probably unrelated, but slightly strange.
Observation 2:
washingtonpost.com and nytimes.com both commonly cause phantomjs to abort around <script>
insertions to either <body>
or <head>
.
Observation 3:
meetup.com seems to commonly abort around event binding:
23:25:19.199 DOM event: "error" bound to "img"
23:25:19.199 DOM event: "load" bound to "img"
Seems like these could maybe be two separate kinds of errors?
ebay.com seems to exhibit the same F S F F execution pattern as above. It uses jQuery 1.7.
When failing, it typically fails on DOM insertion.
$ ./phantomas.js --url=http://www.ebay.com --skip-modules=jQuery --verbose --timeout=30
PhantomJS cut a new release (1.9.2) a little while ago.
Upgrading, at least on an OS X environment, did not seem to fix the issue.
This set of flags seems to avoid PhantomJS crashes on washingtonpost.com and meetup.com:
# Success on Meetup and Washington Post
./phantomas.js --url={ whatever } --skip-modules=jQuery,domQueries,eventListeners,javaScriptBottlenecks --verbose --timeout=100
Omitting javaScriptBottlenecks on washingtonpost.com calls seems to consistently generate crashes.
# Fail on Washington Post, Success on Meetup
./phantomas.js --url={ whatever } --skip-modules=jQuery,domQueries,eventListeners --verbose --timeout=100
jQuery,domQueries,eventListeners,javaScriptBottlenecks
- these are the only modules using phantomas.spy
Running phantomas 20 times against --url=http://meetup.com
was successful with spy feature disabled. Back to drawing board ;)
20:51:47.767 DOM insert: node "#text" added to "#document-fragment"
20:51:47.767 DOM insert: node "#document-fragment > #text" added to "body > div.middle > div#main > div#content > div#stage > div#dailyDeal > div.deals > div.ddcrd > div.blast > div.time"
TypeError: 'undefined' is not a function (evaluating 'fn.apply(scope, arguments)')
/home/macbre/github/phantomas/core/phantomas.js:169
20:51:48.720 DOM query: by id "#MFBB_DD_760_m_400673"
when running for ebay.com...
I've submitted stack trace to PhantomJS issue tracker.
I have a new suspect, officer :)
window.callPhantom
is used to send metrics from browser scope to phantomas. API docs says that its stability is expiremental.
$ ./run-multiple.js --url=http://www.ebay.com --verbose --timeout 30 --runs 25
with window.callPhantom
commented out went smooth as never. JSON encoded string will need to be sent via console.log
and parsed on PhantomJS side.
Wow, great digging to find that one!
I'll do a bit of stress testing when I get home tonight. Thanks for fixing!
This is looking pretty healthy--haven't noticed any issues where I was seeing them before.
Jolly good! Thanks for checking and debugging this issue :+1:
Mac OS X Phantomas 0.6.1 PhantomJS 1.9.1 Node 0.8.18
I've seen crashes when providing the following URLs:
http://www.meetup.com http://www.washingtonpost.com http://www.cnn.com
So far the only commonality I've seen is that they're all using jQuery 1.7.1. The above URLs simply cause PhantomJS to fail.
The New York Times, which also uses jQuery 1.7.1, will display a series of errors, then either fail or complete. Maybe a race condition?