Skip to content

Commit

Permalink
I think this will do it
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerkaraszewski committed Aug 5, 2024
1 parent 4ea3a72 commit 25093aa
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/clustertest/testplugin/TestPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,11 @@ bool TestPluginCommand::peek(SQLite& db) {
} else if (SStartsWith(request.methodLine, "exceptioninpeek")) {
throw 1;
} else if (SStartsWith(request.methodLine, "generatesegfaultpeek")) {
SINFO("TYLER SEGFAULT HERE");
int total = 0;
for (int i = 0; i < 1000000; i++) {
total += __pointerToFakeIntArray[i];
}
response["invalid"] = to_string(total);
SINFO("TYLER SEGFAULT HERE (FAILED)");
} else if (SStartsWith(request.methodLine, "generateassertpeek")) {
SASSERT(0);
response["invalid"] = "nope";
Expand Down Expand Up @@ -487,13 +485,11 @@ void TestPluginCommand::process(SQLite& db) {
} else if (SStartsWith(request.methodLine, "exceptioninprocess")) {
throw 2;
} else if (SStartsWith(request.methodLine, "generatesegfaultprocess")) {
int whatever = 0;
int* whateverPtr = &whatever;
// Bitwise OR the next 10 million addresses on the stack after our whatever number. This will surely segfault, right?
for (int i = 0; i < 10'000'000;i++) {
whatever |= *(whateverPtr + i);
int total = 0;
for (int i = 0; i < 1000000; i++) {
total += __pointerToFakeIntArray[i];
}
response["invalid"] = to_string(whatever);
response["invalid"] = to_string(total);
} else if (SStartsWith(request.methodLine, "ineffectiveUpdate")) {
// This command does nothing on purpose so that we can run it in 10x mode and verify it replicates OK.
return;
Expand Down

0 comments on commit 25093aa

Please sign in to comment.