bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fopen/malloc MT bug


From: Wolfram Gloger
Subject: Re: fopen/malloc MT bug
Date: Wed, 18 Apr 2001 12:00:16 +0200 (MDT)

Hello,

> In a multithreaded program (Linux 2.2.15, glibc 2.2-5, gcc 2.96) I noticed
> the following problem: memory gets corrupted when one thread calls
> malloc() and another calls fopen() at the same time.

Works fine for me with glibc-2.1.3 and -2.2.2, as long as I don't use
mcheck.

> Please let me know if you know some other workarounds, a real solution or
> anything about this bug (or is it my mistake?) because replacing
> fopen() with open() is not what I really need.

I believe mcheck is not thread-safe, you can't use -lmcheck and
-lpthread together.  (Someone correct me if I'm wrong.)  If you need
simple checking with threaded programs, try the environment variable
MALLOC_CHECK_.

Regards,
Wolfram.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]