Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Linux x86_64 crash with protractor #11901

Closed
smhc opened this issue Jan 17, 2014 · 4 comments
Closed

Linux x86_64 crash with protractor #11901

smhc opened this issue Jan 17, 2014 · 4 comments

Comments

@smhc
Copy link

smhc commented Jan 17, 2014

On Linux x86_64 (2.6.32-300.3.1.el6uek.x86_64 #1 SMP), using the following html application:

<!doctype html>
<html>
    <head>
        <title>My simple App</title>
        <script src='angular.js'></script>
        <script>
        <!--
            angular.module('xApplication', [ ])
            .controller('applicationController', function ($rootScope) {});
         -->
        </script>
    </head>
    <body ng-app='xApplication' ng-controller="applicationController">
    </body>
</html>

and following protractor test (using protractor 0.16.1, with hotfix from angular/protractor#85).

describe('crashcheck', function() {
    'use strict';
    it('should not crash', function() {
        var ptor = protractor.getInstance();
        ptor.get('/');
        ptor.get('/');
        ptor.get('/');
        ptor.get('/');
        ptor.get('/');
        ptor.get('/');
    });
});

Crashes reliably with the following stack trace in phantomjs, built from latest source (also crashes with 1.9.x). Crashes consistently when using maven jetty web server, much less frequently when using 'grunt-contrib-connect' as the server:

With only two 'ptor.get' calls in the test it passes ok, any more than two causes the crash. Seems somewhat related to the report at: detro/ghostdriver#103

#0  0x00007f59d005d208 in ?? ()
#1  0x00007fffc8515190 in ?? ()
#2  0x0000000000481c00 in WTF::RefPtr<WTF::StringImpl>::operator=(WTF::RefPtr<WTF::StringImpl> const&) ()
#3  0x0000000000f27827 in JSC::JITCode::execute(JSC::RegisterFile*, JSC::ExecState*, JSC::JSGlobalData*) ()
#4  0x0000000000f2b405 in JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#5  0x0000000000f877fa in JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#6  0x0000000000567254 in JSC::Bindings::QtConnectionObject::execute(void**) ()
#7  0x00000000005669ff in JSC::Bindings::QtConnectionObject::qt_metacall(QMetaObject::Call, int, void**) ()
#8  0x0000000001deef29 in QMetaObject::metacall (object=0x5259ab0, cl=QMetaObject::InvokeMetaMethod, idx=4, argv=0x7fffc8515970) at kernel/qmetaobject.cpp:245
#9  0x0000000001e03ab4 in QMetaObject::activate (sender=0x524fd00, m=0x1e85e80, local_signal_index=1, argv=0x0) at kernel/qobject.cpp:3574
#10 0x00000000004673fd in WebPage::loadStarted (this=0x524fd00) at moc_webpage.cpp:444
#11 0x000000000046534e in WebPage::qt_static_metacall (_o=0x524fd00, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x529b2f0) at moc_webpage.cpp:222
#12 0x0000000001dfdab5 in QMetaCallEvent::placeMetaCall (this=0x52a0aa0, object=0x524fd00) at kernel/qobject.cpp:524
#13 0x0000000001dfe860 in QObject::event (this=0x524fd00, e=0x52a0aa0) at kernel/qobject.cpp:1191
#14 0x0000000001577a82 in QApplicationPrivate::notify_helper (this=0x4fa8c30, receiver=0x524fd00, e=0x52a0aa0) at kernel/qapplication.cpp:4562
#15 0x0000000001575286 in QApplication::notify (this=0x7fffc8516800, receiver=0x524fd00, e=0x52a0aa0) at kernel/qapplication.cpp:3944
#16 0x0000000001de7969 in QCoreApplication::notifyInternal (this=0x7fffc8516800, receiver=0x524fd00, event=0x52a0aa0) at kernel/qcoreapplication.cpp:949
#17 0x0000000000486981 in QCoreApplication::sendEvent (receiver=0x524fd00, event=0x52a0aa0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#18 0x0000000001de88f5 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x4fa62e0) at kernel/qcoreapplication.cpp:1570
#19 0x0000000001e1a4a3 in QEventDispatcherUNIX::processEvents (this=0x4fa5680, flags=...) at kernel/qeventdispatcher_unix.cpp:908
#20 0x00000000015e6bc1 in QEventDispatcherQPA::processEvents (this=0x4fa5680, flags=...) at kernel/qeventdispatcher_qpa.cpp:246
#21 0x0000000001de4f24 in QEventLoop::processEvents (this=0x7fffc85166f0, flags=...) at kernel/qeventloop.cpp:149
#22 0x0000000001de50b0 in QEventLoop::exec (this=0x7fffc85166f0, flags=...) at kernel/qeventloop.cpp:200
#23 0x0000000001de7f9f in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
#24 0x0000000001574e7c in QApplication::exec () at kernel/qapplication.cpp:3823
#25 0x0000000000421c20 in main (argc=3, argv=0x7fffc8516998, envp=0x7fffc85169b8) at main.cpp:121

When using the original protractor (no modifications) the 'page unload event' error occurs. Crashes in phantomjs still occur under these conditions with the following stack trace:

#0  0x00007fabf01d1208 in ?? ()
#1  0x00007fff235d12c0 in ?? ()
#2  0x000000000050f803 in JSC::Structure::propertyStorageSize() const ()
#3  0x0000000000f27827 in JSC::JITCode::execute(JSC::RegisterFile*, JSC::ExecState*, JSC::JSGlobalData*) ()
#4  0x0000000000f2b405 in JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#5  0x0000000000f877fa in JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#6  0x0000000000567254 in JSC::Bindings::QtConnectionObject::execute(void**) ()
#7  0x00000000005669ff in JSC::Bindings::QtConnectionObject::qt_metacall(QMetaObject::Call, int, void**) ()
#8  0x0000000001deef29 in QMetaObject::metacall (object=0x49621f0, cl=QMetaObject::InvokeMetaMethod, idx=4, argv=0x7fff235d1b50) at kernel/qmetaobject.cpp:245
#9  0x0000000001e03ab4 in QMetaObject::activate (sender=0x4959d00, m=0x1e85e80, local_signal_index=10, argv=0x7fff235d1b50) at kernel/qobject.cpp:3574
#10 0x00000000004676d3 in WebPage::urlChanged (this=0x4959d00, _t1=...) at moc_webpage.cpp:507
#11 0x00000000004654e1 in WebPage::qt_static_metacall (_o=0x4959d00, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=0x7fff235d1e60) at moc_webpage.cpp:231
#12 0x0000000001e039d4 in QMetaObject::activate (sender=0x4964080, m=0x33276e0, local_signal_index=3, argv=0x7fff235d1e60) at kernel/qobject.cpp:3544
#13 0x0000000000481899 in QWebFrame::urlChanged(QUrl const&) ()
#14 0x000000000047ab77 in QWebFramePrivate::emitUrlChanged() ()
#15 0x00000000004c1c69 in WebCore::FrameLoaderClientQt::dispatchDidCommitLoad() ()
#16 0x000000000089c7fd in WebCore::FrameLoader::dispatchDidCommitLoad() ()
#17 0x000000000088de27 in WebCore::FrameLoader::receivedFirstData() ()
#18 0x000000000089048f in WebCore::FrameLoader::willSetEncoding() ()
#19 0x0000000000886630 in WebCore::DocumentWriter::setEncoding(WTF::String const&, bool) ()
#20 0x000000000087d7e9 in WebCore::DocumentLoader::commitData(char const*, int) ()
#21 0x00000000004c3d52 in WebCore::FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader*, char const*, int) ()
#22 0x000000000087d6f9 in WebCore::DocumentLoader::commitLoad(char const*, int) ()
#23 0x000000000087d900 in WebCore::DocumentLoader::receivedData(char const*, int) ()
#24 0x00000000008ad3b7 in WebCore::MainResourceLoader::addData(char const*, int, bool) ()
#25 0x00000000008b9d52 in WebCore::ResourceLoader::didReceiveData(char const*, int, long long, bool) ()
#26 0x00000000008aea42 in WebCore::MainResourceLoader::didReceiveData(char const*, int, long long, bool) ()
#27 0x00000000008ade36 in WebCore::MainResourceLoader::continueAfterContentPolicy(WebCore::PolicyAction, WebCore::ResourceResponse const&) ()
#28 0x00000000008ae077 in WebCore::MainResourceLoader::continueAfterContentPolicy(WebCore::PolicyAction) ()
#29 0x00000000008ae006 in WebCore::MainResourceLoader::callContinueAfterContentPolicy(void*, WebCore::PolicyAction) ()
#30 0x00000000008ae88b in WebCore::MainResourceLoader::didReceiveResponse(WebCore::ResourceResponse const&) ()
#31 0x00000000008af181 in WebCore::MainResourceLoader::handleDataLoadNow(WebCore::Timer<WebCore::MainResourceLoader>*) ()
#32 0x00000000008af2a8 in WebCore::MainResourceLoader::handleDataLoadSoon(WebCore::ResourceRequest const&) ()
#33 0x00000000008af44c in WebCore::MainResourceLoader::loadNow(WebCore::ResourceRequest&) ()
#34 0x00000000008af786 in WebCore::MainResourceLoader::load(WebCore::ResourceRequest const&, WebCore::SubstituteData const&) ()
#35 0x000000000087f4ee in WebCore::DocumentLoader::startLoadingMainResource(unsigned long) ()
#36 0x00000000008973e2 in WebCore::FrameLoader::continueLoadAfterWillSubmitForm() ()
#37 0x000000000089a590 in WebCore::FrameLoader::continueLoadAfterNavigationPolicy(WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool) ()
#38 0x00000000008999d0 in WebCore::FrameLoader::callContinueLoadAfterNavigationPolicy(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool)
#39 0x00000000008b27a5 in WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*) ()
#40 0x000000000089326b in WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::PassRefPtr<WebCore::FormState>) ()
#41 0x0000000000892c48 in WebCore::FrameLoader::load(WebCore::DocumentLoader*) ()
#42 0x0000000000892523 in WebCore::FrameLoader::load(WebCore::ResourceRequest const&, WebCore::SubstituteData const&, bool) ()
#43 0x000000000047d026 in QWebFrame::setHtml(QString const&, QUrl const&) ()
#44 0x0000000000413168 in WebPage::openUrl (this=0x4959d00, address=..., op=..., settings=...) at webpage.cpp:880
#45 0x0000000000465629 in WebPage::qt_static_metacall (_o=0x4959d00, _c=QMetaObject::InvokeMetaMethod, _id=15, _a=0x7fff235d3cf0) at moc_webpage.cpp:236
#46 0x00000000004667ee in WebPage::qt_metacall (this=0x4959d00, _c=QMetaObject::InvokeMetaMethod, _id=15, _a=0x7fff235d3cf0) at moc_webpage.cpp:361
#47 0x0000000001deef29 in QMetaObject::metacall (object=0x4959d00, cl=QMetaObject::InvokeMetaMethod, idx=19, argv=0x7fff235d3cf0) at kernel/qmetaobject.cpp:245
#48 0x0000000000563a0b in JSC::Bindings::QtRuntimeMetaMethod::call(JSC::ExecState*) ()
#49 0x0000000000f6df3b in cti_op_call_NotJSFunction ()
#50 0x00007fabf02f13ec in ?? ()
#51 0x00007fff235d3f20 in ?? ()
#52 0x00007fac34695a78 in ?? ()
#53 0x00007fab0000000f in ?? ()
#54 0x00007fac00000004 in ?? ()
#55 0x00007fff235d3f40 in ?? ()
#56 0x0000000000f97e69 in JSC::DateInstanceCache::reset() ()
#57 0x0000000000f27827 in JSC::JITCode::execute(JSC::RegisterFile*, JSC::ExecState*, JSC::JSGlobalData*) ()
#58 0x0000000000f2b405 in JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#59 0x0000000000f877fa in JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#60 0x0000000000567254 in JSC::Bindings::QtConnectionObject::execute(void**) ()
#61 0x00000000005669ff in JSC::Bindings::QtConnectionObject::qt_metacall(QMetaObject::Call, int, void**) ()
#62 0x0000000001deef29 in QMetaObject::metacall (object=0x4953880, cl=QMetaObject::InvokeMetaMethod, idx=4, argv=0x7fabdc005a10) at kernel/qmetaobject.cpp:245
#63 0x0000000001dfdaee in QMetaCallEvent::placeMetaCall (this=0x7fabdc006010, object=0x4953880) at kernel/qobject.cpp:526
#64 0x0000000001dfe860 in QObject::event (this=0x4953880, e=0x7fabdc006010) at kernel/qobject.cpp:1191
#65 0x0000000001577a82 in QApplicationPrivate::notify_helper (this=0x46b2c30, receiver=0x4953880, e=0x7fabdc006010) at kernel/qapplication.cpp:4562
#66 0x0000000001575286 in QApplication::notify (this=0x7fff235d5250, receiver=0x4953880, e=0x7fabdc006010) at kernel/qapplication.cpp:3944
#67 0x0000000001de7969 in QCoreApplication::notifyInternal (this=0x7fff235d5250, receiver=0x4953880, event=0x7fabdc006010) at kernel/qcoreapplication.cpp:949
#68 0x0000000000486981 in QCoreApplication::sendEvent (receiver=0x4953880, event=0x7fabdc006010) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#69 0x0000000001de88f5 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x46b02e0) at kernel/qcoreapplication.cpp:1570
#70 0x0000000001de8559 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1466
#71 0x00000000015e7055 in QCoreApplication::sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#72 0x00000000015e6aa7 in QEventDispatcherQPA::processEvents (this=0x46af680, flags=...) at kernel/qeventdispatcher_qpa.cpp:221
#73 0x0000000001de4f24 in QEventLoop::processEvents (this=0x7fff235d5140, flags=...) at kernel/qeventloop.cpp:149
#74 0x0000000001de50b0 in QEventLoop::exec (this=0x7fff235d5140, flags=...) at kernel/qeventloop.cpp:200
#75 0x0000000001de7f9f in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
#76 0x0000000001574e7c in QApplication::exec () at kernel/qapplication.cpp:3823
#77 0x0000000000421c20 in main (argc=3, argv=0x7fff235d53e8, envp=0x7fff235d5408) at main.cpp:121

Using the following protractor config file (with selenium 2.39):

exports.config = {
    seleniumServerJar: process.env.SELENIUM_HOME + '/selenium-server-standalone-2.39.0.jar',
    seleniumPort: null,
    chromeDriver: null,
    seleniumArgs: [],
    sauceUser: null,
    sauceKey: null,
    seleniumAddress: null,
    specs: [
        'test.spec.js',
    ],
    capabilities: {
        'browserName': 'phantomjs'
    },
    jasmineNodeOpts: {
        defaultTimeoutInterval: 10000
    },
    baseUrl: 'http://localhost:8081/'
};

(note that removing the 'defaultTimeoutInterval' occasionally allows the tests to pass crash free, but they usually timeout instead)

@smhc
Copy link
Author

smhc commented Jan 17, 2014

It's worth pointing out that using 'browser.driver.get' instead of 'ptor.get' works fine. So I believe it is the 'async script execute' that protractor is doing during it's 'get' (or the script injection) that is triggering the problem. Timing seems to be related - using a slower server (i.e grunt-contrib-connect) fails less often than a faster server such as jetty which fails every time.

@vitallium
Copy link
Collaborator

Please upgrade to PhantomJS 2. 1.9.x is no longer supported, and known to have many crasher bugs that are fixed in 2 version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@vitallium @smhc and others