Re: dietlibc (0.31), fork and pthreads

Tim München <[email protected]>
Newsgroups gmane.linux.lib.dietlibc
Organization Bergische Universität Wuppertal
Message-ID <[email protected]>
Hi,

thanks for looking into this!

> Get used to compile with all warnings enabled, it helps.

Okay, granted, in the little test app, I didn't take care of the headers and 
stuff, but the real problem occurs in a larger application, and there, all 
headers etc. are there.

> If you do it, you'll be tempted to #include the missing headers, and the
> program won't compile because of "waitpid(pid)";

Agreed.

> fixing it solved the 
> problem on my machine.

Interesting! I recompiled all four cases I mentioned above 
with -Wall -pedantic, fixed all compiler warnings, and the problem persists. 
I can't imagine how additional headers and a fixed waitpid should alter the 
behaviour of the fork() and pipe() before, anyway.

> Except that I still don't know why it would print "0": my only guess
> (the missing "int *" param overwriting something) doesn't really explain
> it, so if anybody knows better, I'm curious to hear the explanation.
> (thanks anyone)

No... this doesn't seem to have anything to do with it. I still got the 
behaviour in my tests, as mentioned. So... you can't reproduce the problem on 
your machine with 'diet gcc -Wall -pedantic -o test forktest.c -lpthread'? 
(note the linking of pthread!) If so, it would be interesting to compare the 
build environments; maybe there's some important difference. Can you post 
your build env specs?

I am compiling with a gcc 4.4.1-4ubuntu0, dietlibc 0.31-1.2ubuntu2, on an x86 
machine running ubuntu 9.10.


Cheers,
  Tim

-- 
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
<>                                                              <>
<> Tim München, M.Sc.        [email protected]   <>
<> Bergische Universitaet                                       <>
<> FB C - Physik             Tel.: +49 (0)202 439-3521          <>
<> Gaussstr. 20              Fax : +49 (0)202 439-2811          <>
<> 42097 Wuppertal                                              <>
<>                                                              <>
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.