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

Might lead to MemoryError on i386 #1307

Open
yarikoptic opened this issue Mar 15, 2024 · 3 comments
Open

Might lead to MemoryError on i386 #1307

yarikoptic opened this issue Mar 15, 2024 · 3 comments
Labels

Comments

@yarikoptic
Copy link
Member

Just making a record of an instance of a test fail we got reported against heudiconv while building debian package on good old i386 architecture:

https://salsa.debian.org/med-team/heudiconv/-/jobs/5439470

heudiconv/cli/run.py:30: in main
    workflow(**kwargs)
heudiconv/main.py:410: in workflow
    study_sessions = get_study_sessions(
heudiconv/parser.py:221: in get_study_sessions
    seqinfo_dict = group_dicoms_into_seqinfos(
heudiconv/dicoms.py:324: in group_dicoms_into_seqinfos
    mwinfo = validate_dicom(filename, dcmfilter)
heudiconv/dicoms.py:157: in validate_dicom
    mw = dw.wrapper_from_file(fl, force=True, stop_before_pixels=True)
/usr/lib/python3/dist-packages/nibabel/nicom/dicomwrappers.py:58: in wrapper_from_file
    dcm_data = pydicom.dcmread(fobj, *args, **kwargs)
/usr/lib/python3/dist-packages/pydicom/filereader.py:1030: in dcmread
    dataset = read_partial(
/usr/lib/python3/dist-packages/pydicom/filereader.py:852: in read_partial
    dataset = read_dataset(
/usr/lib/python3/dist-packages/pydicom/filereader.py:427: in read_dataset
    raw_data_element = next(de_gen)
/usr/lib/python3/dist-packages/pydicom/filereader.py:207: in data_element_generator
    fp_read(length) if length > 0
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <nibabel.openers.ImageOpener object at 0xf1f76fd0>, size = 1768444706
    def read(self, size: int = -1, /) -> bytes:
>       return self.fobj.read(size)
E       MemoryError
/usr/lib/python3/dist-packages/nibabel/openers.py:223: MemoryError
@effigies
Copy link
Member

Looks like a pydicom error?

@yarikoptic
Copy link
Member Author

not assigning blame here ;) but indeed could be really triggered by pydicom - I guess worth debugging and see what length it figured wanting to read

@effigies
Copy link
Member

Looks like that's being unpacked from the first 8 bytes of the frame, so it's not something we're passing.

https://github.com/pydicom/pydicom/blob/v2.4.4/pydicom/filereader.py#L206-L211

@effigies effigies added the DICOM label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants