I have a simple C++ grpc client that talks to a grpc echo server written in 
Go via a bidir stream. The messages that are sent back and forth are binary 
blobs around 200 bytes in size.

On the C++ client side, I have a reader thread and a writer thread. The 
reader sits in a loop and calls a blocking Read() on the stream from the 
server and consumes messages; the writer waits for some data to arrive from 
an external source and writes it to the stream before waiting for some more 
data to arrive. The channel and stream are immutable and created before the 
two threads are created. The only concurrent calls into the grpc runtime 
are the calls to Read() and Write() on the stream. I'm not calling Read() 
concurrently with another Read(), or Write() concurrently with another 
Write(). At any one time, there is at most one blocking Read() and one 
blocking Write() call in progress, each made from the same single reader or 
writer thread each time.

All this works fine. I can move around 51 k messages per second, and 
exchange millions of messages without any issue. The whole process is 
basically in steady state. No connection is lost or the like, the channel 
and stream are never re-initialized, etc. Everything stable and perfect.

Then, after 15 or 20 minutes of this, I get the assertion failure below. I 
am certain that this isn't something stupid, such as memory corruption or 
the like. The code runs clean with address sanitizer and doesn't leak.
All this is with grpc and my own code compiled with gcc-7.3.0 on Ubuntu 
16.04.

I have two questions:

1) Does the stack trace below ring any bells? All other threads are where I 
would expect them to be, such as in a poll waiting for data to arrive and 
similar.

2) I compiled grpc and my own code with thread-sanitizer. When I run the 
code, tsan reports a bunch of race conditions. Are these possibly related 
to the crash?

Thanks,

Michi.

Stack trace: https://www.dropbox.com/s/n2494rjnhj0hq56/stack-trace.txt?dl=0

Tsan output: https://www.dropbox.com/s/7fkxdu3rmcji6eo/tsan.txt?dl=0

-- 
*CONFIDENTIALITY NOTICE:* The information contained in this message may be 
privileged and/or confidential. It is the property of CrowdStrike.  If you 
are not the intended recipient, or responsible for delivering this message 
to the intended recipient, any review, forwarding, dissemination, 
distribution or copying of this communication or any attachment(s) is 
strictly prohibited. If you have received this message in error, please 
notify the sender immediately, and delete it and all attachments from your 
computer and network.

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/409e2ea1-b1e5-4883-a5ae-81cc9ef83dad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to