public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Evgeny Vereshchagin <evverx@gmail.com>
To: Mark Wielaard <mark@klomp.org>
Cc: oss-fuzz@monorail-prod.appspotmail.com,
	elfutils-devel@sourceware.org,
	 ClusterFuzz-External via monorail
	<monorail+v2.382749006@chromium.org>
Subject: Re: Issue 55999 in oss-fuzz: elfutils: Fuzzing build failure
Date: Thu, 16 Feb 2023 18:27:47 +0300	[thread overview]
Message-ID: <CAKKs9uhdQRmnSeRHFjOKpaJjd-BHRFgvVf5U7jtA8f1Lyb-OAg@mail.gmail.com> (raw)
In-Reply-To: <4c5b74cd76c9bbee7d196d0ed6df2f071d9a2e02.camel@klomp.org>

Hi Mark,

> Why can't you simply use the configure support?

I can't interfere with CFLAGS/CXXFLAGS passed by OSS-Fuzz. For example if
I used `--enable-sanitize-undefined` I would overwrite all the
`-fsanitize=...` and
`-fno-sanitize-recover=...` flags used by OSS-Fuzz. I also embed
elfutils into the
libbpf builds there so if I relied on the configure script I would
effectively instrument libbpf
and elfutils differently because libbpf would still be built with the
original CFLAGS.

Generally OSS-Fuzz doesn't expect its CFLAGS/CXXFLAGS to be changed in
any way by build
systems. When they collide stuff just stops working sometimes. The
latest example would be
https://github.com/google/oss-fuzz/pull/9427#issuecomment-1384195091
(where meson collided
with OSS-Fuzz and systemd, lxc and dbus-broker just failed to compile).

> Also I think there is simply a bug in clang that it doesn't link
> properly with libasan/ubsan when -fsanitize=address/undefined is given.

I think it's always been this way and it's unlikely to ever be fixed.
Issues like
https://bugs.llvm.org/show_bug.cgi?id=30333 have been open for years and
for example meson just gave up and started printing warnings in
https://github.com/mesonbuild/meson/commit/bde99eb6c40a9c7bc4055b0dc84a31021b7623d2
to make it clear that it isn't responsible for making clang, ASan and
--no-undefined,z,defs work.

> If you could add a configure check for that bug then we could add the
> no no-undefined trick independent of compiler used.

I'll try to figure out how it can be done. Apart from OSS-Fuzz (which
I think is a corner case in a way)
It should hopefully make `--enable-sanitize-*` work with clang.

Thanks,
Evgeny Vereshchagin

  reply	other threads:[~2023-02-16 15:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0=71cc74a7ba1af446b7ed6b9a08b414d9=ce7b5f861c1a0d42714a49e3059f172a=oss-fuzz@monorail-prod.appspotmail.com>
2023-02-15 12:01 ` ClusterFuzz-External via monorail
2023-02-15 12:32   ` Mark Wielaard
2023-02-15 17:07     ` Evgeny Vereshchagin
2023-02-16 13:23       ` Mark Wielaard
2023-02-16 15:27         ` Evgeny Vereshchagin [this message]
2023-02-16  6:01 ` ClusterFuzz-External via monorail

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKKs9uhdQRmnSeRHFjOKpaJjd-BHRFgvVf5U7jtA8f1Lyb-OAg@mail.gmail.com \
    --to=evverx@gmail.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.org \
    --cc=monorail+v2.382749006@chromium.org \
    --cc=oss-fuzz@monorail-prod.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).