[vlc-devel] Buildbot considered useless

Pierre Ynard linkfanel at yahoo.fr
Thu Jun 18 09:25:54 CEST 2009


> > Now there is still the windres issue which looks like a windres bug.
> > 

More findings... (You can skip directly to the end of the mail if you
don't care about technical details.)

> Can you patch pthreads to use windres -v?

Yes, actually I can reproduce the bug from the command line:

% i586-mingw32msvc-windres -v --include-dir=. -D__CLEANUP_C -o version.o version.rc
Using `i586-mingw32msvc-gcc -E -xc -DRC_INVOKED -I. -D__CLEANUP_C
version.rc'
Using popen to read preprocessor output
i586-mingw32msvc-windres: preprocessing failed.

And the preprocessed output is spouted on stdin too. Also, the bug
disappears when I try stracing windres. What windres is trying to do is
the sequence:

pipe([3, 4])
fork()
and in the child (running the preprocessor)
dup2(4,1)
exec(<preprocessor>)

With gdb, I debugged popen() in the glibc, and apparently pipe2()
returns a value of 331 (with errno == 0), not modifying the pipe_fds
array passed to it. However, /proc/<pid>/fd reports that the pipe is
created correctly.

Since 331 is an unexpected return value, no error is detected by the
glibc code. Then, a garbage value is passed to dup2() instead of 4,
dup2() fails with EBADF, 1 remains stdin which explains why the output
is spouted on stdin. In the parent process, an error occurs when trying
to read from the garbage value for the pipe fd.

Digging further, 331 is the syscall number for pipe2() on x86_32. It
is passed into the eax register right before the syscall instruction.
Apparently the syscall messes up, and returns with 331 still in eax,
which is not considered as an error value and then returned as is.

A possible cause might be an x86_64 and/or too old kernel (pipe2()
didn't exist in 2.6.26).

> Perhaps we can find a solution/workaround and maybe report a bug to
> mingw devs.

Well, the good news is that we can work around it by passing
--use-temp-file to windres from the contribs Makefile. I'm not sure
about to whom the bug should be reported :S

After that, there will still be a shitload of libtool version
incompatibility errors...

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the vlc-devel mailing list