我已经在 Ubuntu 14.04 服务器上安装了 PovRay 3.7,使用默认的“povray”包来试验它作为网站动态生成图形的工具。
无论我尝试哪个脚本,它都会一直“挂起”。我使用引号是因为我不知道这是否真的挂起;如果没有一点用户干预,它似乎就无法完成。
我使用 启动一个脚本povray +Ifilename.pov
,然后它显示其进度直至Antialiasing......Off
语句,然后不再执行任何操作。目录中有一个额外的filename-state
文件。
但是,如果我使用ctrl+z
then fg
,它会立即继续并完成(通常需要~1 秒的跟踪时间)并创建一个正确呈现的filename.png
文件。
但是,这种情况只会在 povray 连续运行时发生。服务器重启后的第一次运行一切顺利,只有第一次运行之后的每次运行(直到下一次服务器重启)才会出现这种情况。
我已经尝试了手册和外部来源的几个示例脚本;它们都以相同的方式运行。
有人知道发生了什么事以及我该怎么做才能解决它吗?
strace povray -i{scriptname}
产生一个无尽的列表:
futex(0x19c7988, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x19c79b4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 729, {1415657359, 593721000}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x19c7988, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x19c79b4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 731, {1415657359, 794168000}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x19c7988, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x19c79b4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 733, {1415657359, 994601000}, ffffffff
答案1
免责声明
我不确定这个答案是否算作答案,但我想一句礼貌的“我无法重现你的问题”也算是一种答案。另外,我想添加一些不适合放在评论里的信息。
我无法重现该问题
我无法在虚拟机上使用 Ubuntu 重现该问题。我使用了 Ubutu 14.04 LTS x86_64 所有更新(2014 年 11 月 13 日),安装了内核为 3.13.0-39-generic 的基本服务器,并从 Ubuntu 包管理器安装了 POVRAY。如果您有其他版本,请告诉我(在评论中),我会再试一次。
我的输出Povray --version
是:
POV-Ray 3.7.0.unofficial
This is an unofficial version compiled by:
Felix Geyer <[email protected]> for Debian <www.debian.org>
The POV-Ray Team is not responsible for supporting this version.
Copyright 1991-2013 Persistence of Vision Raytracer Pty. Ltd.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Built-in features:
I/O restrictions: enabled
X Window display: enabled (using SDL)
Supported image formats: gif tga iff ppm pgm hdr png jpeg tiff openexr
Unsupported image formats: -
Compilation settings:
Build architecture: x86_64-pc-linux-gnu
Built/Optimized for: x86_64-pc-linux-gnu
Compiler vendor: gnu
Compiler version: g++ 4.8
Compiler flags: -pipe -Wno-multichar -Wno-write-strings -fno-enforce-eh-specs -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O3 -pthread
我尝试对几个 .pov 示例文件进行光线追踪,它们都运行正常。例如,这是我对 bezier.pov 的输出(稍微整理了一下):
Persistence of Vision(tm) Ray Tracer Version 3.7.0.unofficial (g++ 4.8 @ x86_64-pc-linux-gnu)
This is an unofficial version compiled by: Felix Geyer <[email protected]> for Debian <www.debian.org>
The POV-Ray Team is not responsible for supporting this version.
POV-Ray is based on DKBTrace 2.12 by David K. Buck & Aaron A. Collins
Copyright 1991-2013 Persistence of Vision Raytracer Pty. Ltd.
----------------------------------------------------------------------------
<<...cut some credits here...>>
----------------------------------------------------------------------------
Parser Options
Input file: /usr/share/doc/povray/examples/objects/bezier.pov
Remove bounds........On
Split unions.........Off
Library paths:
/usr/share/povray-3.7
/usr/share/povray-3.7/ini
/usr/share/povray-3.7/include
Clock value: 0.000 (Animation off)
Image Output Options
Image resolution.....800 by 600 (rows 1 to 600, columns 1 to 800).
Output file........../usr/share/doc/povray/examples/objects/bezier.png, 24 bpp PNG
Dithering............Off
Graphic display......On (gamma: sRGB)
Mosaic preview.......Off
Continued trace......Off
Information Output Options
All Streams to console..........On
Debug Stream to console.........On
Fatal Stream to console.........On
Render Stream to console........On
Statistics Stream to console....On
Warning Stream to console.......On
==== [Parsing...] ==========================================================
Parser Statistics
Finite Objects: 1
Infinite Objects: 1
Light Sources: 1
Total: 3
Parser Time
Parse Time: 0 hours 0 minutes 0 seconds (0.011 seconds)
using 1 thread(s) with 0.010 CPU-seconds total
Bounding Time: 0 hours 0 minutes 0 seconds (0.000 seconds)
using 1 thread(s) with 0.000 CPU-seconds total
----------------------------------------------------------------------------
Render Options
Quality: 9
Bounding boxes.......On
Bounding threshold: 3
Antialiasing.........Off
----------------------------------------------------------------------------
Render Statistics
Image Resolution 800 x 600
Pixels: 480000
Samples: 0
Smpls/Pxl: 0.00
Rays: 480000
Saved: 0
Max Level: 1/5
Ray->Shape Intersection Tests Succeeded Percentage
Bicubic Patch 725967 122319 16.85
Plane 959954 480000 50.00
Bounding Box 959954 627633 65.38
----------------------------------------------------------------------------
Shadow Ray Tests: 479996
Succeeded: 46
Shadow Cache Hits: 42
----------------------------------------------------------------------------
Render Time:
Photon Time: No photons
Radiosity Time: No radiosity
Trace Time: 0 hours 0 minutes 2 seconds (2.185 seconds)
using 4 thread(s) with 1.683 CPU-seconds total
----------------------------------------------------------------------------
POV-Ray finished
问题的原因和(可能的)“解决方案”
根据 的输入strace
,我认为您的 povray 也是使用该-pthread
标志编译的,并且不知何故一个子进程终止而没有释放 futex,从而锁定了主 povray 线程。您的 strance 给出了主 povray 线程的输出,但它不包括子进程的 strace 信息。如果您真的想知道发生了什么,你可以尝试ps -efL | grep povray
(更多信息这个博客), 哪个可能提供一些关于锁定您的观点的更多见解。
如果你真的想要解决这个问题,我建议你首先尝试获取 povray 的 -dev 版本,然后在你的机器上自行编译,看看是否有区别。或者,你可以抓取Povray 的源文件并尝试一下。
最后,你可能想留下Ubuntu 上的错误报告,以便他们能够查看。