Skip to content

possible memory leak trying to unpack LZ4 #94

Open

Description

@devid7x

i try to unpack the stock firmware file of a Galaxy A22, all goes well until it gets to decompressing super.img.lz4, then it starts using all the RAM and freezes the computer
20240726_170729

Activity

  1. SebaUbuntu commented on Sep 14, 2024

    @SebaUbuntu
    Member

    A memory leak happens when after executing a piece of software allocated memory isn't freed up, are you able to find out what uses all those resources?

  2. Pokey8680 commented on Nov 1, 2024

    @Pokey8680

    increase your swap space, I was able to do it with 34gb, but you may be able to get away with 16gb

  3. kastentop2005 commented on Apr 7, 2025

    @kastentop2005

    Hey, I have the same issue. There should be a workaround enabled

    Image

  4. yoshi3jp commented on Dec 11, 2025

    @yoshi3jp

    It may or may not be related to this, but while decompressing "super.img.lz4", Dumpyara crashes, taking the terminal emulator with it.
    Host environment is Ubuntu 24.04.3 LTS on Intel® Core™ i5-8259U with 16GB memory. Target is Samsung SM-A253Z.
    The following is the log, made with script command.
    Please note that the patch @ratatouille100 proposes above gets me through decompressing "super.img.lz4", but dumpyara still crashes later on when processing super.img.

    Dumpyara
    Version 1.0.10

    [dumpyara.py:49 INFO] dumpyara: Step 1 - Extracting archive
    [extract_archive.py:24 DEBUG] extract_archive: Extracting archive: SM-A253Z_1_20251113074701_vd1di2qfhb_fac_A253ZSCS1BYK2_A253ZQBM1BYK2_A253ZSCS1BYK2_A253ZSCS1BYK2_SBM.zip
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: CP_A253ZSCS1BYK2_CP32104359_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:24 DEBUG] extract_archive: Extracting archive: CP_A253ZSCS1BYK2_CP32104359_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:29 DEBUG] extract_archive: Archive is nested, unlinking
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:24 DEBUG] extract_archive: Extracting archive: CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:29 DEBUG] extract_archive: Archive is nested, unlinking
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: HOME_CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:24 DEBUG] extract_archive: Extracting archive: HOME_CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:29 DEBUG] extract_archive: Archive is nested, unlinking
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5
    [extract_archive.py:24 DEBUG] extract_archive: Extracting archive: AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5
    [extract_archive.py:29 DEBUG] extract_archive: Archive is nested, unlinking
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:24 DEBUG] extract_archive: Extracting archive: BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:29 DEBUG] extract_archive: Archive is nested, unlinking
    [extract_archive.py:48 INFO] extract_archive: Pattern .*.tar.md5 not found
    [extract_archive.py:62 DEBUG] extract_archive: Extracted archive: BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:62 DEBUG] extract_archive: Extracted archive: AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5 probably already handled, skipping
    [extract_archive.py:62 DEBUG] extract_archive: Extracted archive: HOME_CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5 probably already handled, skipping
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5 probably already handled, skipping
    [extract_archive.py:62 DEBUG] extract_archive: Extracted archive: CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: HOME_CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive HOME_CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5 probably already handled, skipping
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5 probably already handled, skipping
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5 probably already handled, skipping
    [extract_archive.py:62 DEBUG] extract_archive: Extracted archive: CP_A253ZSCS1BYK2_CP32104359_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5 probably already handled, skipping
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: HOME_CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive HOME_CSC_QBM_A253ZQBM1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5 probably already handled, skipping
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive AP_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT_meta_OS16.tar.md5 probably already handled, skipping
    [extract_archive.py:54 INFO] extract_archive: Found nested archive: BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5
    [extract_archive.py:57 DEBUG] extract_archive: Nested archive BL_A253ZSCS1BYK2_A253ZSCS1BYK2_MQB103385610_REV00_user_low_ship_MULTI_CERT.tar.md5 probably already handled, skipping
    [extract_archive.py:62 DEBUG] extract_archive: Extracted archive: SM-A253Z_1_20251113074701_vd1di2qfhb_fac_A253ZSCS1BYK2_A253ZQBM1BYK2_A253ZSCS1BYK2_A253ZSCS1BYK2_SBM.zip
    [dumpyara.py:52 INFO] dumpyara: Step 2 - Preparing partition images
    [raw_image.py:49 INFO] get_raw_image: Decompressing boot.img.lz4 as LZ4 image
    [raw_image.py:64 DEBUG] get_raw_image: Failed to unsparse boot.img, should be a raw image
    [raw_image.py:72 INFO] get_raw_image: Copying boot.img
    [raw_image.py:76 DEBUG] get_raw_image: Partition boot_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition boot_b not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition boot-debug not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition boot-debug_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition boot-debug_b not found
    [raw_image.py:49 INFO] get_raw_image: Decompressing dtbo.img.lz4 as LZ4 image
    [raw_image.py:64 DEBUG] get_raw_image: Failed to unsparse dtbo.img, should be a raw image
    [raw_image.py:72 INFO] get_raw_image: Copying dtbo.img
    [raw_image.py:76 DEBUG] get_raw_image: Partition dtbo_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition dtbo_b not found
    [raw_image.py:49 INFO] get_raw_image: Decompressing init_boot.img.lz4 as LZ4 image
    [raw_image.py:64 DEBUG] get_raw_image: Failed to unsparse init_boot.img, should be a raw image
    [raw_image.py:72 INFO] get_raw_image: Copying init_boot.img
    [raw_image.py:76 DEBUG] get_raw_image: Partition init_boot_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition init_boot_b not found
    [raw_image.py:49 INFO] get_raw_image: Decompressing recovery.img.lz4 as LZ4 image
    [raw_image.py:64 DEBUG] get_raw_image: Failed to unsparse recovery.img, should be a raw image
    [raw_image.py:72 INFO] get_raw_image: Copying recovery.img
    [raw_image.py:76 DEBUG] get_raw_image: Partition recovery_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition recovery_b not found
    [raw_image.py:49 INFO] get_raw_image: Decompressing vendor_boot.img.lz4 as LZ4 image
    [raw_image.py:64 DEBUG] get_raw_image: Failed to unsparse vendor_boot.img, should be a raw image
    [raw_image.py:72 INFO] get_raw_image: Copying vendor_boot.img
    [raw_image.py:76 DEBUG] get_raw_image: Partition vendor_boot_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition vendor_boot_b not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition vendor_boot-debug not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition vendor_boot-debug_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition vendor_boot-debug_b not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition vendor_kernel_boot not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition vendor_kernel_boot_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition vendor_kernel_boot_b not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition exaid not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition exaid_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition exaid_b not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition rescue not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition rescue_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition rescue_b not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition tz not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition tz_a not found
    [raw_image.py:76 DEBUG] get_raw_image: Partition tz_b not found
    [raw_image.py:49 INFO] get_raw_image: Decompressing super.img.lz4 as LZ4 image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions