We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If an update causes a memmapped block to be moved, any views taken of the array that uses the block will point to invalid data.
update
Running the following example code (that adds a large amount of text to the tree to cause the memmapped blocks to be moved):
import asdf import numpy fn = 'test.asdf' a = numpy.zeros(10, dtype='uint8') b = numpy.ones(10, dtype='uint8') af = asdf.AsdfFile({'a': a, 'b': b}) af.write_to(fn) with asdf.open(fn, mode='rw') as af: va = af['a'][:3] print(f"A: {af['a'][:]}") print(f"b: {af['b'][:]}") print(f"va: {va}") af['c'] = 'a' * 10000 af.update() print(f"A: {af['a'][:]}") print(f"b: {af['b'][:]}") print(f"va: {va}")
Produces the following output which shows that the view of 'a', here 'va', is incorrect following the update.
A: [0 0 0 0 0 0 0 0 0 0] b: [1 1 1 1 1 1 1 1 1 1] va: [0 0 0] A: [0 0 0 0 0 0 0 0 0 0] b: [1 1 1 1 1 1 1 1 1 1] va: [97 97 97]
The text was updated successfully, but these errors were encountered:
Removal of the source array results in a segfault when the view is accessed.
import asdf import numpy fn = 'test.asdf' a = numpy.zeros(10, dtype='uint8') b = numpy.ones(10, dtype='uint8') af = asdf.AsdfFile({'a': a, 'b': b}) af.write_to(fn) with asdf.open(fn, mode='rw') as af: va = af['a'][:3] print(f"A: {af['a'][:]}") print(f"b: {af['b'][:]}") print(f"va: {va}") af['c'] = 'a' * 10000 del af.tree['a'] del af.tree['b'] af.update() print(f"va: {va}")
results in
A: [0 0 0 0 0 0 0 0 0 0] b: [1 1 1 1 1 1 1 1 1 1] va: [0 0 0] Segmentation fault: 11
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
If an
update
causes a memmapped block to be moved, any views taken of the array that uses the block will point to invalid data.Running the following example code (that adds a large amount of text to the tree to cause the memmapped blocks to be moved):
Produces the following output which shows that the view of 'a', here 'va', is incorrect following the update.
The text was updated successfully, but these errors were encountered: