On 26/04/20 14:02 +0200, Denis Fondras wrote:
> Hi Frank,
> 
> I am using wkhtmltopdf from Odoo and I noticed it crashes when generating
> reports. This command crashes :
> /usr/local/bin/wkhtmltopdf --header-html /tmp/report.header.tmp.l1ae35ik.html 
> /tmp/report.body.tmp.0.s0vmsl3y.html report.pdf
> 
> Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
> 0x00000186bec30acb in cti_op_call_NotJSFunction ()
> (gdb) bt
> #0  0x00000186bec30acb in cti_op_call_NotJSFunction ()
> #1  0x00000186bec2bd98 in ctiTrampoline ()
> #2  0x00000186beb51e1b in JSC::Interpreter::executeCall(JSC::ExecState*, 
> JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, 
> JSC::ArgList const&) ()
> #3  0x00000186beb5b7fb in JSC::call(JSC::ExecState*, JSC::JSValue, 
> JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
> #4  0x00000186bf33ba68 in 
> WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext*, 
> WebCore::Event*) ()
> #5  0x00000186bed779ce in 
> WebCore::EventTarget::fireEventListeners(WebCore::Event*, 
> WebCore::EventTargetData*, WTF::Vector<WebCore::RegisteredEventListener, 
> 1ul>&) ()
> #6  0x00000186bed773b6 in 
> WebCore::EventTarget::fireEventListeners(WebCore::Event*) ()
> #7  0x00000186bed7372b in 
> WebCore::EventDispatcher::dispatchEvent(WTF::PassRefPtr<WebCore::Event>) ()
> #8  0x00000186bed725a5 in 
> WebCore::EventDispatchMediator::dispatchEvent(WebCore::EventDispatcher*) 
> const ()
> #9  0x00000186bed7268c in 
> WebCore::EventDispatcher::dispatchEvent(WebCore::Node*, 
> WebCore::EventDispatchMediator const&) ()
> #10 0x00000186bef66eb2 in 
> WebCore::Node::dispatchEvent(WTF::PassRefPtr<WebCore::Event>) ()
> #11 0x00000186bed8fe39 in WebCore::Document::finishedParsing() ()
> #12 0x00000186bf514b7f in WebCore::HTMLDocumentParser::prepareToStopParsing() 
> ()
> #13 0x00000186bf5160dd in 
> WebCore::HTMLDocumentParser::executeScriptsWaitingForStylesheets() ()
> #14 0x00000186bed8a539 in WebCore::Document::removePendingSheet() ()
> #15 0x00000186bf538692 in WebCore::HTMLLinkElement::sheetLoaded() ()
> #16 0x00000186beef5261 in WebCore::CSSStyleSheet::checkLoaded() ()
> #17 0x00000186bf53825f in 
> WebCore::HTMLLinkElement::setCSSStyleSheet(WTF::String const&, WebCore::KURL 
> const&, WTF::String const&, WebCore::CachedCSSStyleSheet const*) ()
> #18 0x00000186bf539a01 in WebCore::CachedCSSStyleSheet::checkNotify() ()
> #19 0x00000186bf5397da in 
> WebCore::CachedCSSStyleSheet::data(WTF::PassRefPtr<WebCore::SharedBuffer>, 
> bool) ()
> #20 0x00000186bf9eb551 in 
> WebCore::CachedResourceRequest::didFinishLoading(WebCore::SubresourceLoader*, 
> double) ()
> #21 0x00000186bfa9048f in 
> WebCore::SubresourceLoader::didFinishLoading(double) ()
> #22 0x00000186bef8cf00 in WebCore::QNetworkReplyHandler::finish() ()
> #23 0x00000186bef8b11f in WebCore::QNetworkReplyHandlerCallQueue::flush() ()
> #24 0x00000186bef8da80 in WebCore::QNetworkReplyWrapper::didReceiveFinished() 
> ()
> #25 0x00000186c05ad148 in QMetaObject::activate(QObject*, QMetaObject const*, 
> int, void**) ()
> #26 0x00000186c03db9db in QNetworkReplyImplPrivate::finished() ()
> #27 0x00000186c05a8643 in QObject::event(QEvent*) ()
> #28 0x00000186bfd4b1b6 in QApplicationPrivate::notify_helper(QObject*, 
> QEvent*) ()
> #29 0x00000186bfd4c8f3 in QApplication::notify(QObject*, QEvent*) ()
> #30 0x00000186c0591eb8 in QCoreApplication::notifyInternal(QObject*, QEvent*) 
> ()
> #31 0x00000186c0592cd6 in QCoreApplicationPrivate::sendPostedEvents(QObject*, 
> int, QThreadData*) ()
> #32 0x00000186c05bf8f7 in 
> QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
> #33 0x00000186c05923e5 in 
> QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
> #34 0x00000186bea9a19f in wkhtmltopdf::Converter::convert() ()
> #35 0x00000186beabeb2c in main ()
> 
> 
> If I remove the --header-html (or --footer-html), it works :
> /usr/local/bin/wkhtmltopdf /tmp/report.header.tmp.l1ae35ik.html 
> /tmp/report.body.tmp.0.s0vmsl3y.html z.pdf
> 
> I also noticed that "/usr/local/bin/wkhtmltopdf https://www.google.com"; 
> crashes
> when "/usr/local/bin/wkhtmltopdf --disable-javascript https://www.google.com";
> does not. Not the same trace though :
> 
> Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
> 0x000005550bc3369b in cti_op_construct_NotJSConstruct ()
> (gdb) bt
> #0  0x000005550bc3369b in cti_op_construct_NotJSConstruct ()
> #1  0x000005550bc2dd98 in ctiTrampoline ()
> #2  0x000005550bb53843 in JSC::Interpreter::execute(JSC::ProgramExecutable*, 
> JSC::ExecState*, JSC::ScopeChainNode*, JSC::JSObject*) ()
> #3  0x000005550bd331aa in JSC::evaluate(JSC::ExecState*, 
> JSC::ScopeChainNode*, JSC::SourceCode const&, JSC::JSValue) ()
> #4  0x000005550bd2371a in 
> WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&, 
> WebCore::DOMWrapperWorld*) ()
> #5  0x000005550bd23a26 in 
> WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode const&) ()
> #6  0x000005550c4192d2 in 
> WebCore::ScriptElement::executeScript(WebCore::ScriptSourceCode const&) ()
> #7  0x000005550c419938 in 
> WebCore::ScriptElement::execute(WebCore::CachedScript*) ()
> #8  0x000005550c41b2de in 
> WebCore::ScriptRunner::timerFired(WebCore::Timer<WebCore::ScriptRunner>*) ()
> #9  0x000005550bd70aed in WebCore::ThreadTimers::sharedTimerFiredInternal() ()
> #10 0x000005550d5aa881 in QObject::event(QEvent*) ()
> #11 0x000005550cd4d1b6 in QApplicationPrivate::notify_helper(QObject*, 
> QEvent*) ()
> #12 0x000005550cd4e8f3 in QApplication::notify(QObject*, QEvent*) ()
> #13 0x000005550d593eb8 in QCoreApplication::notifyInternal(QObject*, QEvent*) 
> ()
> #14 0x000005550d5c10fd in QTimerInfoList::activateTimers() ()
> #15 0x000005550d5c19a3 in 
> QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
> #16 0x000005550d5943e5 in 
> QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
> #17 0x000005550ba9c19f in wkhtmltopdf::Converter::convert() ()
> #18 0x000005550bac0b2c in main ()
> 
> Do you have any clue to help debugging this issue ?
> 

Hi

Does your report actually have a header or a footer configured? What is the 
content of the report header and footer?

Reply via email to