GNU bug report logs - #62666
[PATCH 0/2] Add aflplusplus

Previous Next

Package: guix-patches;

Reported by: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>

Date: Tue, 4 Apr 2023 17:46:02 UTC

Severity: normal

Tags: patch

Done: Hilton Chain <hako <at> ultrarare.space>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62666 in the body.
You can then email your comments to 62666 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Tue, 04 Apr 2023 17:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 04 Apr 2023 17:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: guix-patches <at> gnu.org
Cc: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH 0/2] Add aflplusplus
Date: Tue,  4 Apr 2023 19:44:49 +0200
Hi,

Here's two patches to add aflplusplus. I've also patches (not part of this
serie) to add support for faster compilers with GCC plugins, but when I do
that it somehow fails to run:
$ cat main.c
int main()
{
	printf("Hello world\n");
}
$ afl-gcc-fast ./main.c 
afl-cc++4.05c by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: GCC_PLUGIN-DEFAULT
cc1: error: cannot load plugin /gnu/store/sx55p7b4r21kiw7sagi8cb8ff6zmvmqd-aflplusplus-4.05c/bin/../lib/afl//afl-gcc-pass.so: /gnu/store/sx55p7b4r21kiw7sagi8cb8ff6zmvmqd-aflplusplus-4.05c/bin/../lib/afl//afl-gcc-pass.so: undefined symbol: _Z30gimple_build_call_internal_vec11internal_fn3vecIP9tree_node7va_heap6vl_ptrE

So I limited that serie to what works well.


Denis 'GNUtoo' Carikli (2):
  gnu: Add aflplusplus.
  gnu: aflplusplus: Add python support

 gnu/packages/debug.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)


base-commit: b9c9c23939a40a850a8c78579adaec25d1972bd1
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Wed, 05 Apr 2023 01:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: 62666 <at> debbugs.gnu.org
Cc: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH 1/2] gnu: Add aflplusplus.
Date: Wed,  5 Apr 2023 03:29:13 +0200
* gnu/packages/debug.scm (aflplusplus): New variable.
---
 gnu/packages/debug.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 154232ed50..88b8cb8b8b 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -460,6 +460,37 @@ (define-public qemu-for-american-fuzzy-lop
     ;; Several tests fail on MIPS.
     (supported-systems (delete "mips64el-linux" %supported-systems))))))
 
+(define-public aflplusplus
+  (package
+    (inherit american-fuzzy-lop)
+    (name "aflplusplus")
+    (version "4.05c")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/AFLplusplus/AFLplusplus")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0cl0bgvd2yy331zchjz5drcnadam6w0vfmwcq1jf285hw0x8b0bk"))))
+    (inputs (list qemu))
+    (home-page "https://aflplus.plus")
+    (description
+     "AFLplusplus is a security-oriented fuzzer that employs a novel type of
+compile-time instrumentation and genetic algorithms to automatically discover
+clean, interesting test cases that trigger new internal states in the targeted
+binary.  This substantially improves the functional coverage for the fuzzed
+code.  The compact synthesized corpora produced by the tool are also useful
+for seeding other, more labor- or resource-intensive testing regimes down the
+road.  It is a fork of American Fuzzy Lop fuzzer and compared to it:
+@itemize
+@item It Supports a more recent qemu version
+@item It supports more algorithms like collision-free coverage, enhanced
+laf-intel & redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode,
+etc.
+@end itemize")))
+
 (define-public stress-make
   (let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
         (revision "2"))                 ;No official source distribution
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Wed, 05 Apr 2023 01:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: 62666 <at> debbugs.gnu.org
Cc: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH 2/2] gnu: aflplusplus: Add python support
Date: Wed,  5 Apr 2023 03:29:14 +0200
* gnu/packages/debug.scm (aflplusplus): [inputs]: Add python.
---
 gnu/packages/debug.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 88b8cb8b8b..21df553ef6 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -474,7 +474,7 @@ (define-public aflplusplus
               (sha256
                (base32
                 "0cl0bgvd2yy331zchjz5drcnadam6w0vfmwcq1jf285hw0x8b0bk"))))
-    (inputs (list qemu))
+    (inputs (list python qemu))
     (home-page "https://aflplus.plus")
     (description
      "AFLplusplus is a security-oriented fuzzer that employs a novel type of
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Wed, 23 Aug 2023 02:36:02 GMT) Full text and rfc822 format available.

Message #14 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Cc: 62666 <at> debbugs.gnu.org
Subject: Re: [bug#62666] [PATCH 0/2] Add aflplusplus
Date: Wed, 23 Aug 2023 10:34:48 +0800
Hi Denis,

On Wed, 05 Apr 2023 01:44:49 +0800,
Denis 'GNUtoo' Carikli wrote:
>
> Hi,
>
> Here's two patches to add aflplusplus. I've also patches (not part of this
> serie) to add support for faster compilers with GCC plugins, but when I do
> that it somehow fails to run:
> $ cat main.c
> int main()
> {
> 	printf("Hello world\n");
> }
> $ afl-gcc-fast ./main.c
> afl-cc++4.05c by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: GCC_PLUGIN-DEFAULT
> cc1: error: cannot load plugin /gnu/store/sx55p7b4r21kiw7sagi8cb8ff6zmvmqd-aflplusplus-4.05c/bin/../lib/afl//afl-gcc-pass.so: /gnu/store/sx55p7b4r21kiw7sagi8cb8ff6zmvmqd-aflplusplus-4.05c/bin/../lib/afl//afl-gcc-pass.so: undefined symbol: _Z30gimple_build_call_internal_vec11internal_fn3vecIP9tree_node7va_heap6vl_ptrE
>
> So I limited that serie to what works well.
>
>
> Denis 'GNUtoo' Carikli (2):
>   gnu: Add aflplusplus.
>   gnu: aflplusplus: Add python support
>
>  gnu/packages/debug.scm | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
>
>
> base-commit: b9c9c23939a40a850a8c78579adaec25d1972bd1
> --
> 2.39.1

I think (for the plugin) this is related:
--8<---------------cut here---------------start------------->8---
[+] All set and ready to build.
g++ -O3 -g -funroll-loops -D_FORTIFY_SOURCE=1 -Wall -std=c++11 -fPIC -fno-rtti -I"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin"/include -I"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin" -shared instrumentation/afl-gcc-pass.so.cc -o afl-gcc-pass.so
In file included from /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin/include/gcc-plugin.h:28,
                 from instrumentation/afl-gcc-common.h:46,
                 from instrumentation/afl-gcc-pass.so.cc:127:
/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin/include/system.h:698:10: fatal error: gmp.h: No such file or directory
  698 | #include <gmp.h>
      |          ^~~~~~~
compilation terminated.
make[1]: *** [GNUmakefile.gcc_plugin:149: afl-gcc-pass.so] Error 1
make[1]: Leaving directory '/tmp/guix-build-aflplusplus-4.05c.drv-0/source'
make: [GNUmakefile:790: install] Error 2 (ignored)
--8<---------------cut here---------------end--------------->8---

Can you address the issue and send an updated patch?

Thanks




Information forwarded to guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Fri, 15 Sep 2023 03:28:01 GMT) Full text and rfc822 format available.

Message #17 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: Hilton Chain <hako <at> ultrarare.space>
Cc: 62666 <at> debbugs.gnu.org
Subject: Re: [bug#62666] [PATCH 0/2] Add aflplusplus
Date: Fri, 15 Sep 2023 05:25:40 +0200
[Message part 1 (text/plain, inline)]
On Wed, 23 Aug 2023 10:34:48 +0800
Hilton Chain <hako <at> ultrarare.space> wrote:
> > Here's two patches to add aflplusplus. I've also patches (not part
> > of this serie) to add support for faster compilers with GCC
> > plugins, but when I do that it somehow fails to run:
> I think (for the plugin) this is related:
> --8<---------------cut here---------------start------------->8---
> [+] All set and ready to build.
> g++ -O3 -g -funroll-loops -D_FORTIFY_SOURCE=1 -Wall -std=c++11 -fPIC
> -fno-rtti
> -I"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin"/include
> -I"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin"
> -shared instrumentation/afl-gcc-pass.so.cc -o afl-gcc-pass.so In file
> included from
> /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin/include/gcc-plugin.h:28,
> from instrumentation/afl-gcc-common.h:46, from
> instrumentation/afl-gcc-pass.so.cc:127:
> /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/plugin/include/system.h:698:10:
> fatal error: gmp.h: No such file or directory 698 | #include <gmp.h>
> |          ^~~~~~~ compilation terminated. make[1]: ***
> [GNUmakefile.gcc_plugin:149: afl-gcc-pass.so] Error 1 make[1]:
> Leaving directory '/tmp/guix-build-aflplusplus-4.05c.drv-0/source'
> make: [GNUmakefile:790: install] Error 2 (ignored)
> --8<---------------cut here---------------end--------------->8---
> 
> Can you address the issue and send an updated patch?
The issue turned out to be that it called "gcc" instead of the gcc
available during the build.

Qemu is one of the aflplusplus dependencies and it doesn't cross
compile:
> $ guix build --target=aarch64-linux-gnu qemu 
> guix build: error: gnu/packages/gnome.scm:3501:2: librsvg <at> 2.54.5:
> build system `cargo' does not support cross builds

So for simplicity I've simply made aflplusplus use the gcc that is in
the inputs.

I've verified that it took the right gcc by adding '(invoke "gcc"
"--version")' to the package and verifying that it was really gcc-11.

I've also updated aflplusplus to the latest version along the way.

Denis.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to , guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Fri, 15 Sep 2023 03:29:02 GMT) Full text and rfc822 format available.

Message #20 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: 62666 <at> debbugs.gnu.org
Cc: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH v2 1/3] gnu: Add aflplusplus.
Date: Fri, 15 Sep 2023 05:27:52 +0200
* gnu/packages/debug.scm (aflplusplus): New variable.
---
ChangeLog:
- Updated to 4.08c
---
 gnu/packages/debug.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index e2a29a3ae9..cd1eccbd7b 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -459,6 +459,37 @@ (define-public qemu-for-american-fuzzy-lop
     ;; Several tests fail on MIPS.
     (supported-systems (delete "mips64el-linux" %supported-systems))))))
 
+(define-public aflplusplus
+  (package
+    (inherit american-fuzzy-lop)
+    (name "aflplusplus")
+    (version "4.08c")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/AFLplusplus/AFLplusplus")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "01hxj65if6rkjrj1fqcgq0jl95dirhkn00mi2k65mff6bckaamxg"))))
+    (inputs (list qemu))
+    (home-page "https://aflplus.plus")
+    (description
+     "AFLplusplus is a security-oriented fuzzer that employs a novel type of
+compile-time instrumentation and genetic algorithms to automatically discover
+clean, interesting test cases that trigger new internal states in the targeted
+binary.  This substantially improves the functional coverage for the fuzzed
+code.  The compact synthesized corpora produced by the tool are also useful
+for seeding other, more labor- or resource-intensive testing regimes down the
+road.  It is a fork of American Fuzzy Lop fuzzer and compared to it:
+@itemize
+@item It Supports a more recent qemu version
+@item It supports more algorithms like collision-free coverage, enhanced
+laf-intel & redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode,
+etc.
+@end itemize")))
+
 (define-public stress-make
   (let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
         (revision "2"))                 ;No official source distribution
-- 
2.41.0





Information forwarded to , guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Fri, 15 Sep 2023 03:29:02 GMT) Full text and rfc822 format available.

Message #23 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: 62666 <at> debbugs.gnu.org
Cc: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH v2 2/3] gnu: aflplusplus: Add python support
Date: Fri, 15 Sep 2023 05:27:53 +0200
* gnu/packages/debug.scm (aflplusplus): [inputs]: Add python.
---
ChangeLog: no changes
---
 gnu/packages/debug.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index cd1eccbd7b..04458d0220 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -473,7 +473,7 @@ (define-public aflplusplus
               (sha256
                (base32
                 "01hxj65if6rkjrj1fqcgq0jl95dirhkn00mi2k65mff6bckaamxg"))))
-    (inputs (list qemu))
+    (inputs (list python qemu))
     (home-page "https://aflplus.plus")
     (description
      "AFLplusplus is a security-oriented fuzzer that employs a novel type of
-- 
2.41.0





Information forwarded to , guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Fri, 15 Sep 2023 03:29:02 GMT) Full text and rfc822 format available.

Message #26 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: 62666 <at> debbugs.gnu.org
Cc: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH v2 3/3] gnu: aflplusplus: Build afl-gcc/g++-fast
Date: Fri, 15 Sep 2023 05:27:54 +0200
* gnu/packages/debug.scm (aflplusplus): [inputs]: Add gcc, gmp.
---
ChangeLog: New patch
---
 gnu/packages/debug.scm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 04458d0220..c9fdca8c8b 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -50,6 +50,7 @@ (define-module (gnu packages debug)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
@@ -59,6 +60,7 @@ (define-module (gnu packages debug)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
+  #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ninja)
   #:use-module (gnu packages perl)
@@ -473,7 +475,35 @@ (define-public aflplusplus
               (sha256
                (base32
                 "01hxj65if6rkjrj1fqcgq0jl95dirhkn00mi2k65mff6bckaamxg"))))
-    (inputs (list python qemu))
+    (arguments
+     (substitute-keyword-arguments (package-arguments american-fuzzy-lop)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           ;; TODO: Enable to cross compile aflplusplus by also enabling qemu
+           ;; to be cross compiled and by fixing the use-build-gcc phase below.
+           (add-before 'build 'use-build-gcc
+             (lambda _
+               ;; We need to patch it to select the build-time gcc else we get
+               ;; something like that:
+               ;; $ afl-gcc-fast main.c
+               ;; afl-cc++4.08c by [...] - mode: GCC_PLUGIN-DEFAULT
+               ;; cc1: error: cannot load plugin
+               ;; /gnu/[...]-aflplusplus-4.08c/bin/../lib/afl//afl-gcc-pass.so:
+               ;; /gnu/[...]-aflplusplus-4.08c/bin/../lib/afl//afl-gcc-pass.so:
+               ;; undefined symbol:
+               ;; _Z30gimple_build_call_internal_vec11internal_fn3vecIP9tree_node7va_heap6vl_ptrE
+               (substitute* "src/afl-cc.c"
+                 (("alt_cc = \"gcc\";")
+                  (string-append "alt_cc = \""
+                                 (which "gcc") "\";"))
+                 (("alt_cxx = \"g\\+\\+\";")
+                  (string-append "alt_cxx = \""
+                                 (which "g++") "\";")))))))))
+    ;; afl-gcc and g++-fast require gcc and gmp. The gcc-11 input is used
+    ;; instead of gcc because in the Dockerfile inside aflplusplus source code
+    ;; has the following comment: "GCC 12 is producing compile errors for some
+    ;; targets so we stay at GCC 11".
+    (inputs (list gcc-11 gmp python qemu))
     (home-page "https://aflplus.plus")
     (description
      "AFLplusplus is a security-oriented fuzzer that employs a novel type of
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Thu, 23 Nov 2023 17:01:01 GMT) Full text and rfc822 format available.

Message #29 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: 62666 <at> debbugs.gnu.org
Date: Thu, 23 Nov 2023 17:56:43 +0100
[Message part 1 (text/plain, inline)]
ping
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to GNUtoo <at> cyberdimension.org, hako <at> ultrarare.space, guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Mon, 08 Jan 2024 08:20:01 GMT) Full text and rfc822 format available.

Message #32 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: 62666 <at> debbugs.gnu.org
Cc: Hilton Chain <hako <at> ultrarare.space>,
 Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH v3] gnu: Add aflplusplus.
Date: Mon,  8 Jan 2024 16:19:00 +0800
From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>

* gnu/packages/debug.scm (aflplusplus): New variable.

Change-Id: Ibda36187e839d5f533d461444db25a7ba5567f0f
Modified-by: Hilton Chain <hako <at> ultrarare.space>
---

Hi Denis,

Aplogies for the long delay...

I have adjusted the phases for proper cross-compilation support and updated the
package to the latest version.

I'm sending out v3 mainly for QA purpose, I'll push it if there's no further
issue.

Thanks

gnu/packages/debug.scm | 55 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 5a528c7a28..6d4567acc4 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -50,6 +50,7 @@ (define-module (gnu packages debug)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
@@ -59,6 +60,7 @@ (define-module (gnu packages debug)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
+  #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ninja)
   #:use-module (gnu packages perl)
@@ -459,6 +461,59 @@ (define-public qemu-for-american-fuzzy-lop
     ;; Several tests fail on MIPS.
     (supported-systems (delete "mips64el-linux" %supported-systems))))))

+(define-public aflplusplus
+  (package
+    (inherit american-fuzzy-lop)
+    (name "aflplusplus")
+    (version "4.09c")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/AFLplusplus/AFLplusplus")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "12bplpd8cifla6m9l130fd22ggzkhd1w5s1aifw1idpy3njhj129"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments american-fuzzy-lop)
+       ((#:make-flags _ ''())
+        #~(list (string-append "PREFIX=" #$output)
+                (string-append "DOC_PATH=" #$output "/share/doc/"
+                               #$(package-name this-package) "-"
+                               #$(package-version this-package))
+                (string-append "CC=" #$(cc-for-target))))
+       ((#:phases phases '%standard-phases)
+        #~(modify-phases #$phases
+            ;; For GCC plugins.
+            (add-after 'unpack 'patch-gcc-path
+              (lambda* (#:key inputs #:allow-other-keys)
+                (substitute* "src/afl-cc.c"
+                  (("alt_cc = \"gcc\";")
+                   (format #f "alt_cc = \"~a\";"
+                           (search-input-file inputs "bin/gcc")))
+                  (("alt_cxx = \"g\\+\\+\";")
+                   (format #f "alt_cxx = \"~a\";"
+                           (search-input-file inputs "bin/g++"))))))))))
+    ;; According to the Dockerfile, GCC 12 is producing compile errors for some
+    ;; targets, so explicitly use GCC 11 here.
+    (inputs (list gcc-11 gmp python qemu))
+    (native-inputs (list gcc-11))
+    (home-page "https://aflplus.plus/")
+    (description
+     "AFLplusplus is a security-oriented fuzzer that employs a novel type of
+compile-time instrumentation and genetic algorithms to automatically discover
+clean, interesting test cases that trigger new internal states in the targeted
+binary.  This substantially improves the functional coverage for the fuzzed
+code.  The compact synthesized corpora produced by the tool are also useful for
+seeding other, more labor- or resource-intensive testing regimes down the road.
+It is a fork of American Fuzzy Lop fuzzer and features:
+@itemize
+@item A more recent qemu version.
+@item More algorithms like collision-free coverage, enhanced laf-intel &
+redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode, etc.
+@end itemize")))
+
 (define-public stress-make
   (let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
         (revision "2"))                 ;No official source distribution

base-commit: 3de361d9c9d320aefbd43710124d7b07af891de1
--
2.41.0




Information forwarded to guix-patches <at> gnu.org:
bug#62666; Package guix-patches. (Wed, 24 Jan 2024 00:10:02 GMT) Full text and rfc822 format available.

Message #35 received at 62666 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: Hilton Chain <hako <at> ultrarare.space>
Cc: 62666 <at> debbugs.gnu.org
Subject: Re: [bug#62666] [PATCH v3] gnu: Add aflplusplus.
Date: Wed, 24 Jan 2024 01:09:45 +0100
[Message part 1 (text/plain, inline)]
On Mon,  8 Jan 2024 16:19:00 +0800
Hilton Chain <hako <at> ultrarare.space> wrote:
> Hi Denis,
Hi,

> Aplogies for the long delay...
> 
> I have adjusted the phases for proper cross-compilation support and
> updated the package to the latest version.
> 
> I'm sending out v3 mainly for QA purpose, I'll push it if there's no
> further issue.
> 
> Thanks

Thanks a lot for improving this patch.

I've a question though: in the mumi instance
(https://issues.guix.gnu.org/62666) it still says QA Unknown.

Do I need to do something on my side?

Denis.

[Message part 2 (application/pgp-signature, inline)]

Reply sent to Hilton Chain <hako <at> ultrarare.space>:
You have taken responsibility. (Thu, 25 Jan 2024 16:36:02 GMT) Full text and rfc822 format available.

Notification sent to Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>:
bug acknowledged by developer. (Thu, 25 Jan 2024 16:36:02 GMT) Full text and rfc822 format available.

Message #40 received at 62666-done <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Cc: 62666-done <at> debbugs.gnu.org
Subject: Re: [bug#62666] [PATCH v3] gnu: Add aflplusplus.
Date: Fri, 26 Jan 2024 00:35:10 +0800
Hi Denis,

On Wed, 24 Jan 2024 08:09:45 +0800,
Denis 'GNUtoo' Carikli wrote:
>
> [1  <text/plain; US-ASCII (quoted-printable)>]
> On Mon,  8 Jan 2024 16:19:00 +0800
> Hilton Chain <hako <at> ultrarare.space> wrote:
> > Hi Denis,
> Hi,
>
> > Aplogies for the long delay...
> >
> > I have adjusted the phases for proper cross-compilation support and
> > updated the package to the latest version.
> >
> > I'm sending out v3 mainly for QA purpose, I'll push it if there's no
> > further issue.
> >
> > Thanks
>
> Thanks a lot for improving this patch.
>
> I've a question though: in the mumi instance
> (https://issues.guix.gnu.org/62666) it still says QA Unknown.
>
> Do I need to do something on my side?

Applied as 06221e910a5718c7d4ad2dcc7ffad2bc8e92fdc5 !




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 23 Feb 2024 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.