lief-project / LIEF

LIEF - Library to Instrument Executable Formats

Home Page:https://lief-project.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression: MemoryError: std::bad_alloc after v0.12.3

mxschmitt opened this issue · comments

Describe the bug

When doing str(binary) of a larger binary, it used to work. In >v0.12.3 it ends up in a OOM error.

To Reproduce

Steps to reproduce the behavior:

curl -O https://nodejs.org/dist/v20.12.0/node-v20.12.0-linux-arm64.tar.xz
tar -xf node-v20.12.0-linux-arm64.tar.xz

python -c 'import lief; binary = lief.parse("node-v20.12.0-linux-arm64/bin/node"); print(str(binary))'

Expected behavior

Some stringified value.

Actual behavior

MemoryError: std::bad_alloc

Environment (please complete the following information):

  • System and Version : Ubuntu 22.04
  • Target format (PE, ELF, Mach-O): ELF I believe
  • LIEF commit version: v0.14.1

Additional context

Upstream issue: conda/conda-build#5267

Might be similar to #1038?

Hi @mxschmitt

It seems that this issue is already fixed in the master branch as of 307e113.

Closing since it's fixed on master. Feel free to re-open if you identify the issue.

If I’m not wrong, this fix hasn’t been released yet. Is there an ETA for the next release? No preasure, just want to know if it makes more sense to wait for the update or to downgrade to an older version for now. :-)

Hi! I think the next release will come around July so depending on your need/priority you might downgrade or use a nightly version.