Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert Update Crash to Desktop #44

Closed
dpaulat opened this issue May 11, 2023 · 1 comment
Closed

Alert Update Crash to Desktop #44

dpaulat opened this issue May 11, 2023 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dpaulat
Copy link
Owner

dpaulat commented May 11, 2023

I've experienced a rare (usually no more frequent than once per 24 hours of runtime) crash to desktop with handling of alert updates.

std::chrono::system_clock::time_point
AlertModelImpl::GetEndTime(const types::TextEventKey& key)
{
auto messageList = manager::TextEventManager::Instance()->message_list(key);
auto& lastMessage = messageList.back();
size_t segmentCount = lastMessage->segment_count();
auto lastSegment = lastMessage->segment(segmentCount - 1);
return lastSegment->header_->vtecString_[0].pVtec_.event_end();
}

When line 415 above is executed, the application may crash if the message list for a key is empty. There should be two fixes:

  1. Handle the case if the message list is empty, and return a default value. This will prevent the crash, but still may result in erroneous behavior.
  2. Determine why message list is empty. This should never happen for a non-default/valid key.
@dpaulat dpaulat added the bug Something isn't working label May 11, 2023
@dpaulat dpaulat self-assigned this May 11, 2023
dpaulat added a commit that referenced this issue May 12, 2023
Partial fix for #44, application should no longer crash, but erroneous behavior may remain
dpaulat added a commit that referenced this issue May 12, 2023
Partial fix for #44, application should no longer crash, but erroneous behavior may remain
@dpaulat
Copy link
Owner Author

dpaulat commented Jul 21, 2023

This has not arisen since the original mitigation. Closing, as this no longer appears to be an issue.

@dpaulat dpaulat closed this as completed Jul 21, 2023
@dpaulat dpaulat added this to the v0.1.2 milestone Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

1 participant