Bug 226034 - creation of pdf thumbnails/previews randomly fails
Summary: creation of pdf thumbnails/previews randomly fails
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: thumbnail (show other bugs)
Version: 4.3
Platform: FreeBSD Ports FreeBSD
: NOR normal
Target Milestone: ---
Assignee: Malte Starostik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-09 16:24 UTC by Andriy Gapon
Modified: 2010-02-17 21:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Gapon 2010-02-09 16:24:19 UTC
Version:            (using KDE 4.3.5)
OS:                FreeBSD
Installed from:    FreeBSD Ports

I think that I observe an issue quite similar to what is described and resolved in Bug 44098.
Creation of PDF thumbnails/previews randomly works/fails.
I've obtained some FreeBSD ktrace data for this problem:
  3453 100510 kdeinit4 CALL  wait4(0xd88,0x7fffffffcb3c,<invalid>0,0)
  3453 100510 kdeinit4 RET   wait4 -1 errno 4 Interrupted system call
  3453 100510 kdeinit4 PSIG  SIGCHLD caught handler=0x8007ce0b0 mask=0x0 code=0x0
As you can see, waitpid returns with EINTR because of SIGCHLD from a terminating child.
POSIX does not prohibit such behavior.
I suggest to change the waitpid code in kdegraphics/thumbnailers/ps/gscreator.cpp, so that it loos like the following:
int ret;
do {
  ret = waitpid(pid, &status, 0);
} while (ret == -1 && errno == EINTR);
if (ret != pid || (status != 0  && status != 256))
  ok = false;

The idea is to ignore spurious EINTR returns.
With this change PDF thumbnails/previews are created reliably for me.
Comment 1 Raphael Kubo da Costa 2010-02-17 21:00:43 UTC
SVN commit 1091886 by rkcosta:

Ignore spurious EINTR errors in waitpid when creating the PS preview.

Patch by Andriy Gapon, thanks!

CCMAIL: avg@icyb.net.ua
BUG: 226034


 M  +5 -1      gscreator.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1091886
Comment 2 Raphael Kubo da Costa 2010-02-17 21:19:24 UTC
I've also backported it to the 4.4 branch, but Bugzilla didn't receive the commit e-mail.