[Nasm-bugs] [Bug 3392774] Large define lists crash recent NASM

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Sat Aug 27 10:54:46 PDT 2022


https://bugzilla.nasm.us/show_bug.cgi?id=3392774

--- Comment #6 from C. Masloch <pushbx at ulukai.org> ---
I used git bisect on the NASM repo, running the following scriptlet to build
and test NASM:

$ git clean -x -d -f; touch config/undef.h; ./autogen.sh; ./configure; make;
git checkout autoconf; /usr/bin/time --format="%M KiB" ./nasm
~/wwwecm/test/20220825/test.asm

This test resulted in less than 7 MiB of memory use for good revisions, more
than 2.8 GiB for bad revisions. I started with
https://github.com/netwide-assembler/nasm/commit/52266ad42490f48b91a70efb5c2f93ea281eeb60
as the good revision and
https://github.com/netwide-assembler/nasm/commit/3aebb20f123033dcd767f0abc46b18cbefed8091
as the bad revision. First bad revision is
https://github.com/netwide-assembler/nasm/commit/de7acc3a46cb3da52464d246b814f8bf059a0360

de7acc3a46cb3da52464d246b814f8bf059a0360 is the first bad commit
commit de7acc3a46cb3da52464d246b814f8bf059a0360
Author: H. Peter Anvin (Intel) <hpa at zytor.com>
Date:   Mon Aug 19 17:52:55 2019 -0700

    preproc: defer %00, %? and %?? expansion for nested macros, cleanups

    BR 3392603: When doing nested macro definitions, we need %00, %? and
    %?? expansion to be deferred to actual expansion time, just as the
    other parameters.

    Do major cleanups to the mmacro expansion code.

    Reported-by: Alexandre Audibert <alexandre.audibert at outlook.fr>
    Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>

 asm/preproc.c | 713 ++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 400 insertions(+), 313 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list