Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 879625 - app-antivirus/clamav: possible configure breakage with Clang 16
Summary: app-antivirus/clamav: possible configure breakage with Clang 16
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal
Assignee: Antivirus Team
URL:
Whiteboard: fixed in 1.3.1
Keywords:
: 900585 (view as bug list)
Depends on:
Blocks: implicit-in-configure
  Show dependency tree
 
Reported: 2022-11-04 22:06 UTC by Matt Jolly
Modified: 2024-11-02 21:49 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
clang-14.log (clang-14.log,16.13 KB, text/plain)
2022-11-04 22:06 UTC, Matt Jolly
Details
clang-15.log (clang-15.log,16.07 KB, text/plain)
2022-11-04 22:06 UTC, Matt Jolly
Details
clang.diff (clang.diff,22.77 KB, text/plain)
2022-11-04 22:06 UTC, Matt Jolly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Jolly gentoo-dev 2022-11-04 22:06:12 UTC
This package has been identified via automation as potentially impacted by upcoming Clang 16 changes.
The following have been identified as potential issues:

[-Werror,-Wimplicit-function-declaration]

[-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strlcat' with type 'unsigned long (char *, const char *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strlcpy' with type 'unsigned long (char *, const char *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
Comment 1 Matt Jolly gentoo-dev 2022-11-04 22:06:13 UTC
Created attachment 827137 [details]
clang-14.log

build log
Comment 2 Matt Jolly gentoo-dev 2022-11-04 22:06:14 UTC
Created attachment 827139 [details]
clang-15.log

build log
Comment 3 Matt Jolly gentoo-dev 2022-11-04 22:06:16 UTC
Created attachment 827141 [details]
clang.diff

build log
Comment 4 Michael Orlitzky gentoo-dev 2022-11-05 01:01:22 UTC
This fixes the stable branch:

  https://github.com/Cisco-Talos/clamav/pull/747

If for some reason it's not merged before clang-16 hits, I can always add another patch to the Gentoo package.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-05 07:47:30 UTC
(In reply to Michael Orlitzky from comment #4)
> This fixes the stable branch:
> 
>   https://github.com/Cisco-Talos/clamav/pull/747
> 
> If for some reason it's not merged before clang-16 hits, I can always add
> another patch to the Gentoo package.

Please do - these issues can lead to wrong configure results anyway but I also want to try clean up anything off the bug list that's fixable, as it's soooo long :(
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-11 22:50:07 UTC
Clang 16 is imminent.
Comment 7 Larry the Git Cow gentoo-dev 2023-02-15 22:51:47 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a12c3ed66db1fed82adc8010d05214db44ac31ff

commit a12c3ed66db1fed82adc8010d05214db44ac31ff
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2023-02-15 22:32:11 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2023-02-15 22:33:55 +0000

    app-antivirus/clamav: add 0.103.8 (CVE-2023-20032, CVE-2023-20052).
    
    Bug: https://bugs.gentoo.org/879625
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 app-antivirus/clamav/Manifest                      |   1 +
 app-antivirus/clamav/clamav-0.103.8.ebuild         | 240 +++++++++++++++++++++
 .../clamav/files/clamav-0.103.8-c-std.patch        | 204 ++++++++++++++++++
 3 files changed, 445 insertions(+)
Comment 8 Eli Schwartz gentoo-dev 2024-05-17 04:43:25 UTC
*** Bug 900585 has been marked as a duplicate of this bug. ***
Comment 9 Eli Schwartz gentoo-dev 2024-05-17 04:45:44 UTC
Apparently fixed upstream.

The build now fails much more straightforwardly:

FAILED: libclamav/CMakeFiles/regex.dir/regex/regexec.c.o 
/usr/bin/x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -DTHIS_IS_LIBCLAMAV -I/usr/include/libxml2 -I/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1_build/libclamav -I/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamunrar_iface -I/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/.. -I/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1_build -I/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav -isystem /usr/include/json-c  -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -std=gnu90 -fPIC  -Wall -Wextra -Wformat-security -MD -MT libclamav/CMakeFiles/regex.dir/regex/regexec.c.o -MF libclamav/CMakeFiles/regex.dir/regex/regexec.c.o.d -o libclamav/CMakeFiles/regex.dir/regex/regexec.c.o -c /var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/regexec.c
In file included from /var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/regexec.c:81:
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c: In function ‘smatcher’:
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:219:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  219 |                 for (i = 1; i <= m->g->nsub; i++)
      |                               ^~
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:226:44: error: assignment to ‘const char **’ from incompatible pointer type ‘char **’ [-Werror=incompatible-pointer-types]
  226 |                                 m->lastpos = (char **)cli_malloc((g->nplus+1) *
      |                                            ^
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:277:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  277 |                 for (i = 1; i < nmatch; i++)
      |                               ^
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:278:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  278 |                         if (i <= m->g->nsub)
      |                               ^~
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c: In function ‘sdissect’:
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:311:21: warning: variable ‘dp’ set but not used [-Wunused-but-set-variable]
  311 |         const char *dp;
      |                     ^~
In file included from /var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/regexec.c:130:
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c: In function ‘lmatcher’:
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:219:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  219 |                 for (i = 1; i <= m->g->nsub; i++)
      |                               ^~
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:226:44: error: assignment to ‘const char **’ from incompatible pointer type ‘char **’ [-Werror=incompatible-pointer-types]
  226 |                                 m->lastpos = (char **)cli_malloc((g->nplus+1) *
      |                                            ^
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:277:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  277 |                 for (i = 1; i < nmatch; i++)
      |                               ^
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:278:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  278 |                         if (i <= m->g->nsub)
      |                               ^~
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c: In function ‘ldissect’:
/var/tmp/portage/app-antivirus/clamav-1.3.1/work/clamav-clamav-1.3.1/libclamav/regex/engine.c:311:21: warning: variable ‘dp’ set but not used [-Wunused-but-set-variable]
  311 |         const char *dp;
      |                     ^~
cc1: some warnings being treated as errors
Comment 10 Eli Schwartz gentoo-dev 2024-05-17 04:51:44 UTC
We should track the other issue separately apparently.