Skip to content

Commit

Permalink
(XXX) Malloc vector (to trigger SIGSEGV)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
  • Loading branch information
alexeykudinkin committed Mar 7, 2024
1 parent aa3eb08 commit 3d8b154
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/ray/core_worker/transport/direct_actor_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,22 @@ void CoreWorkerDirectTaskReceiver::HandleTask(

std::vector<std::pair<ObjectID, std::shared_ptr<RayObject>>> return_objects;
std::vector<std::pair<ObjectID, std::shared_ptr<RayObject>>> dynamic_return_objects;
std::vector<std::pair<ObjectID, bool>> streaming_generator_returns;

std::vector<std::pair<ObjectID, bool>> *streaming_generator_returns = new std::vector<std::pair<ObjectID, bool>>();

bool is_retryable_error = false;
std::string application_error = "";
auto status = task_handler_(task_spec,
resource_ids,
&return_objects,
&dynamic_return_objects,
&streaming_generator_returns,
streaming_generator_returns,
reply->mutable_borrowed_refs(),
&is_retryable_error,
&application_error);

std::cout << ">>> [CoreWorkerDirectTaskReceiver::HandleTask[accept_callback]] Left task handler: " << task_spec.DebugString() << std::endl;

reply->set_is_retryable_error(is_retryable_error);
reply->set_is_application_error(!application_error.empty());
if (!status.ok()) {
Expand All @@ -118,7 +123,7 @@ void CoreWorkerDirectTaskReceiver::HandleTask(
reply->set_task_execution_error(application_error);
}

for (const auto &it : streaming_generator_returns) {
for (const auto &it : *streaming_generator_returns) {
const auto &object_id = it.first;
bool is_plasma_object = it.second;
auto return_id_proto = reply->add_streaming_generator_return_ids();
Expand Down Expand Up @@ -205,6 +210,10 @@ void CoreWorkerDirectTaskReceiver::HandleTask(
RAY_CHECK(objects_valid);
send_reply_callback(status, nullptr, nullptr);
}

delete streaming_generator_returns;

std::cout << ">>> [CoreWorkerDirectTaskReceiver::HandleTask[accept_callback]] Completed" << std::endl;
};

auto cancel_callback = [reply, task_spec](const Status &status,
Expand Down

0 comments on commit 3d8b154

Please sign in to comment.