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

blosc_getitem return value seems inconsistent (DeepState fuzzing) #93

Open
agroce opened this issue Dec 4, 2019 · 2 comments
Open

blosc_getitem return value seems inconsistent (DeepState fuzzing) #93

agroce opened this issue Dec 4, 2019 · 2 comments

Comments

@agroce
Copy link

agroce commented Dec 4, 2019

Whether I assert that it is the #bytes of the #items, some tests seem to violate the claim. Is this known/expected?

	      unsigned start_item = DeepState_UIntInRange(0, num_elements-1);
	      unsigned num_items = DeepState_UIntInRange(0, num_elements-start_item);
	      LOG(TRACE) << "Getting " << num_items << " from " << start_item;
	      int get_result = blosc_getitem(intermediate, start_item, num_items, items);
	      //ASSERT_EQ(get_result, num_items * type_size) <<
	      //"Getting " << num_items << " from " << start_item << " expected: " << num_items * type_size << ": got " << get_result;

If I allow either:

             ASSERT((get_result == num_items) || (get_result == (num_items * type_size))) <<
                "Getting " << num_items << " from " << start_item << " with size " << type_size << ": got " << get_result;

it never fails, but that's not a consistent API. I can minimize a failing example, if you can clarify which is the expected return value.

@agroce
Copy link
Author

agroce commented Dec 4, 2019

Looks like this is also due to type_size limit being 255; maybe should fail if parameter is too big?

@FrancescAlted
Copy link
Member

Ditto in #92. But I see your point, by silently reducing typesize to 1 we are creating inconsistencies in the API. Hmm, probably failing would be better than just documenting this; I need to think a bit more on this. Anyway, thanks for bringing this to our attention.

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

No branches or pull requests

2 participants