Skip to content

Instantly share code, notes, and snippets.

@rmstar
rmstar / async_end2end_test_thread_local
Created August 16, 2019 19:21
gRPC thread local issues on Mac OS/iOS
This file has been truncated, but you can view the full file.
# REPRO INSTRUCTIONS
# apply patch: https://github.com/grpc/grpc/pull/19978
$ # run: bazel test //test/cpp/end2end:asyn_end2end_test
D0815 18:27:17.528477000 4587709888 test_config.cc:384] test slowdown factor: sanitizer=1, fixture=1, poller=1, total=1
E0815 18:27:17.528943000 4587709888 tls_pthread.cc:53] pthread_key_create(0x10d)
E0815 18:27:17.528950000 4587709888 tls_pthread.cc:53] pthread_key_create(0x10e)
E0815 18:27:17.529259000 4587709888 tls_pthread.cc:53] pthread_key_create(0x10f)
@rmstar
rmstar / metadata_crash
Created July 11, 2019 00:23
Traces for assert in metadata.cc:225
D0710 17:20:31.019271000 4519134656 metadata.cc:147] ELM NEW:0x6000002902c0:1: ':path' = '/grpc.testing.TestService/EmptyCall'
D0710 17:20:31.019335000 4519134656 metadata.cc:147] ELM NEW:0x600000288370:1: ':path' = '/grpc.testing.TestService/UnaryCall'
D0710 17:20:31.019404000 4519134656 metadata.cc:147] ELM NEW:0x60000029c4d0:1: ':path' = '/grpc.testing.TestService/StreamingOutputCall'
D0710 17:20:31.019468000 4519134656 metadata.cc:147] ELM NEW:0x6000002884d0:1: ':path' = '/grpc.testing.TestService/StreamingInputCall'
D0710 17:20:31.019525000 4519134656 metadata.cc:147] ELM NEW:0x600000298580:1: ':path' = '/grpc.testing.TestService/FullDuplexCall'
D0710 17:20:31.019569000 4519134656 metadata.cc:147] ELM NEW:0x600000288580:1: ':path' = '/grpc.testing.TestService/HalfDuplexCall'
D0710 17:20:31.019637000 4519134656 channel.cc:432] ELM REF:0x600000288370:1->2: ':path' = '
@rmstar
rmstar / repro_18942
Created May 21, 2019 23:00
repro #18942
D0521 14:24:17.361041000 140735940719488 test_config.cc:385] test slowdown factor: sanitizer=1, fixture=1, poller=1, total=1
Note: Google Test filter = CFStreamTest/CFStreamTest.NetworkFlapRpcsInFlight/7
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from CFStreamTest/CFStreamTest
[ RUN ] CFStreamTest/CFStreamTest.NetworkFlapRpcsInFlight/7
D0521 14:24:17.362759000 140735940719488 ev_posix.cc:169] Using polling engine: poll
D0521 14:24:17.363485000 140735940719488 dns_resolver_ares.cc:452] Using ares dns resolver
D0521 14:24:17.364073000 140735940719488 cfstream_test.cc:105] Bringing network up
E0521 14:24:17.404333000 140735940719488 cfstream_test.cc:80] cmd: echo '10.0.0.1 grpctest ' | sudo tee -a /etc/hosts
@rmstar
rmstar / repro_18885.txt
Created May 20, 2019 20:40
repro_18885_2
D0520 12:29:05.770131000 140736133178240 test_config.cc:385] test slowdown factor: sanitizer=1, fixture=1, poller=1, total=1
Note: Google Test filter = CFStreamTest/CFStreamTest.NetworkFlapRpcsInFlight/7
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from CFStreamTest/CFStreamTest
[ RUN ] CFStreamTest/CFStreamTest.NetworkFlapRpcsInFlight/7
D0520 12:29:05.771229000 140736133178240 ev_posix.cc:169] Using polling engine: poll
D0520 12:29:05.771694000 140736133178240 dns_resolver_ares.cc:479] Using ares dns resolver
D0520 12:29:05.772065000 140736133178240 cfstream_test.cc:103] Bringing network up
10.0.0.1 grpctest
@rmstar
rmstar / repro_18885
Created May 17, 2019 22:20
Reproduction of #18885 with http traces enabled
D0517 15:15:49.656504000 140736133178240 test_config.cc:385] test slowdown factor: sanitizer=1, fixture=1, poller=1, total=1
Note: Google Test filter = CFStreamTest/CFStreamTest.NetworkFlapRpcsInFlight/7
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from CFStreamTest/CFStreamTest
[ RUN ] CFStreamTest/CFStreamTest.NetworkFlapRpcsInFlight/7
D0517 15:15:49.657730000 140736133178240 ev_posix.cc:169] Using polling engine: poll
D0517 15:15:49.658232000 140736133178240 dns_resolver_ares.cc:479] Using ares dns resolver
D0517 15:15:49.658655000 140736133178240 cfstream_test.cc:103] Bringing network up
10.0.0.1 grpctest
@rmstar
rmstar / unique_ptr_vec.cc
Created August 29, 2015 05:37
vector of unique_ptr
#include <vector>
#include <memory>
#include <iostream>
int main()
{
std::vector<std::unique_ptr<int>> v;
v.push_back(std::make_unique<int>(3));
v.push_back(std::make_unique<int>(4));
v.push_back(std::make_unique<int>(5));
@rmstar
rmstar / unary_plus.cc
Last active August 25, 2015 22:02
uses of unary plus operator
#include <iostream>
struct foo
{
static const int var1;
static const int var2 = 4;
};
const int foo::var1 = 3;
template <typename T>
@rmstar
rmstar / pure_virtual_destructor.cc
Created August 17, 2015 17:51
pure virtual destructor
struct A {
virtual ~A() = 0;
};
// destructor must have an implementation in order to instantiate derived class
// NOTE: pure virtual -> derived class must override. having an implementation
// is orthogonal.
// http://stackoverflow.com/questions/1219607/why-do-we-need-a-pure-virtual-destructor-in-c
A::~A()
{
@rmstar
rmstar / pb_design.cc
Created August 16, 2015 19:39
policy-based design
#include <iostream>
template <typename T>
struct Animal: T // private inheritance
{
void speak()
{
// doesn't compile, need to use this->say or T::say
//say();
this->say();
@rmstar
rmstar / set_ops.cc
Created July 28, 2015 02:10
set union, intersection, difference, search_n, binary_search
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
void print_vector(const std::string &tag, const std::vector<int> &v)
{
std::cout << tag << ": ";
for (auto &e: v) {
std::cout << e << " ";