Skip to content

afl-cc.c: error ‘Too many command line parameters’ #1785

@coc-cyqh

Description

@coc-cyqh

Description

When I compiled qemu-system-aarch64 using afl, I got an error in AFL-CC.

......
[2882/2882] Linking target qemu-system-aarch64
FAILED: qemu-system-aarch64 
afl-clang-fast++ -m64 -mcx16 @qemu-system-aarch64.rsp
)B
[-] PROGRAM ABORT : Too many command line parameters
         Location : process_params(), src/afl-cc.c:388

Reproducer

#git clone qemu & cd
CC=afl-clang-fast CXX=afl-clang-fast++ ./configure --target-list=aarch64-softmmu --enable-sanitizers
make -j 8

Analysis

This commit introduced the problem. The maximum number of params is 1024. However, it seems easy to exceed this number when programs are linked. I changed 1024 to 2048 and compiled successfully. I wonder if AFL++ can be more flexible to solve this problem. And the previous version used argc + 128 to determine the number of params, which does not seem to cause this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions