Merge branch 'fuzz-it' into error

pull/6897/head
Craig Tiller 9 years ago
commit 5abe38bbe8
  1. 74
      test/core/end2end/fuzzers/api_fuzzer.c
  2. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/001ea98069c10f808c281da9bbdd84cc05c3bad1
  3. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/01f52e31dfffdab89d83acd39925c3dd81baa76f
  4. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/02c3cf8d52fbc43f89b5f516a17cea23b68fc8d5
  5. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/032744b59cafd3320cc932ad39926a9bc92f589e
  6. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0385c7b41263419e25a4342fbfc44fbd65eb2ed5
  7. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/04d93c9df413717f71abd091592b5238afb799e8
  8. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/064d50aee4416ccf32f4e4fe7b770b7802265ffe
  9. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/066e7fcb68e83b432c414f63f6de73e5f5099e49
  10. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/06c714e289673cf982ce2ac0670707a15f2ac5ea
  11. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/071247b8fddda8aa520d9142c89039fbf8bf6cee
  12. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/07cb3b9baca1bbcce2e199e551073ba2fdd4e05c
  13. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/07fa2b6ed650d436f423adcccfcbe63ce6253de0
  14. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/081e3248dfca2b32837c4738daee3a4698caaf15
  15. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/088bf259e854abd9508d91b23983737f8e9e242c
  16. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0976de1461fb037c6987d77d088416440b524dde
  17. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0adaf5f559e1fb9cd8cd5b29911e13bca315c606
  18. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0af5adf68560b3a7036ad23af62e4f9749eca690
  19. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0becc6ede499ddc452fd4e6c3c0413a1107a8373
  20. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0c531e03e56a5cf48bdd531a8c11a19e4a3b0aeb
  21. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0c65733bc09e8527347e20f5c876c5b64570d423
  22. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0c7b763d22885462527123656fa17af7520fc55d
  23. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0d604693a9d3e76f54d28a26142abd729b0a9acd
  24. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0d993b34021ec088f1aa3e5acdd98089b4104b07
  25. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0def53b5575cc6ab2fbbd17e2bc6a24de9656f84
  26. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0e2ddbe92c08eb9ad3cbee1d0db2264baaca12df
  27. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0ea509d249ae28faba8980aacb972c7ea28d3fd5
  28. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0f16eeeecdebcb59022bda5a0972d1b3429648fd
  29. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/0f81830560dbb9c6d3889b5d581b918c6cade65f
  30. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/105d9784648fe2d6c22fbefa69c9a26fff1c6481
  31. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/11153bfeee3cdede86a52151dbb939c3ffee48ed
  32. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/113c1d1bac15d550124f1ffb9012c32755adf27f
  33. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/11759723c597e6806f8873e5062d31516cdb97ea
  34. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/12abf5dcf2aba770f7b94ce5d96d7a8565a9aa19
  35. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/12b904b97ed234fa45073b4e346ebe3211558528
  36. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/12c00ed8945bdae03f03142cb964a47ea0c5786e
  37. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/12f977ee18a7499d18a503a47e71b4f241052640
  38. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/145acf7c03a0bc6c4a40d710ba5813b9f28efe2a
  39. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/14ccbe1d9d7302d642e51ede3d4d846e85310fc2
  40. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1586adc8c21b5796ba52203379faeb5f251f5c1d
  41. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1608a688768bdecdb205a455401ce5d9a1424a22
  42. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/162b4ec7cf39df091898e01057b2fa39605b34bb
  43. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/16858f1f9db0e248a15ce09d9848612de1f4bba6
  44. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/16e681f1867a1ac5612e1a88fddaed0bcb4521e7
  45. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/16ebac3f7cea2b46f660ec6a5ef3401c3e17a2e9
  46. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/17ec0503991dc248d2b188edfa3d28573a1c2154
  47. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/17fb35db0b73c331a66120dbc491300b2d1665e0
  48. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/190c4ca0cf29c99bc987d2792c7f62e1007c0245
  49. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1949f4a75f7d501d5279a01f58a444640379bd78
  50. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1972f535ae202777efdd15a09138efc37e07ac01
  51. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/198e691a9dabd23ed5c156f3a6e2c06a4379c15b
  52. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1a16a4b32cb0cb3a759ec20edf332cdfc5d1717e
  53. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1af0744fe0ccad11d6df023803ab699e1464c8da
  54. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1b6d8326532cea974655dc86657d8e3b9ba021de
  55. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1b78d906803b539ea9f135e41b58257365948855
  56. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1ba0190ef2cde93332f850753a05b89ae5f39f1f
  57. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1c24396c21f2c6aa2ad9b9a14877b7edf0ce61d2
  58. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1c86c4f2d173059e5cfe67b446fdfa285743f61f
  59. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1cbbae18babaa20229b42b4633ef812bd3b40ad4
  60. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1d259d9c908db8a0a7012c054bfde7f86474dab7
  61. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1d55650c5bc30ea68168a9287820e25d2d53ab4c
  62. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1d795268725d3a08883b05b021a437654aaed908
  63. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1d7bd5961f6963c65054fb9a24d913601f37bf3d
  64. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1eefda69c1787cc55a8bd43774ca13563e0972bc
  65. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1f4d0adab39a988792cca201626c28293e247226
  66. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/1f7847ed44c5acbc52c5d16b0222b44067076478
  67. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/200521ca3891bfed841ca8c22691196a1a03ccd3
  68. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/205dd562c7202d4231b232a6804889e77eba5292
  69. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2193a1e20caee37676d08c88154a462acf120fb0
  70. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/21da45db854aeae9bef8576d6cb5859c0cf7a34c
  71. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/226b0315f87b08521c9a2d3e2b50c01ec421be14
  72. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/22c9ed2979d9963bce6500997f1e0433988e7e37
  73. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/247d0d09deeeb76422cd1d06305a63378a498656
  74. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/24fbdfa73f26686633871ddad9698d7059db488f
  75. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2535940afe69b3106b7696a486a2617d0d9a7150
  76. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/25aa74daea95f9fc46a78239bd2e78ccf0fb3ffc
  77. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/26930c35fbe83e4d165b8b7f218ac8ea231c87dd
  78. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/26dfa46c2bb2e6af6f52bac6f03a9e4406c6e700
  79. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/27a8643ba6047e12de1b2a4f7d0994a2c095a6d5
  80. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/27f5e317e8a3a1098e786b96175c15d0855c4855
  81. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/285b0b9b11fe506527c880d3a866ba94f8038cdf
  82. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/28851da472cd09123465241e0d59697f563f53a8
  83. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/28c56acb0f9b47ead49f34c0d92a661fa04952c2
  84. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2923d9c864597016358f37ce4014c61648b7290a
  85. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/29a6d7ab3e7ea8d331358df45e5b0926e768e227
  86. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2a410e3d783bc93e63206e28f92b6a40e1db09cf
  87. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2b80854b52267dd70b622670e401280387f15dd2
  88. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2d5613b7bc0f5060eb1fa0449face6a9c503b589
  89. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2d7f42d3df4a206d09a9fa3126333a61f5e678ec
  90. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2d82b2376d689485814ade91df8f65ee08395a02
  91. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2df65610f1c24ad1cf9a5b22614434c96ffc12fb
  92. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2e48a9c8d204975060e81f37c7a46ab501750067
  93. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2e7441eacf8fcc7043f24b3beba4fcbe3c0c5ea0
  94. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2ef149e8fd68e06fcb7ba2fb43a17cc1dcfd989b
  95. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2f35914500b09477fe245bc130f86bbd15112ce7
  96. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/2fece42b158854855dd42eac3fc7b8f1eb61fb04
  97. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/3017e9f66dacf5a01f8c7d65b8a72d4f68aa6a28
  98. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/30948ba77c2e56903a9ad5190cc74e59d42f67fe
  99. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/30d6ca02d96fe1d1b91b7fa5180789a6cc9d0d45
  100. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/30fc581d975cd8384b86be0ae59792a605ca68c6
  101. Some files were not shown because too many files have changed in this diff Show More

@ -345,6 +345,8 @@ static void free_non_null(void *p) {
typedef enum { ROOT, CLIENT, SERVER, PENDING_SERVER } call_state_type;
#define DONE_FLAG_CALL_CLOSED ((uint64_t)(1 << 0))
typedef struct call_state {
call_state_type type;
grpc_call *call;
@ -357,6 +359,10 @@ typedef struct call_state {
int cancelled;
int pending_ops;
grpc_call_details call_details;
grpc_byte_buffer *send_message;
// starts at 0, individual flags from DONE_FLAG_xxx are set
// as different operations are completed
uint64_t done_flags;
// array of pointers to free later
size_t num_to_free;
@ -454,10 +460,41 @@ static void finished_request_call(void *csp, bool success) {
}
}
static void finished_batch(void *csp, bool success) {
call_state *cs = csp;
--cs->pending_ops;
maybe_delete_call_state(cs);
typedef struct {
call_state *cs;
uint8_t has_ops;
} batch_info;
static void finished_batch(void *p, bool success) {
batch_info *bi = p;
--bi->cs->pending_ops;
if ((bi->has_ops & (1u << GRPC_OP_RECV_MESSAGE)) &&
(bi->cs->done_flags & DONE_FLAG_CALL_CLOSED)) {
GPR_ASSERT(bi->cs->recv_message == NULL);
}
if ((bi->has_ops & (1u << GRPC_OP_RECV_MESSAGE) &&
bi->cs->recv_message != NULL)) {
grpc_byte_buffer_destroy(bi->cs->recv_message);
bi->cs->recv_message = NULL;
}
if ((bi->has_ops & (1u << GRPC_OP_SEND_MESSAGE))) {
grpc_byte_buffer_destroy(bi->cs->send_message);
bi->cs->send_message = NULL;
}
if ((bi->has_ops & (1u << GRPC_OP_RECV_STATUS_ON_CLIENT)) ||
(bi->has_ops & (1u << GRPC_OP_RECV_CLOSE_ON_SERVER))) {
bi->cs->done_flags |= DONE_FLAG_CALL_CLOSED;
}
maybe_delete_call_state(bi->cs);
gpr_free(bi);
}
static validator *make_finished_batch_validator(call_state *cs,
uint8_t has_ops) {
batch_info *bi = gpr_malloc(sizeof(*bi));
bi->cs = cs;
bi->has_ops = has_ops;
return create_validator(finished_batch, bi);
}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
@ -584,6 +621,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
} else {
end(&inp);
}
break;
}
// begin server shutdown
case 5: {
@ -705,6 +743,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
bool ok = true;
size_t i;
grpc_op *op;
uint8_t has_ops = 0;
for (i = 0; i < num_ops; i++) {
op = &ops[i];
switch (next_byte(&inp)) {
@ -715,19 +754,28 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
break;
case GRPC_OP_SEND_INITIAL_METADATA:
op->op = GRPC_OP_SEND_INITIAL_METADATA;
has_ops |= 1 << GRPC_OP_SEND_INITIAL_METADATA;
read_metadata(&inp, &op->data.send_initial_metadata.count,
&op->data.send_initial_metadata.metadata,
g_active_call);
break;
case GRPC_OP_SEND_MESSAGE:
op->op = GRPC_OP_SEND_MESSAGE;
op->data.send_message = read_message(&inp);
if (g_active_call->send_message != NULL) {
ok = false;
} else {
has_ops |= 1 << GRPC_OP_SEND_MESSAGE;
g_active_call->send_message = op->data.send_message =
read_message(&inp);
}
break;
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
has_ops |= 1 << GRPC_OP_SEND_CLOSE_FROM_CLIENT;
break;
case GRPC_OP_SEND_STATUS_FROM_SERVER:
op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
has_ops |= 1 << GRPC_OP_SEND_STATUS_FROM_SERVER;
read_metadata(
&inp,
&op->data.send_status_from_server.trailing_metadata_count,
@ -739,11 +787,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
break;
case GRPC_OP_RECV_INITIAL_METADATA:
op->op = GRPC_OP_RECV_INITIAL_METADATA;
has_ops |= 1 << GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata =
&g_active_call->recv_initial_metadata;
break;
case GRPC_OP_RECV_MESSAGE:
op->op = GRPC_OP_RECV_MESSAGE;
has_ops |= 1 << GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &g_active_call->recv_message;
break;
case GRPC_OP_RECV_STATUS_ON_CLIENT:
@ -758,6 +808,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
break;
case GRPC_OP_RECV_CLOSE_ON_SERVER:
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
has_ops |= 1 << GRPC_OP_RECV_CLOSE_ON_SERVER;
op->data.recv_close_on_server.cancelled =
&g_active_call->cancelled;
break;
@ -766,7 +817,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
op->flags = read_uint32(&inp);
}
if (ok) {
validator *v = create_validator(finished_batch, g_active_call);
validator *v = make_finished_batch_validator(g_active_call, has_ops);
g_active_call->pending_ops++;
grpc_call_error error =
grpc_call_start_batch(g_active_call->call, ops, num_ops, v, NULL);
@ -777,17 +828,18 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
} else {
end(&inp);
}
if (!ok && (has_ops & (1 << GRPC_OP_SEND_MESSAGE))) {
grpc_byte_buffer_destroy(g_active_call->send_message);
g_active_call->send_message = NULL;
}
for (i = 0; i < num_ops; i++) {
op = &ops[i];
switch (op->op) {
case GRPC_OP_SEND_INITIAL_METADATA:
break;
case GRPC_OP_SEND_MESSAGE:
grpc_byte_buffer_destroy(op->data.send_message);
break;
case GRPC_OP_SEND_STATUS_FROM_SERVER:
gpr_free((void *)op->data.send_status_from_server.status_details);
break;
case GRPC_OP_SEND_MESSAGE:
case GRPC_OP_SEND_INITIAL_METADATA:
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
case GRPC_OP_RECV_INITIAL_METADATA:
case GRPC_OP_RECV_MESSAGE:

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save