由PHP shell_exec触发的Xvfb中运行新的Firefox崩溃

时间:2017-03-24 07:00:49

标签: php firefox lighttpd xvfb

我有一些php脚本,shell_execute一些bash脚本。在这个bash中我启动一个Xvfb-Session并在其中启动一些firefox并截取屏幕截图然后再次杀死firefox和xvfb。 它在Ubuntu 14.04服务器上。

在Ubuntu 14.04上更新到Mozilla Firefox 52.0.1之前,它一直运行良好。

但是自从firefox更新后,firefox崩溃并将大量内容写入/var/log/kern.log和/ var / log / syslog

Mar 22 11:29:12 vmd4390 kernel: [4406567.876304] Chrome_ChildThr[2469]: segfault at 0 ip 00007f151faf6c04 sp 00007f15105fe410 error 6 in plugin-container[7f151faf2000+1a000]
Mar 22 11:35:14 vmd4390 kernel: [4406929.195398] Chrome_ChildThr[2721]: segfault at 0 ip 00007fe8ef82cc04 sp 00007fe8e03fe410 error 6 in plugin-container[7fe8ef828000+1a000]
Mar 22 11:36:14 vmd4390 kernel: [4406989.871059] Chrome_ChildThr[2867]: segfault at 0 ip 00007fd880e0ac04 sp 00007fd8719fe410 error 6 in plugin-container[7fd880e06000+1a000]
Mar 22 11:37:15 vmd4390 kernel: [4407050.509036] Chrome_ChildThr[3014]: segfault at 0 ip 00007f9f15592c04 sp 00007f9f060fe410 error 6 in plugin-container[7f9f1558e000+1a000]
Mar 22 11:38:16 vmd4390 kernel: [4407111.606671] Chrome_ChildThr[3125]: segfault at 0 ip 00007f86977aac04 sp 00007f86882fe410 error 6 in plugin-container[7f86977a6000+1a000]
Mar 22 11:39:17 vmd4390 kernel: [4407172.356265] Chrome_ChildThr[3272]: segfault at 0 ip 00007f0f434c9c04 sp 00007f0f33ffe410 error 6 in plugin-container[7f0f434c5000+1a000]
Mar 22 11:40:37 vmd4390 kernel: [4407252.060993] firefox[3409]: segfault at 0 ip 00007f5b5fd9d2b2 sp 00007ffee6078cf8 error 4 in libxul.so[7f5b5f3f3000+3e6d000]
Mar 22 11:46:38 vmd4390 kernel: [4407613.213520] firefox[3529]: segfault at 0 ip 00007fb40b19d2b2 sp 00007fff70acd458 error 4 in libxul.so[7fb40a7f3000+3e6d000]
Mar 22 11:53:45 vmd4390 kernel: [4408040.293350] firefox[3581]: segfault at 0 ip 00007f8e5c79d2b2 sp 00007ffd6fe22ac8 error 4 in libxul.so[7f8e5bdf3000+3e6d000]
Mar 22 14:20:18 vmd4390 kernel: [4416833.631493] firefox[4020]: segfault at 0 ip 00007f4bee99d2b2 sp 00007ffeb8ac3718 error 4 in libxul.so[7f4bedff3000+3e6d000]
Mar 22 14:30:54 vmd4390 kernel: [4417469.726500] firefox[4158]: segfault at 0 ip 00007fd45d09d2b2 sp 00007ffc57234588 error 4 in libxul.so[7fd45c6f3000+3e6d000]

当我使用" php5-cgi test.php"在控制台上调用这个php脚本时,它仍然运行完美。但是当我通过lightttpd从浏览器调用它时,它突然崩溃了。

在这个firefox中有一些新的插件容器进程。在一切都在一个firefox进程之前。

PHP脚本:

$token = date('Y-m-d-H-i-s') . '-a1sf24df4asd54';
$url = 'https://www.my-url.com';
$screenNo = (int) date('i') + 30;

$PID = shell_exec('./start-run-preview.sh ' . escapeshellarg($url) . ' ' . escapeshellarg($name) . ' 60 ' . $screenNo . ' ' . escapeshellarg($token) . ' >> logs/'.$token.'.log 2>&1 &');
echo 'Screen: ' . $screenNo . PHP_EOL;
exit;

start-run-preview.sh

echo "Starting XVFB on $XVFB_DISPLAY"
Xvfb :${XVFB_DISPLAY} -screen 0 ${XVFB_RES_WIDTH}x${XVFB_RES_HEIGHT}x24 -noreset -nolisten tcp 2> /dev/null &
XVFB_PID=$!

# Remove parent lock to prevent error message "firefox has been shutdown unexpectly..."
rm ~/.mozilla/firefox/${FF_PROFILE_DIR}/.parentlock

echo "Running firefox -profile ${FF_PROFILE_DIR} on $XVFB_DISPLAY "
DISPLAY=:${XVFB_DISPLAY} firefox -profile ~/.mozilla/firefox/${FF_PROFILE_DIR} -width $XVFB_RES_WIDTH -height $XVFB_RES_HEIGHT "$FF_URL" > /dev/null &
FF_PID=$!

echo "firefox running on PID $FF_PID"

我尝试在此二手firefox配置文件中禁用了Flash插件,但它没有帮助。我不知道该做什么或在哪里找到问题。

0 个答案:

没有答案