https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115137

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
Notable bits:
* -fno-strict-aliasing makes no difference
* -fno-strict-overflow stops the hang
* -fsanitize=address,undefined shows nothing with < GCC 15
* With GCC 15 only, I get

```
$ ./z
url.c:1575:41: runtime error: load of address 0x557b31e7c12e with insufficient
space for an object of type 'const char'
0x557b31e7c12e: note: pointer points here
 74 6d 6c 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00
00 00 00 00 00  00 00
             ^ 
    #0 0x557b31e7b681 in append_uri_pathel /home/sam/git/wget/backup/url.c:1575
    #1 0x557b31e7b94b in test_append_uri_pathel
/home/sam/git/wget/backup/url.c:1667
    #2 0x557b31e7a3a8 in main /home/sam/git/wget/backup/url.c:1679
    #3 0x7f251342df49  (/usr/lib64/libc.so.6+0x25f49)
    #4 0x7f251342e004 in __libc_start_main (/usr/lib64/libc.so.6+0x26004)
    #5 0x557b31e7a400 in _start (/home/sam/git/wget/backup/z+0x4400)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior url.c:1575:41 in 
Aborted (core dumped)
```

But only when building with `-O2 -fsanitize=address,undefined`. -O3 with
ASAN+UBSAN is fine.

Reply via email to