Closed
Conversation
pps83
pushed a commit
that referenced
this pull request
May 2, 2024
In order to make MSAN happy:
==2200945==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x596f3b3ed246 in curlx_strtoofft [...]/libcurl/src/lib/strtoofft.c:239:11
#1 0x596f3b402156 in Curl_httpchunk_read [...]/libcurl/src/lib/http_chunks.c:149:12
curl#2 0x596f3b348550 in readwrite_data [...]/libcurl/src/lib/transfer.c:607:11
[...]
==2202041==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5a3fab66a72a in Curl_parse_port [...]/libcurl/src/lib/urlapi.c:547:8
#1 0x5a3fab650645 in parse_authority [...]/libcurl/src/lib/urlapi.c:796:12
curl#2 0x5a3fab6740f6 in parseurl [...]/libcurl/src/lib/urlapi.c:1176:16
curl#3 0x5a3fab664fc5 in parseurl_and_replace [...]/libcurl/src/lib/urlapi.c:1342:12
[...]
==2202320==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x569076a0d6b0 in ipv4_normalize [...]/libcurl/src/lib/urlapi.c:683:12
#1 0x5690769f2820 in parse_authority [...]/libcurl/src/lib/urlapi.c:803:10
curl#2 0x569076a160f6 in parseurl [...]/libcurl/src/lib/urlapi.c:1176:16
curl#3 0x569076a06fc5 in parseurl_and_replace [...]/libcurl/src/lib/urlapi.c:1342:12
[...]
Signed-off-by: Louis Solofrizzo <lsolofrizzo@scaleway.com>
Closes curl#12995
pps83
pushed a commit
that referenced
this pull request
Apr 26, 2025
Before this patch the signal handler called `logmsg()` which in turn called `printf()` variants (internal implementations), and `FILE *` functions, `localtime()`. Some of these called `malloc`/`free`, which isn't supported in s signal handler. Replace them with `write` calls, losing some logging functionality. Also: - De-dupe and move `STD*_FILENO` macros to `lib/curl_setup.h`. Revert the `src` definition to point to `stderr`, instead of `tool_stderr`. Follow-up to e5bb88b curl#11958 POSIX specs with list of functions allowed in a signal handler: 2004: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03 2017: https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03 2024: https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_04_03 Linux CI run with the thread sanitizer going crazy when hitting the signal handler in test 1238 and 1242 (TFTP): ``` WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=12582) #0 malloc <null> (servers+0x5ed70) #1 _IO_file_doallocate <null> (libc.so.6+0x851b4) curl#2 formatf /home/runner/work/curl/curl/bld/tests/server/../../lib/../../lib/mprintf.c:886:9 (servers+0xdff77) [...] WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=12582) #0 free <null> (servers+0x5f453) #1 fclose <null> (libc.so.6+0x8532f) curl#2 logmsg /home/runner/work/curl/curl/bld/tests/server/../../../tests/server/util.c:134:5 (servers+0xe684d) ``` Ref: https://github.com/curl/curl/actions/runs/14118903372/job/39555309490?pr=16851 Closes curl#16852
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.