Repository navigation
Spike2RawIO: compute block positions in 64 bits for version 9 files over 2 GiB - #1947
Open
h-mayorquin wants to merge 2 commits into
Open
h-mayorquin wants to merge 2 commits into
h-mayorquin wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While reviewing #1944 I noticed that
Spike2RawIOmultiplies theint32block numbersfirstblockandsucc_blockby 512 and keeps the result in anint32field. Version 9 files store disk offsets as 512-byte block numbers so they can grow to 1 TB (CED'sSonintl.h, the header #1944 cites):https://github.com/ebtrexler/NETrex/blob/d864e988120afe94457073297eb89528434a2abf/legacy/SON/Sonintl.h#L66-L79
So for a block past 2 GiB
parse_header()throws anOSErrorwith NumPy 2, and with NumPy 1.26 the signal is read from the wrong place without any error. This PR casts both block numbers withint()before multiplying and storesposasint64. This is one more of the many NumPy integer overflows we have run into (#1642, #1669 and #1690 in Blackrock, and #1929 for.nevfiles over 4 GiB).