Core dumps on headless server (16.04)

Bug #1586134 reported by Thomas d'Otreppe on 2016-05-26
50
This bug affects 9 people
Affects Status Importance Assigned to Milestone
phantomjs (Ubuntu)
Undecided
Unassigned

Bug Description

1) Ubuntu: 16.04 server (headless, no X)
2) Package version: phantomjs 2.1.1+dfsg-1

3) I'm expecting it to work (not crash) and run a script.
4) On an up to date system, it crashes and dumps core, even when simply running 'phantomjs' in a command line (it doesn't matter if run with sudo or without):
QXcbConnection: Could not connect to display
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.
Aborted (core dumped)

It doesn't even work when providing a script to run.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in phantomjs (Ubuntu):
status: New → Confirmed
Falk Nisius (falknisius) wrote :

Perhaps it depends on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808242.

as workaround can be:
- compile from source for headless usage
- install xvfb and use 'xvfb-run phantomjs' to wrap it in an xserver

goldcove (goldcove) wrote :

According to issue #14330 @ phantomjs this is due to a bug in the deb:
https://github.com/ariya/phantomjs/issues/14330

A third workaround is to use the static binary from http://phantomjs.org/download.html

goldcove, I'm sorry I should have mentioned that. The binary from phantomjs doesn't have this issue as you say. However, it has another issue (that has been resolved in their repository after the release): we cannot set the DPI (and it works fine with the deb) which means you might have to rework the html being converted/printed to PDF to adjust sizes.

J Logan (sgtbakerrahulnet) wrote :

Another workaround for this is to use the 'offscreen' platform. For example:

QT_QPA_PLATFORM=offscreen phantomjs rasterize.js 2i8zaNg04d9B41Zir2kT3J/output.html 2i8zaNg04d9B41Zir2kT3J.png

Phill (phill.l) wrote :

https://github.com/ariya/phantomjs/issues/14330 was a bit sparse on details but https://github.com/ariya/phantomjs/issues/14240 indicates that the problem is usually caused by distro's compiling against their own QT instead of the one bundled with phantomjs. Does anyone have the skills the verify this?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.