|
From: Dima B. <di...@cs...> - 2003-05-28 01:42:07
|
Hi,
I am having some trouble with valgrind 1.9.6 and named pipes. In the
application when I create the named pipes, mkfifo, the application blocks
indefinitely in the open call if it is run by valgrind. Without valgrind
it works as it supposed to.
I am not sure why and what is causing the problems. I have not used
previous versions of valgrind with named pipes so I don't know if things
were broken or not before.
Thanks for any and all help.
ttyl
Dima
--
Dima Brodsky di...@cs...
http://www.cs.ubc.ca/~dima
201-2366 Main Mall
Department of Computer Science (604) 822-2895 (DSG Lab)
University of British Columbia, Canada (604) 822-5485 (FAX)
"The price of reliability is the pursuit of the utmost simplicity.
It is a price which the very rich find the most hard to pay."
(Sir Antony Hoare, 1980)
|
|
From: Jeremy F. <je...@go...> - 2003-05-28 04:11:31
Attachments:
03a-open-nonblock.patch
|
On Tue, 2003-05-27 at 18:41, Dima Brodsky wrote: > I am not sure why and what is causing the problems. I have not used > previous versions of valgrind with named pipes so I don't know if things > were broken or not before. Valgrind doesn't deal with the blocking semantics of FIFO files. I have a patch, but it doesn't apply to the current tree; I'll need to update it. I've attached it in its current form if you want to play with it before I get to it. J |
|
From: Jeremy F. <je...@go...> - 2003-05-28 08:15:44
|
On Tue, 2003-05-27 at 21:11, Jeremy Fitzhardinge wrote: > On Tue, 2003-05-27 at 18:41, Dima Brodsky wrote: > > I am not sure why and what is causing the problems. I have not used > > previous versions of valgrind with named pipes so I don't know if things > > were broken or not before. > > Valgrind doesn't deal with the blocking semantics of FIFO files. I have > a patch, but it doesn't apply to the current tree; I'll need to update > it. I've attached it in its current form if you want to play with it > before I get to it. Silly me. This is already in there. If you're seeing problems, it would be useful if you can provide a small program which reproduces it. strace output would be useful too. J |
|
From: Dima B. <di...@cs...> - 2003-05-28 16:56:33
|
Upon further investigation I have found the following.
If I have:
Process 1 Process 2
open( pipe1, O_WRONLY ) -->-->--> pipe 1 -->-->--> open( pipe1, O_RDONLY );
open( pipe2, O_RDONLY ) --<--<--< pipe 2 --<--<--< open( pipe2, O_WRONLY );
The valgrind gets stuck on the open call on pipe1 in process 2. It only
gets stuck in my larger program, a smaller program that just opens the
pipes works fine. My bigger program has many threads, but at the time
of pipe creation no threads have been started up yet.
No if I have:
Process 1 Process 2
open( pipe1, O_RDWR ) -->-->--> pipe 1 -->-->--> open( pipe1, O_RDWR );
open( pipe2, O_RDWR ) --<--<--< pipe 2 --<--<--< open( pipe2, O_RDWR );
^ ^
| |
Than everything works fine. Will provide an strace output shortly.
ttyl
Dima
On Wed, May 28, 2003 at 01:02:47AM -0700, Jeremy Fitzhardinge wrote:
> On Tue, 2003-05-27 at 21:11, Jeremy Fitzhardinge wrote:
> > On Tue, 2003-05-27 at 18:41, Dima Brodsky wrote:
> > > I am not sure why and what is causing the problems. I have not used
> > > previous versions of valgrind with named pipes so I don't know if things
> > > were broken or not before.
> >
> > Valgrind doesn't deal with the blocking semantics of FIFO files. I have
> > a patch, but it doesn't apply to the current tree; I'll need to update
> > it. I've attached it in its current form if you want to play with it
> > before I get to it.
>
> Silly me. This is already in there. If you're seeing problems, it
> would be useful if you can provide a small program which reproduces it.
> strace output would be useful too.
>
> J
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ObjectStore.
> If flattening out C++ or Java code to make your application fit in a
> relational database is painful, don't do it! Check out ObjectStore.
> Now part of Progress Software. http://www.objectstore.net/sourceforge
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
--
Dima Brodsky di...@cs...
http://www.cs.ubc.ca/~dima
201-2366 Main Mall
Department of Computer Science (604) 822-2895 (DSG Lab)
University of British Columbia, Canada (604) 822-5485 (FAX)
"The price of reliability is the pursuit of the utmost simplicity.
It is a price which the very rich find the most hard to pay."
(Sir Antony Hoare, 1980)
|