[vlc-devel] Buildbot considered useless

Rafaël Carré rafael.carre at gmail.com
Thu Jun 18 11:13:16 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 18 Jun 2009 09:25:54 +0200
Pierre Ynard <linkfanel at yahoo.fr> wrote:

> > > 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.

Nice :)

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

I tried on altair which use 2.6.26 / x86_64 / glib 2.9 and pipe2()
returns -1

gcc even says t.c:(.text+0x20): warning: warning: pipe2 is not
implemented and will always fail

I also tried windres (not from vlc build) and it seems to work fine

If you run on x86_64, then 331 is not the pipe2 syscall?

You could run in gdb, break on pipe2 and run step by step and
disassemble the code path.

> > 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

Perhaps you don't want to know what the bug is now :P

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

well now at least there is some progress, each error in its time!

- -- 
Rafaël Carré
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAko6BSwACgkQYWCeGMCv8Q/rQwCdF7my2VUk2CSADHgI2tvh31ez
URAAoOov3fhmf+XZATAWYYOYubkp5r5/
=WWo9
-----END PGP SIGNATURE-----


More information about the vlc-devel mailing list