This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]Fix that GDB will get hang on Windows when using pipe to get stdout and stderr from stub

> From: "Terry Guo" <>
> Cc: <>,
> 	"Joey Ye" <>,
> 	"Matthew Gretton-Dann" <>,
> 	"'Pedro Alves'" <>,
> 	<>
> Date: Tue, 26 Jun 2012 09:13:14 +0800
> I noticed a cross-built MINGW arm-none-eabi GDB will get hang on Windows
> when use pipe to get stderr and stdout from stub. The command used to start
> stub in GDB is "target extended-remote |
> stub-that-write-stderr-before-stdout". For my case, after send
> "$vFlashDone#ea" to stub, GDB get hang. The GDB source show that GDB will
> keep waiting for ACK message from stdout of stub, after send the packet.
> Unfortunately my stub will write some kind of log information into stderr
> and this action takes place before stub write ACK message to its stdout. So
> the only pipe is occupied by stderr which is waiting for GDB to consume,
> while GDB keep waiting for message from the stdout which hasn't pipe to use.
> We finally end up with a deadlock on pipe between GDB/stderr/stdout.
> The following patch can avoid such deadlock by letting GDB also probe and
> consume stderr when waiting for stdout. Please review and comment.

I only read it superficially, but it looked fine to me.


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