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

'Bus error' when test doesn't pass #259

Open
yurivict opened this issue Nov 7, 2020 · 1 comment
Open

'Bus error' when test doesn't pass #259

yurivict opened this issue Nov 7, 2020 · 1 comment

Comments

@yurivict
Copy link

yurivict commented Nov 7, 2020

I replaced the example:

              std::reverse(begin(l1), end(l1));
              std::reverse(begin(l1), end(l1));
              RC_ASSERT(l0 == l1);

with

              std::reverse(begin(l1), end(l1));
              std::reverse(begin(l1), end(l1));
              if (l1.size() >= 2)
                l1[1] = 2;
              RC_ASSERT(l0 == l1);

After this running it many times looks like this:

$ ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out ; ./a.out 
Using configuration: seed=3420795165117013011

- double reversal yields the original value
Bus error
Using configuration: seed=14684516960598901972

- double reversal yields the original value
Bus error
Using configuration: seed=15202572642935427351

- double reversal yields the original value
Bus error
Using configuration: seed=17945400595239408832

- double reversal yields the original value
Bus error
Using configuration: seed=6165691666768869258

- double reversal yields the original value
Bus error
Using configuration: seed=10672790074681973720

- double reversal yields the original value
Bus error
Using configuration: seed=2121517870367621541

- double reversal yields the original value
Bus error7bc7d30
Using configuration: seed=7785047867429658057

- double reversal yields the original value
Bus error
Using configuration: seed=6591167973284169841

- double reversal yields the original value
Bus error
Using configuration: seed=18126788677756282608

- double reversal yields the original value
Bus error
Using configuration: seed=13259295632729924319

- double reversal yields the original value
Bus error
Using configuration: seed=694945028765923653

- double reversal yields the original value
Bus error
Using configuration: seed=8444319495471288925

- double reversal yields the original value
Bus error
Using configuration: seed=17043435700674168975

- double reversal yields the original value
Bus error

Please also note that it probably didn't try the cases of array sizes 0 and 1, because every try crashed, even though sizes 0 and 1 should pass.

Rev. 7bc7d30
OS: FreeBSD 12.2

@asterkrans
Copy link

asterkrans commented Dec 14, 2020

This is what is expected if you are trying to modify eg a const vector or a string literal.

Are you modifying the example in the readme? That one is using a const vector.

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