[lldb-dev] [3.7 Release] RC1 has been tagged, Testing Phase I begins

Hans Wennborg hans at chromium.org
Mon Jul 20 14:40:20 PDT 2015


On Sun, Jul 19, 2015 at 12:49 PM, Dimitry Andric <dimitry at andric.com> wrote:
> Another new problem with the test-release.sh script is that it can cause the whole machine (!) to run out of memory, when comparing phase 2 with phase 3, due to the following fragment:
>
>    470          echo "# Comparing Phase 2 and Phase 3 files"
>    471          for p2 in `find $llvmCore_phase2_objdir -name '*.o'` ; do
>    472              p3=`echo $p2 | sed -e 's,Phase2,Phase3,'`
>    473              # Substitute 'Phase2' for 'Phase3' in the Phase 2 object file in
>    474              # case there are build paths in the debug info. On some systems,
>    475              # sed adds a newline to the output, so pass $p3 through sed too.
>    476              if ! cmp --ignore-initial=16 <(sed -e 's,Phase2,Phase3,g' $p2) \
>    477                      <(sed -e '' $p3) > /dev/null 2>&1 ; then
>    478                  echo "file `basename $p2` differs between phase 2 and phase 3"
>    479              fi
>    480          done
>
> Because cmp(1) on FreeBSD does not support the --ignore-initial option, which is a GNU extension, the command immediately fails.  Then, the <(...) constructs on lines 476 and 477 spawn two new bash instances per iteration, and these never get cleaned up, at least not on FreeBSD.  This may very well be a bash bug.
>
> Alternatively, the 'skip' values can be specified as the third and fourth argument on the cmp(1) command line, and this works on both Linux, FreeBSD and OSX; e.g. this:
>
>             if ! cmp -s <(sed -e 's,Phase2,Phase3,g' $p2) <(sed -e '' $p3) \
>                     16 16 ; then

That seems like a good solution, feel free to commit that.

I wonder why the first 16 bytes need to be skipped though. Does anyone know?

Thanks,
Hans




More information about the lldb-dev mailing list