Merge pull request #8684 from jzhou77/fix

Fix ASan failure heap use after free in status json generation
This commit is contained in:
Jingyu Zhou 2022-11-03 18:48:26 -07:00 committed by GitHub
commit ec471aa63c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -11,6 +11,7 @@ Release Notes
* Released with AVX disabled. * Released with AVX disabled.
* Fixed a transaction log data corruption bug. `(PR #8525) <https://github.com/apple/foundationdb/pull/8525>`_, `(PR #8562) <https://github.com/apple/foundationdb/pull/8562>`_, and `(PR #8647) <https://github.com/apple/foundationdb/pull/8647>`_ * Fixed a transaction log data corruption bug. `(PR #8525) <https://github.com/apple/foundationdb/pull/8525>`_, `(PR #8562) <https://github.com/apple/foundationdb/pull/8562>`_, and `(PR #8647) <https://github.com/apple/foundationdb/pull/8647>`_
* Fixed a rare data race in transaction logs when PEEK_BATCHING_EMPTY_MSG is enabled. `(PR #8660) <https://github.com/apple/foundationdb/pull/8660>`_ * Fixed a rare data race in transaction logs when PEEK_BATCHING_EMPTY_MSG is enabled. `(PR #8660) <https://github.com/apple/foundationdb/pull/8660>`_
* Fixed a heap-use-after-free bug in cluster controller. `(PR #8683) <https://github.com/apple/foundationdb/pull/8683>`_
* Changed consistency check to report all corruptions. `(PR #8571) <https://github.com/apple/foundationdb/pull/8571>`_ * Changed consistency check to report all corruptions. `(PR #8571) <https://github.com/apple/foundationdb/pull/8571>`_
* Fixed a rare storage server crashing bug after recovery. `(PR #8468) <https://github.com/apple/foundationdb/pull/8468>`_ * Fixed a rare storage server crashing bug after recovery. `(PR #8468) <https://github.com/apple/foundationdb/pull/8468>`_
* Added client knob UNLINKONLOAD_FDBCLIB to control deletion of external client libraries. `(PR #8434) <https://github.com/apple/foundationdb/pull/8434>`_ * Added client knob UNLINKONLOAD_FDBCLIB to control deletion of external client libraries. `(PR #8434) <https://github.com/apple/foundationdb/pull/8434>`_

View File

@ -781,6 +781,9 @@ ACTOR static Future<JsonBuilderObject> processStatusFetcher(
// Map the address of the worker to the error message object // Map the address of the worker to the error message object
tracefileOpenErrorMap[traceFileErrorsItr->first.toString()] = msgObj; tracefileOpenErrorMap[traceFileErrorsItr->first.toString()] = msgObj;
} catch (Error& e) { } catch (Error& e) {
if (e.code() == error_code_actor_cancelled) {
throw;
}
incomplete_reasons->insert("file_open_error details could not be retrieved"); incomplete_reasons->insert("file_open_error details could not be retrieved");
} }
} }
@ -1095,6 +1098,9 @@ ACTOR static Future<JsonBuilderObject> processStatusFetcher(
} }
} catch (Error& e) { } catch (Error& e) {
if (e.code() == error_code_actor_cancelled) {
throw;
}
// Something strange occurred, process list is incomplete but what was built so far, if anything, will be // Something strange occurred, process list is incomplete but what was built so far, if anything, will be
// returned. // returned.
incomplete_reasons->insert("Cannot retrieve all process status information."); incomplete_reasons->insert("Cannot retrieve all process status information.");
@ -1410,6 +1416,9 @@ ACTOR static Future<JsonBuilderObject> latencyProbeFetcher(Database cx,
wait(waitForAll(probes)); wait(waitForAll(probes));
} catch (Error& e) { } catch (Error& e) {
if (e.code() == error_code_actor_cancelled) {
throw;
}
incomplete_reasons->insert(format("Unable to retrieve latency probe information (%s).", e.what())); incomplete_reasons->insert(format("Unable to retrieve latency probe information (%s).", e.what()));
} }
@ -1449,6 +1458,9 @@ ACTOR static Future<Void> consistencyCheckStatusFetcher(Database cx,
} }
} }
} catch (Error& e) { } catch (Error& e) {
if (e.code() == error_code_actor_cancelled) {
throw;
}
incomplete_reasons->insert(format("Unable to retrieve consistency check settings (%s).", e.what())); incomplete_reasons->insert(format("Unable to retrieve consistency check settings (%s).", e.what()));
} }
return Void(); return Void();
@ -1540,6 +1552,9 @@ ACTOR static Future<Void> logRangeWarningFetcher(Database cx,
} }
} }
} catch (Error& e) { } catch (Error& e) {
if (e.code() == error_code_actor_cancelled) {
throw;
}
incomplete_reasons->insert(format("Unable to retrieve log ranges (%s).", e.what())); incomplete_reasons->insert(format("Unable to retrieve log ranges (%s).", e.what()));
} }
return Void(); return Void();
@ -1713,7 +1728,10 @@ static JsonBuilderObject configurationFetcher(Optional<DatabaseConfiguration> co
} }
int count = coordinators.clientLeaderServers.size(); int count = coordinators.clientLeaderServers.size();
statusObj["coordinators_count"] = count; statusObj["coordinators_count"] = count;
} catch (Error&) { } catch (Error& e) {
if (e.code() == error_code_actor_cancelled) {
throw;
}
incomplete_reasons->insert("Could not retrieve all configuration status information."); incomplete_reasons->insert("Could not retrieve all configuration status information.");
} }
return statusObj; return statusObj;
@ -2735,6 +2753,9 @@ ACTOR Future<JsonBuilderObject> layerStatusFetcher(Database cx,
} }
} catch (Error& e) { } catch (Error& e) {
TraceEvent(SevWarn, "LayerStatusError").error(e); TraceEvent(SevWarn, "LayerStatusError").error(e);
if (e.code() == error_code_actor_cancelled) {
throw;
}
incomplete_reasons->insert(format("Unable to retrieve layer status (%s).", e.what())); incomplete_reasons->insert(format("Unable to retrieve layer status (%s).", e.what()));
json.create("_error") = format("Unable to retrieve layer status (%s).", e.what()); json.create("_error") = format("Unable to retrieve layer status (%s).", e.what());
json.create("_valid") = false; json.create("_valid") = false;