After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730545 - xsltproc - Tries to seek on fifo XML file.
xsltproc - Tries to seek on fifo XML file.
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-21 20:52 UTC by iwonbigbro
Modified: 2021-07-05 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description iwonbigbro 2014-05-21 20:52:05 UTC
If you use a fifo or bash process substitution directive (anonymous fifo), then xsltproc fails due to an invalid seek on a the fifo.  Quite simple to reproduce, but you need to make the XSL complicated enough that would cause a seek.

I am trying to use xsltproc to process a response from a soap service in the following way.  It seems natural to do it this way and doesn't require any temporary files.

strace -o xsltproc.strace xsltproc - <(soap_service "myquery") <<HERE
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet ...
</xsl:stylesheet>
HERE

strace:
stat("/dev/fd/62", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
stat("/dev/fd/62", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
stat("/dev/fd/62", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
open("/dev/fd/62", O_RDONLY)            = 3
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff4b960d000
read(3, "<?xml version=\"1.0\" encoding=\"UT"..., 16384) = 390
read(3, "", 12288)                      = 0
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
lseek(3, 18446744073709547520, SEEK_SET) = -1 ESPIPE (Illegal seek)
read(3, "", 4096)                       = 0
write(2, "/dev/fd/62:1: ", 14)          = 14
write(2, "parser ", 7)                  = 7
write(2, "error : ", 8)                 = 8
write(2, "Document is empty\n", 18)     = 18
write(2, "\n", 1)                       = 1
write(2, "^\n", 2)                      = 2
write(2, "/dev/fd/62:1: ", 14)          = 14
write(2, "parser ", 7)                  = 7
write(2, "error : ", 8)                 = 8
write(2, "Start tag expected, '<' not foun"..., 34) = 34
write(2, "\n", 1)                       = 1
write(2, "^\n", 2)                      = 2
close(3)                                = 0
munmap(0x7ff4b960d000, 4096)            = 0
write(2, "cannot parse /dev/fd/62\n", 24) = 24

xsltproc --version yields:
Using libxml 20706, libxslt 10117 and libexslt 813
xsltproc was compiled against libxml 20626, libxslt 10117 and libexslt 813
libxslt 10117 was compiled against libxml 20626
libexslt 813 was compiled against libxml 20626
Comment 1 Nick Wellnhofer 2014-09-28 10:35:09 UTC
Your command tries to pass both the stylesheet and the input document through stdin. This simply cannot work. You can either pass the stylesheet via stdin:

xsltproc - doc.xml <<HERE
<xsl:stylesheet ...
</xsl:stylesheet>
HERE

Or the document:

xsltproc stylesheet.xsl - <<HERE
<doc ...
</doc>
HERE

But not both.
Comment 2 iwonbigbro 2014-09-28 19:32:54 UTC
Err, no, no it doesn't. Look more closely. It is using standard input for the stylesheet only. The xml document is provided via a bash process absorption fifo.
Comment 3 iwonbigbro 2014-09-28 19:34:06 UTC
Err, no, no it doesn't. Look more closely. It is using standard input for the stylesheet only. The xml document is provided via a bash process substitution or fifo.
Comment 4 iwonbigbro 2014-09-28 19:35:47 UTC
Ignore comment 2. Swype user error.
Comment 5 Nick Wellnhofer 2014-09-28 20:29:09 UTC
You're right, reopening.
Comment 6 GNOME Infrastructure Team 2021-07-05 11:01:17 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxslt/-/issues/

Thank you for your understanding and your help.