我正在尝试在AWS EC2实例(ubuntu bionic 18.04)上从CLI无头运行'diffpdf'(https://manpages.ubuntu.com/manpages/bionic/man1/diffpdf.1.html)。这只是一个工具(可以使用sudo apt-get install diffpdf安装),它需要两个pdf文件,并生成第三个pdf突出显示两者之间的差异。但是,尽管尝试了几个小时,我仍然无法运行它。
仅从CLI运行'diffpdf'会导致以下错误:
No XVisualInfo for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 0, greenBufferSize 0, blueBufferSize 0, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBeh
avior QSurfaceFormat::SwapBehavior(SingleBuffer), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile))
Falling back to using screens root_visual.
Unsupported screen format: depth: 8, red_mask: 0, blue_mask: 0
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::save: Painter not active
QPainter::fontMetrics: Painter not active
QPainter::pen: Painter not active
QPainter::setPen: Painter not active
QPainter::setPen: Painter not active
QPainter::restore: Unbalanced save/restore
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::save: Painter not active
QPainter::restore: Unbalanced save/restore
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::pen: Painter not active
QPainter::setPen: Painter not active
QPainter::setPen: Painter not active
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::setPen: Painter not active
QPainter::save: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::deviceTransform: Painter not active
QPainter::worldTransform: Painter not active
Segmentation fault (core dumped)
我相信这需要Xvfb才能起作用。但是,尝试对该工具使用'xvfb-run -a -e errors.txt'会导致挂起的命令行中包含空白errors.txt文件。即使我将它们注销到errors.txt,它也永远不会停止运行,也不会产生任何错误。
我现在完全陷入困境。有没有人对xvfb-run有任何经验,可以指出正确的方向?我的$ DISPLAY env变量设置为:99,这对于我在此实例上运行的其他Xvfb程序(例如无头chrome)可以正常工作。 Diffpdf是唯一失败的工具。