[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Test suite failures under UndefinedBehaviorSanitizer (UBSAN)
From: |
Sam James |
Subject: |
Re: Test suite failures under UndefinedBehaviorSanitizer (UBSAN) |
Date: |
Tue, 10 Jan 2023 10:12:28 +0000 |
> On 1 Jan 2023, at 18:50, arnold@skeeve.com wrote:
>
> Hi.
>
> Thank you for the bug report, and in particular for using the
> gawkbug script.
>
> I took a walk through the code. I don't think that your patch
> is correct -- the returned cnt should either be positive or
> negative all the time, but if there was an error we want
> to report it and then return the value. errcode is initialized
> to zero before being passed to get_a_record, so if it comes
> back non-zero, we know something bad happened.
>
Yeah, I see what you mean now. But in any case, s is still
null on that last run (confirmed with gdb, as UBSAN originally reported).
get_a_record is the last place to touch s before that, so it must
be something in there which sets it to null but doesn't affect the error code?
Or am I missing something?
Let me know if you have trouble reproducing the original
UBSAN traceback too, for me, this was enough:
```
./bootstrap.sh
./configure CC=gcc CFLAGS="-O2 -fsanitize=undefined -ggdb3" CXXFLAGS="-O2
-fsanitize=undefined -ggdb3"
make
export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
make check
./gawk -v SRCDIR=$(pwd)/test -f test/pipeio2.awk
```
Best,
sam
signature.asc
Description: Message signed with OpenPGP