-
Notifications
You must be signed in to change notification settings - Fork 577
ASAN and threads don't play well together on Linux with clang #20810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is not a direct compilation failure, this is a build step (that involves calling perl code) failure. ASAN will detect false-positives without PERL_DESTRUCT_LEVEL=2 set, so you should call For me, threaded build finished successfully with PERL_DESTRUCT_LEVEL set on threaded blead.
Combined with single test PASS'es this looks like some limits being hit - memory? kernel? especially when tests are run in parallel - ASAN involves enormous VIRT allocations, which are not without overhead. |
Thanks for looking into this. I set
Re-running those files one at a time, I got these results:
|
I'm not sure what this is meant to demonstrate. You need to set PERL_DESTRUCT_LEVEL=2 in the environment, not in Configure, eg with bash:
building 5.36.0 with the Debian clang, configured:
successfully compiled and tested. |
On 2/15/23 19:10, Tony Cook wrote:
$ ./perl -Ilib -V:config_args; env | grep DESTRUCT
config_args='-des -Dusedevel -Dcc=clang -Accflags=-g
-fno-omit-frame-pointer -fsanitize=address -fno-common
-fsanitize-blacklist=/home/jkeenan/gitwork/perl/asan_ignore
-Aldflags=-fsanitize=address -Duseithreads';
PERL_DESTRUCT_LEVEL=2
I'm not sure what this is meant to demonstrate.
You need to set PERL_DESTRUCT_LEVEL=2 in the environment, not in
Configure, eg with bash:
That's what I did. I just wanted to print out both the config_args and
the relevant envvar in a compact way after I had run test_harness.
If I get a chance I'll try to run this configuration on those pull requests.
|
The last part of this should be fixed by 080297a. |
Here is an update on my attempts to build and test perl on Debian Linux using clang (version 11) with ASAN.
This completed successfully, as did
I still got one test failure:
And I got similar failure output simply running |
That's a different failure to your original report. |
True ... but the original report was from 7 months ago, and a lot has changed since then (especially with locales). |
I successfully run ASAN clang version 14.0.0-1ubuntu1.1 all the time |
On Sat, Sep 23, 2023 at 08:46:26PM -0700, Karl Williamson wrote:
I successfully run ASAN clang version 14.0.0-1ubuntu1.1 all the time
Some smokers have been failing locale tests under ASAN since around
v5.39.2-97, 2f7afdc. E.g.:
From: George Greer ***@***.***>
Message-Id: ***@***.***>
To: ***@***.***
Date: Sat, 23 Sep 2023 20:15 -0400
Subject: Smoke [blead] v5.39.3-16-gde4a70f325 FAIL(F) linux
6.4.15-200.fc38.x86_64 [Fedora Linux 38] (x86_64/1 cpu[8 cores])
{blead_clang_quick_sanitize=address}
Enabled stack-use-after-return (Linux/Darwin) and leak-detection (Linux). Smok
e logs available at http://m-l.org/~perl/smoke/perl/x86_64-linux-thread-multi/b
lead_clang_quick_sanitize=address/logde4a70f325814c204a79d4d025b3c464f70088bb.l
og.gz
Automated smoke report for branch blead 5.39.4 patch de4a70f
b3c464f70088bb v5.39.3-16-gde4a70f325
vier.local: Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz (GenuineIntel 4675MHz) (x8
6_64/1 cpu[8 cores])
on linux - 6.4.15-200.fc38.x86_64 [Fedora Linux 38]
using ccache clang version Clang 16.0.6 (Fedora 16.0.6-3.fc38)
smoketime 3 hours 50 minutes (average 57 minutes 40 seconds)
Summary: FAIL(F)
O = OK F = Failure(s), extended report at the bottom
X = Failure(s) under TEST but not under harness
? = still running or test results not (yet) available
Build failures during: - = unknown or N/A
c = Configure, m = make, M = make (after miniperl), t = make test-prep
v5.39.3-16-gde4a70f325 Configuration (common) -Accflags="-g -fno-omit-frame-po
inter -fsanitize=address -fno-common -fsanitize-blacklist=`pwd`/asan_ignore" -
Aldflags="-fsanitize=address" -Dcc="ccache clang"
----------- ---------------------------------------------------------
F F
F F -Duseithreads
| +--------- -DDEBUGGING
+----------- no debugging
Testsuite was run only with 'harness' and HARNESS_OPTIONS=j4
Failures: (common-args) -Accflags="-g -fno-omit-frame-pointer -fsanitize=addres
s -fno-common -fsanitize-blacklist=`pwd`/asan_ignore" -Aldflags="-fsanitize=ad
dress" -Dcc="ccache clang"
[default]
[default] -DDEBUGGING
[default] -Duseithreads
[default] -DDEBUGGING -Duseithreads
../ext/XS-APItest/t/locale.t................................FAILED
Non-zero exit status: 1
../lib/locale.t.............................................FAILED
Non-zero exit status: 1
../t/run/locale.t...........................................FAILED
42
Non-zero exit status: 1
MANIFEST did not declare '.mailmap'
(See log because mailing list size limit is too small.)
Non-Fatal messages(gcc):
…--
Report by Test::Smoke v1.72 running on perl 5.36.1
(Reporter v0.053 / Smoker v0.046)
|
It looks like calculate_LC_ALL_string() doesn't handle |
On 9/24/23 18:56, Tony Cook wrote:
It looks like calculate_LC_ALL_string() doesn't handle |returning ==
WANT_PL_setlocale_buf|, though the only mentions of
|WANT_PL_setlocale_buf| are the definition in |perl.h| and the call to
calculate_LC_ALL_string().
It appears to be a problem caused during rebasing. I'm looking into it.
… —
Reply to this email directly, view it on GitHub
<#20810 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2DH6MFPBBIFKG6QF45SDX4DJE3ANCNFSM6AAAAAAU4HEMXI>.
You are receiving this because you commented.Message ID:
***@***.***>
|
calculate_LC_ALL_string() takes an input parameter specifying where the caller wants the return value to be placed. It wasn't handling one of the possible values for that parameter. This was spotted by Tony Cook. I stashed the code that does the handling during a 'rebase -i', and forgot to unstash it. This fixes #20810
I have pushed a smoke branch which hopefully fixes it. Results are at https://perl.develop-help.com/?b=smoke-me%2Fkhw-WANT, and anyone can test it themselves by checking out the branch smoke-me/khw-WANT |
It looks good in smokes, corresponding reports from blead https://perl5.test-smoke.org/report/5040808 and khw-WANT https://perl5.test-smoke.org/report/5040814 |
My results, on the Linux where I've been playing with ASAN.
|
I have created a pull request from @khwilliamson's smoke-me/khw-WANT branch mentioned above. |
calculate_LC_ALL_string() takes an input parameter specifying where the caller wants the return value to be placed. It wasn't handling one of the possible values for that parameter. This was spotted by Tony Cook. I stashed the code that does the handling during a 'rebase -i', and forgot to unstash it. This fixes #20810
Inspired by some discussion on #p5p, I decided to try to build a
perl
on Linux (Debian 11) withclang
and ASAN. I make no claim to knowing what I'm doing in ASAN territory; I did not have any clear idea of what the results would be. I found that when I configured with arguments similar to those used in George Greer's smoke-testing reports (e.g., https://perl5.test-smoke.org/report/5030661), I was able to get at least as far as building miniperl with ASAN and unthreaded builds -- but not with threaded builds.Threaded builds
I've tried the following at tags v5.34.0 and v5.36.0 as well as blead.
Compilation failed like this:
... followed by a long list of direct and indirect leaks.
Unthreaded builds
If I simply dropped the
-Duseithreads
from the configuration, miniperl would build on v5.34.0, v5.36.0 and blead (v5.37.8-172-gd0613d9c78
).On
v5.34.0
, in the ASAN unthreaded build, I got 2 test failures inmake test_harness
:However, when I tested just those two files, I got a PASS.
(I didn't completely test
v5.36.0
.)On blead, in the ASAN unthreaded build, I got 4 test failures:
Re-running just the failing files, I got 3 PASSes and 1 FAIL.
To what extent are these results plausible? First, failure to get as far as
miniperl
with clang, ASAN and threads?Second, inconsistent test failures with ASAN but without threads?
The text was updated successfully, but these errors were encountered: