Bug#807578: /usr/bin/afl-clang-fast: strict dependency on clang version not declared

2016-02-01 Thread Daniel Stender
On Thu, 7 Jan 2016 01:28:17 +0100 Jakub Wilk  wrote:
> * Daniel Stender , 2016-01-07, 01:00:
> >+  * Hardcode current LLVM/clang version in debian/ files and in the
> >+source (added hardcode-llvm-version.patch) to prevent crash of
> >+afl-clang-fast because default build-time and runtime version
> >+differs (Closes: #807578).
> 
> I'd expect that afl-clang(-fast) uses clang, not clang-X.Y.
> Also, you patched afl-clang-fast, leaving afl-clang unchanged.
> 
> But this is all unnecessary, because the problem is somewhere else:
> 
> > override_dh_gencontrol:
> > dh_gencontrol
> >-debian/dh_clang -p afl-clang
> 
> You were calling dh_clang after dh_gencontrol, which is obviously too late.
> 
> -- 
> Jakub Wilk

I was planning to change hardcode-clang-version.patch to run against and build 
against
clang/llvm 3.7 to get afl for arm64 again (#796343, probably other bugs could 
be resolved by that
move, too), but llvm-3.7 is missing on some other archs currently, so that's 
not an option.

However, I'm going to keep the patch for the next upload although default clang 
doesn't differ
between Unstable and Testing anymore, it could be easily changed when 3.7 gets 
better. Dropping
the patch now and getting it back into charge again later doesn't makes much 
sense.

Anyway, dh_clang has been put into the right place for times hardcoding and 
versioned building
is going to be dropped again. Thanks for the pointer!

DS

-- 
4096R/DF5182C8
46CB 1CA8 9EA3 B743 7676 1DB9 15E0 9AF4 DF51 82C8
LPI certified Linux admin (LPI000329859 64mz6f7kt4)
http://www.danielstender.com/blog/



Bug#807578: /usr/bin/afl-clang-fast: strict dependency on clang version not declared

2016-01-06 Thread Jakub Wilk

* Daniel Stender , 2016-01-07, 01:00:

+  * Hardcode current LLVM/clang version in debian/ files and in the
+source (added hardcode-llvm-version.patch) to prevent crash of
+afl-clang-fast because default build-time and runtime version
+differs (Closes: #807578).


I'd expect that afl-clang(-fast) uses clang, not clang-X.Y.
Also, you patched afl-clang-fast, leaving afl-clang unchanged.

But this is all unnecessary, because the problem is somewhere else:


override_dh_gencontrol:
dh_gencontrol
-   debian/dh_clang -p afl-clang


You were calling dh_clang after dh_gencontrol, which is obviously too late.

--
Jakub Wilk



Bug#807578: /usr/bin/afl-clang-fast: strict dependency on clang version not declared

2016-01-06 Thread Daniel Stender
On 07.01.2016 01:28, Jakub Wilk wrote:
> * Daniel Stender , 2016-01-07, 01:00:
>> +  * Hardcode current LLVM/clang version in debian/ files and in the
>> +source (added hardcode-llvm-version.patch) to prevent crash of
>> +afl-clang-fast because default build-time and runtime version
>> +differs (Closes: #807578).
> 
> I'd expect that afl-clang(-fast) uses clang, not clang-X.Y.
> Also, you patched afl-clang-fast, leaving afl-clang unchanged.
> 
> But this is all unnecessary, because the problem is somewhere else:
> 
>> override_dh_gencontrol:
>> dh_gencontrol
>> -debian/dh_clang -p afl-clang
> 
> You were calling dh_clang after dh_gencontrol, which is obviously too late.

The changes should fix the bug, but it needs further work then, anyway 
(build/patch
against 3.7 like Gianfranco suggested).

Thanks for the comments, I'll work through it again the next days.

Daniel

-- 
4096R/DF5182C8
46CB 1CA8 9EA3 B743 7676 1DB9 15E0 9AF4 DF51 82C8
LPI certified Linux admin (LPI000329859 64mz6f7kt4)
http://www.danielstender.com/blog/



Bug#807578: /usr/bin/afl-clang-fast: strict dependency on clang version not declared

2016-01-06 Thread Daniel Stender
I've hardcoded the package now against clang/llvm 3.6, the described problem 
should vanish
with that.

I can't push to the Dgit archive currently as DM, but I'm going to use Dgit in 
the future
so that individual changes could be watched closely.

Best,
DS

-- 
4096R/DF5182C8
46CB 1CA8 9EA3 B743 7676 1DB9 15E0 9AF4 DF51 82C8
LPI certified Linux admin (LPI000329859 64mz6f7kt4)
http://www.danielstender.com/blog/
diff -Nru afl-1.95b/debian/changelog afl-1.95b/debian/changelog
--- afl-1.95b/debian/changelog	2015-12-03 15:54:57.0 +0100
+++ afl-1.95b/debian/changelog	2016-01-07 00:33:15.0 +0100
@@ -1,3 +1,12 @@
+afl (1.95b-3) unstable; urgency=medium
+
+  * Hardcode current LLVM/clang version in debian/ files and in the
+source (added hardcode-llvm-version.patch) to prevent crash of
+afl-clang-fast because default build-time and runtime version
+differs (Closes: #807578).
+
+ -- Daniel Stender   Thu, 07 Jan 2016 00:33:02 +0100
+
 afl (1.95b-2) unstable; urgency=medium
 
   * Upload to unstable.
diff -Nru afl-1.95b/debian/control afl-1.95b/debian/control
--- afl-1.95b/debian/control	2015-11-19 16:18:10.0 +0100
+++ afl-1.95b/debian/control	2016-01-07 00:32:47.0 +0100
@@ -3,10 +3,10 @@
 Priority: optional
 Maintainer: Daniel Stender 
 Build-Depends:
- clang,
+ clang-3.6,
  debhelper (>= 9),
  dh-buildinfo,
- llvm-dev
+ llvm-3.6-dev
 Standards-Version: 3.9.6
 Homepage: http://lcamtuf.coredump.cx/afl/
 
@@ -36,7 +36,7 @@
 Package: afl-clang
 Depends:
  afl (= ${binary:Version}),
- clang,
+ clang-3.6,
  ${clang:Depends},
  ${misc:Depends},
  ${shlibs:Depends}
diff -Nru afl-1.95b/debian/patches/hardcode-clang-version.patch afl-1.95b/debian/patches/hardcode-clang-version.patch
--- afl-1.95b/debian/patches/hardcode-clang-version.patch	1970-01-01 01:00:00.0 +0100
+++ afl-1.95b/debian/patches/hardcode-clang-version.patch	2016-01-07 00:31:58.0 +0100
@@ -0,0 +1,63 @@
+Description: hardcode-clang-version.patch
+ hardcode clang version to prevent crash of afl-clang-fast
+ if build-time and runtime default version differs.
+ Bug: https://bugs.debian.org/807578
+ Forwarded: no
+ Last-Update: 2016-01-06
+Author: Daniel Stender 
+X-Dgit-Generated: 1.95b-2 824b7cf540b215d5888162f1d18bd35c3038d87e
+
+---
+
+--- afl-1.95b.orig/afl-gcc.c
 afl-1.95b/afl-gcc.c
+@@ -129,10 +129,10 @@ static void edit_params(u32 argc, char**
+ 
+ if (!strcmp(name, "afl-clang++")) {
+   u8* alt_cxx = getenv("AFL_CXX");
+-  cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++";
++  cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++-3.6";
+ } else {
+   u8* alt_cc = getenv("AFL_CC");
+-  cc_params[0] = alt_cc ? alt_cc : (u8*)"clang";
++  cc_params[0] = alt_cc ? alt_cc : (u8*)"clang-3.6";
+ }
+ 
+   } else {
+--- afl-1.95b.orig/llvm_mode/Makefile
 afl-1.95b/llvm_mode/Makefile
+@@ -22,7 +22,7 @@ BIN_PATH = $(PREFIX)/bin
+ 
+ VERSION  = $(shell grep ^VERSION ../Makefile | cut -d= -f2 | sed 's/ //')
+ 
+-LLVM_CONFIG ?= llvm-config
++LLVM_CONFIG ?= llvm-config-3.6
+ 
+ CFLAGS  ?= -O3 -funroll-loops
+ CFLAGS  += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \
+@@ -50,8 +50,8 @@ endif
+ 
+ ifeq "$(origin CC)" "default"
+ 
+-CC   = clang
+-CXX  = clang++
++CC   = clang-3.6
++CXX  = clang++-3.6
+ 
+ endif
+ 
+--- afl-1.95b.orig/llvm_mode/afl-clang-fast.c
 afl-1.95b/llvm_mode/afl-clang-fast.c
+@@ -106,10 +106,10 @@ static void edit_params(u32 argc, char**
+ 
+   if (!strcmp(name, "afl-clang-fast++")) {
+ u8* alt_cxx = getenv("AFL_CXX");
+-cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++";
++cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++-3.6";
+   } else {
+ u8* alt_cc = getenv("AFL_CC");
+-cc_params[0] = alt_cc ? alt_cc : (u8*)"clang";
++cc_params[0] = alt_cc ? alt_cc : (u8*)"clang-3.6";
+   }
+ 
+   cc_params[cc_par_cnt++] = "-Xclang";
diff -Nru afl-1.95b/debian/patches/series afl-1.95b/debian/patches/series
--- afl-1.95b/debian/patches/series	1970-01-01 01:00:00.0 +0100
+++ afl-1.95b/debian/patches/series	2016-01-07 00:31:58.0 +0100
@@ -0,0 +1 @@
+hardcode-clang-version.patch
diff -Nru afl-1.95b/debian/rules afl-1.95b/debian/rules
--- afl-1.95b/debian/rules	2015-12-03 14:36:20.0 +0100
+++ afl-1.95b/debian/rules	2016-01-07 00:32:55.0 +0100
@@ -50,4 +50,4 @@
 
 override_dh_gencontrol:
 	dh_gencontrol
-	debian/dh_clang -p afl-clang
+#	debian/dh_clang -p afl-clang


Bug#807578: /usr/bin/afl-clang-fast: strict dependency on clang version not declared

2015-12-16 Thread Daniel Stender
Thank you for reporting this.

I'm busy right now but this is going to be fixed soon. In the holidays.

Yes, that's a point. I'm going Dgit it.

DS

-- 
4096R/DF5182C8
46CB 1CA8 9EA3 B743 7676 1DB9 15E0 9AF4 DF51 82C8
LPI certified Linux admin (LPI000329859 64mz6f7kt4)
http://www.danielstender.com/blog/



Bug#807578: /usr/bin/afl-clang-fast: strict dependency on clang version not declared

2015-12-10 Thread Andreas Cadhalpun
Package: afl-clang
Version: 1.95b-2
Severity: serious
Justification: makes the program unusable
File: /usr/bin/afl-clang-fast

Dear Maintainer,

The current version of afl-clang-fast in testing doesn't work at all:
$ echo "int main(){return 0;}" | afl-clang-fast -x c -
afl-clang-fast 1.95b by 
afl-llvm-pass 1.95b by 
/usr/lib/llvm-3.5/bin/clang: symbol lookup error: 
/usr/lib/afl/afl-llvm-pass.so: undefined symbol: 
_ZN4llvm16MetadataTracking5trackEPvRNS_8MetadataENS_12PointerUnionIPNS_15MetadataAsValueEPS2_EE
clang: error: unable to execute command: No such file or directory
clang: error: clang frontend command failed due to signal (use -v to see 
invocation)
Debian clang version 3.5.2-3 (tags/RELEASE_352/final) (based on LLVM 3.5.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to 
http://bugs.debian.org/ and include the crash backtrace, preprocessed source, 
and associated run script.
clang: note: diagnostic msg: Error generating preprocessed source(s) - ignoring 
input from stdin.
clang: note: diagnostic msg: Error generating preprocessed source(s) - no 
preprocessable inputs.

The reason is that clang in testing is still version 3.5, while it is
already 3.6 in sid, so afl-clang got built with 3.6.
Previous versions (up to 1.94b-1+b1) used to declare this dependency like:
clang (<< 1:3.7), clang (>= 1:3.6)

However, the current version (1.95b-2) only depends on unversioned 'clang',
which is not enough.

Since debian/changelog does not mention this change, I assume that it was
not intended.

Also, please keep using a public git repository for your packaging, so
that one can more easily check which change broke something.

Best regards,
Andreas


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages afl-clang depends on:
ii  afl 1.95b-2
ii  clang   1:3.5-26
ii  libc6   2.19-22
ii  libgcc1 1:5.2.1-23
ii  libstdc++6  5.2.1-23

afl-clang recommends no packages.

afl-clang suggests no packages.