Bug 5871 - strings produces "out of memory" error on certain input
Summary: strings produces "out of memory" error on certain input
Alias: None
Product: Sisyphus
Classification: Development
Component: binutils (show other bugs)
Version: unstable
Hardware: all Linux
: P2 major
Assignee: Gleb F-Malinovskiy
QA Contact: qa-sisyphus
Depends on:
Reported: 2005-01-13 03:26 MSK by Mikhail Zabaluev
Modified: 2005-07-13 15:47 MSD (History)
1 user (show)

See Also:

The file causing an error (60.99 KB, application/octet-stream)
2005-01-13 03:27 MSK, Mikhail Zabaluev
no flags Details
Another sample file with large section size (32 bytes, application/octet-stream)
2005-01-15 03:08 MSK, Dmitry V. Levin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Zabaluev 2005-01-13 03:26:35 MSK
When run on a certain file (see attachment), strings exits with an error:
strings: out of memory allocating 1365836033 bytes after a total of 0 bytes
Comment 1 Mikhail Zabaluev 2005-01-13 03:27:52 MSK
Created attachment 689 [details]
The file causing an error
Comment 2 Dmitry V. Levin 2005-01-14 20:43:52 MSK
I wonder whether it is a bug or not, since
strings --target=binary passes this test.
Comment 3 Dmitry V. Levin 2005-01-15 03:08:09 MSK
Created attachment 693 [details]
Another sample file with large section size

Specially crafted sample file with enormously large section size.
Comment 4 Mikhail Zabaluev 2005-01-15 11:46:55 MSK
The first file isn't an ELF file at all, it is a binary state dump produced by

I think it's still a problem. The utility should fall back to --target=binary
mode if sanity checks on the object format fail.
Comment 5 Dmitry V. Levin 2005-03-17 15:37:48 MSK
No, this utility should not fall back to --target=binary.
The OOM handling fixed in binutils-