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

Improve exception handling for bad any cast #207

Closed
wants to merge 1 commit into from

Conversation

ankane
Copy link
Contributor

@ankane ankane commented Oct 7, 2024

Hi, currently bad any cast causes the Ruby program to crash, which isn't ideal for end users.

libc++abi: terminating due to uncaught exception of type std::bad_any_cast: bad any cast
SignalException: SIGABRT (SignalException)

This PR changes it to raise an exception (with some context) instead.

RuntimeError: Bad any cast for DataSketches::HllUnion update

I'm seeing this error across a number of projects, but still trying to figure out the cause. From the error, it seems like NativeRegistry may be getting corrupted, or the function is never properly registered to begin with (as it either happens never or every time for the lifetime of the program).

@ankane
Copy link
Contributor Author

ankane commented Oct 7, 2024

It looks like the bad any cast errors are due to hash collisions in natives_, which aren't currently handled.

DataSketches::HllUnion update 256351383834
DataSketches::KllFloatsSketch max_value 256351383834

Edit: Looks like the issue was introduced in 819515b

@ankane
Copy link
Contributor Author

ankane commented Oct 7, 2024

Closing in favor of #208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant