This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: malloc patch for 2.2.4


> Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de> writes:
> 
> |> > Thanks, I've applied the patch.
> |> 
> |> Thanks.  However, I'm still seeing the fork/malloc SMP problem on my
> |> machine... :-(
> 
> I'd guess it's because the compiler has the full right to forget about the
> local variable and reload from the global one anyway.

First of all, I'm still suspecting a completely different problem to
cause the weird SMP crashes, I'm seeing seemingly random stack/memory
corruption.

Second, _if_ the compiler would actually reload from the global
variable in this case (strictly speaking it has the right to do so
under ANSI C), I'd consider it _unsuitable_ for threaded programs.
There would definitely need to be a switch to turn this off.

It is generally considered a necessity that a system for multi-thread
applications expands at least slightly (in the above case: extremely
minimally IMHO) on the strict POSIX memory visibilty gurantees, see
e.g. the comp.programming.threads FAQ,

http://www.lambdacs.com/cpt/FAQ.html

Q56, Q180 and in particular the second answer to Q202.

Regards,
Wolfram.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]