Conversation
ffaa9b8 to
1950984
Compare
|
meh. I can't hit the ASAN failure locally yet. :( |
|
You mean the one in qmanifest? From a quick look it seems to happen with openmp only. I need to look at it later when I have some time to see what it complains about. With some luck I can fix it. Unrelated: I believe there's also a valgrind run, I'm assuming that won't also run with *SAN, right? Wouldn't make much sense I guess :) |
76ecfa9 to
84afa94
Compare
|
Looking at one of the UBSAN errors, the call stack looks like the thing I have come across in #26 ! I have also seen ASAN report a leak, but that does not quite look like the ASAN error in this pull request. I'll be looking into it further. |
|
Unfortunately, #26 and #27 are still not enough to satisfy ASAN. One thing remains: Line 1423 in 13b0eec
EDIT: This patch satisfies ASAN, but I don't know if it is correct: diff --git a/qmanifest.c b/qmanifest.c
index 2bb0f11..d04f743 100644
--- a/qmanifest.c
+++ b/qmanifest.c
@@ -1421,7 +1421,7 @@ verify_manifest(
#define append_list(STR) \
if (strncmp(STR, "TIMESTAMP ", 10) != 0 || strncmp(STR, "DIST ", 5) != 0) {\
char *endp = STR + strlen(STR) - 1;\
- while (isspace(*endp))\
+ while (isspace(*endp) && endp > STR)\
*endp-- = '\0';\
if (elemslen == elemssize) {\
elemssize += LISTSZ;\EDIT 2: The above analysis is wrong, but there's still a problem in that I have a few proposals:
diff --git a/qmanifest.c b/qmanifest.c
index 2bb0f11..00dfea3 100644
--- a/qmanifest.c
+++ b/qmanifest.c
@@ -1421,8 +1421,11 @@ verify_manifest(
#define append_list(STR) \
if (strncmp(STR, "TIMESTAMP ", 10) != 0 || strncmp(STR, "DIST ", 5) != 0) {\
char *endp = STR + strlen(STR) - 1;\
- while (isspace(*endp))\
- *endp-- = '\0';\
+ while (isspace(*endp) && endp >= STR) {\
+ *endp = '\0';\
+ if(endp > STR) --endp;\
+ if(endp == STR) break;\
+ }\
if (elemslen == elemssize) {\
elemssize += LISTSZ;\
elems = xrealloc(elems, elemssize * sizeof(elems[0]));\EDIT 3: Maybe |
Previously, `values_set(merge_averages, avgs)` would allocate `avgs`, then it would be used in `array_for_each(atoms, i, atom)`, but a call to `xarrayfree_int(avgs)` was missing after the loop. Hopefully, this, along with #26, will solve the issues from #19. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
|
hey, thanks for your analysis, that's cutting a few corners too much |
|
As far as I understand, your simplest patch is close to the correct one. Instead of Doing that is eventually not really relevant because all strings that are compared to are > 1 char, so while at it, I threw in a small optimisation to not bother with anything less than 5 characters. (least: "AUX" + SPACE + 1-char). |
Empty strings, or those being just whitespace were not handled correctly. Thanks bstaletic in PR #19 for pointing this out. Avoid running under the original string pointer and skip any checks for strings that are too short to match anything in particular. This sweeps an edgecase of just a single whitespace char under the carpet -- which is just about fine, for it needs not to be handled for any legitimate case. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
|
Once the last PR is in, I'll rebase to get both of your patches in and hopefully it's green then. Thanks a bunch both. |
|
ok, should be pushed now |
Signed-off-by: Sam James <sam@gentoo.org>
This is much easier to test with and covers e.g. updated PRs. Signed-off-by: Sam James <sam@gentoo.org>
It's useful to be able to see failures in various configurations immediately and all of our jobs take roughly the same amount of time anyway. (It's not like we have some very slow jobs which run after.) Signed-off-by: Sam James <sam@gentoo.org>
|
All green! Nice! |
| none) | ||
| ;; | ||
| asan) | ||
| export CFLAGS="${CFLAGS} -ggdb3 -fsanitize=address" |
There was a problem hiding this comment.
Is it useful to use -O3 here? do we get useful stacks and analysis this way? For valgrind we also run with -g -pipe to get understandable complaints
bstaletic
left a comment
There was a problem hiding this comment.
A few ideas, since I'm here.
- ASAN and UBSSAN can be combined, as in
-fsanitize=address,undefined. Those are the only two that can be combined, so it might be worth it to reduce the number of CI jobs getting dispatched. - Consider enabling MSAN as well, as in
-fsanitize=memory. It is a clang-only sanitizer meant to catch reads of uninitialized memory. There are things that are only caught by MSAN: https://godbolt.org/z/TKzxYaEhW
Signed-off-by: Sam James sam@gentoo.org