<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15876</bug_id>
          
          <creation_ts>2025-05-22 15:46:34 +0000</creation_ts>
          <short_desc>diffoscope has no memory limit</short_desc>
          <delta_ts>2025-05-28 06:42:39 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>QA/Testing</classification>
          <product>Functional (self) Testing</product>
          <component>oe-selftest</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yoann Congal">yoann.congal</reporter>
          <assigned_to name="Yoann Congal">yoann.congal</assigned_to>
          
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102048</commentid>
    <comment_count>0</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-22 15:46:34 +0000</bug_when>
    <thetext>(Bug to note ideas discussed during the bug review call)

In its current form, the reproducibility build (using diffoscope) has no limit in memory usage. When testing meta-oe reproducibility, its high memory usage can trigger OOM kills on AB.

In first-to-last to try:
* this option:
--max-diff-block-lines-saved LINES
    Maximum number of lines saved per diff block. Most users should not need this, unless
    you run out of memory. This truncates diff(1) output before emitting it in a report, 
    and affects all types of output, including --text and --json. (0 to disable, default: 0)
* most likely need to be coupled with 
--max-diff-block-lines LINES
    Maximum number of lines output per unified-diff block, across all pages. 
    (0 to disable, default: 1024)
  ... to avoid generating no empty output
* Re-explore &apos;--no-default-limits&apos; option (see call[0]) =&gt; look at git history on why it was added.
* If limiting memory from diffoscope is not possible, use an external tool:
  * prlimit? (https://man7.org/linux/man-pages/man1/prlimit.1.html)
  * (during the call, I mentioned a &quot;timeout&quot; tools but it was not the GNU Coreutils tool, but this one https://github.com/pshved/timeout)
  * cgroups? (feasibility on AB is uncertain)


[0] https://web.git.yoctoproject.org/poky/tree/meta/lib/oeqa/selftest/cases/reproducible.py#n101</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102051</commentid>
    <comment_count>1</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-22 17:03:58 +0000</bug_when>
    <thetext>Also,
* When diffoscop&apos;ing 2 1GB binaries, diffoscope tried to use &gt;26GB memory.
* RP suggested that if we have a proper reproducer, upstream diffoscope is interested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102052</commentid>
    <comment_count>2</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-22 17:28:20 +0000</bug_when>
    <thetext>Note: the --no-default-limits option was there since diffoscope was added: 
https://git.yoctoproject.org/poky/commit/?id=d59bfa1334bd635bc1537ca20e58e624693167f1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102061</commentid>
    <comment_count>3</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-23 11:01:31 +0000</bug_when>
    <thetext>On the may 17th failures, the most likely suspect is nodejs-dbg which is almost 1GB (!):
https://valkyrie.yocto.io/pub/repro-fail-openembedded/meta-oe/oe-reproducible-20250517-nuhpy5cy/packages/reproducibleA/tmp/deploy/deb/core2-64/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102066</commentid>
    <comment_count>4</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-23 19:25:39 +0000</bug_when>
    <thetext>Patch sent:
[PATCH] selftest/reproducible: Limit memory used by diffoscope
https://lists.openembedded.org/g/openembedded-core/message/217218</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102077</commentid>
    <comment_count>5</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-05-28 06:42:39 +0000</bug_when>
    <thetext>Fix merged with: selftest/reproducible: Limit memory used by diffoscope - openembedded-core - OpenEmbedded Core layer
https://git.openembedded.org/openembedded-core/commit/?id=04cbcfc7e09d19b0ba50e7940fc82d10e222fdbe</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>