bug-guile
[Top][All Lists]
Advanced

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

Re: Thread + Socket + Pipes Bug?


From: bobstopper
Subject: Re: Thread + Socket + Pipes Bug?
Date: Mon, 11 Aug 2003 18:02:23 +0800
User-agent: Mutt/1.3.28i

Hi Neil

Thanks for your response. My responses are below


On Sun, Aug 10, 2003 at 10:19:52PM +0100, Neil Jerram wrote:
> Robert,
> 
> I'm having trouble reproducing the problem, and I also have some
> questions about the code.
> 
> 1. Repro
> 
> Can you be precise about "dumping data" to port 6008.  I've tried
> running with just ./buggy.scm in one window, and the following in
> another window...
> 
> address@hidden ~]$ telnet localhost 6008
> Trying ::1...
> telnet: connect to address ::1: Connection refused
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> bye
> bye again
> ^]
> telnet> close
> Connection closed.
> address@hidden ~]$ telnet localhost 6008
> Trying ::1...
> telnet: connect to address ::1: Connection refused
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> hello
> hello again
> hello 3
> hello 4
> ^]
> telnet> close
> Connection closed.
> 
> ...but I don't see any error (or any other output/result) anywhere.

Ok, well that's pretty annoying. That's certainly what I do to get it
complaining. Sometimes it takes a few attempts at dumping output there
before it complains but generally speaking it will crash in the first
attempt. I've had it doing it on 3 different computers. Do you have
anything related installed which might be working around the problem?

By the way, the output drawn from the port 6008 connection should
appear on the server terminal after about 10 seconds under normal
operation. That's also where any errors will appear.


> 2. Code
> 
> Why do you need to lock and unlock the mutex so much on the main
> thread?  It looks to me as though the data protected by the mutex is
> just `message' - is that correct?

Yeah, I started out just protecting that but because I was getting
file descriptor errors everywhere and because they always seemed
related to the threading, I started locking whenever I performed
operations on file descriptors. That did seem to work for most of the
errors. However nothing I lock seems to help this particular problem
with select without reverting the whole program to a thread blocking
accept.

Am I correct that simple file descriptor operations should not need
mutex locks? If so, that's probably a related bug which you could reveal
simply by removing unnecessary mutex locks around port/pipe
operations. Upon doing that the errors should include more "bad file
descriptor" errors and eventually broken pipes.


-- 
Regards,

Robert Marlow




reply via email to

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