Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dozreg-toplud
Copy link
Contributor

@dozreg-toplud dozreg-toplud commented Dec 22, 2025

On develop, if a malformed scry URL is queried, we get a leak that ASAN can detect. For example, after hitting F5 ten times at http://localhost:8080/_~_/= and then pressing ctrl-D:

Direct leak of 240 byte(s) in 10 object(s) allocated from:
    #0 0x798dcccf6cbf in malloc (/usr/lib/clang/18/lib/linux/libclang_rt.asan-x86_64.so+0xf6cbf) (BuildId: 4cd39e6608b20f2f5a148a941cd434e0cadcd3dc)
    #1 0x1cd2706 in _http_req_dispatch /home/kirill/work/urbit-repos/vere/pkg/vere/io/http.c:983:29
    #2 0x1cd0dc6 in _http_rec_accept /home/kirill/work/urbit-repos/vere/pkg/vere/io/http.c:1676:7
    #3 0x1ce0378 in call_handlers /home/kirill/.cache/zig/p/N-V-__8AAJ2XqALM9jST2Gu4TIdjPNY2QB8rnmKeepeqr076/lib/core/request.c:155:13
    #4 0x1ea55ca in handle_incoming_request /home/kirill/.cache/zig/p/N-V-__8AAJ2XqALM9jST2Gu4TIdjPNY2QB8rnmKeepeqr076/lib/http1.c:470:13
    #5 0x1bdd68e in uv__read /home/kirill/.cache/zig/p/N-V-__8AAH34QwB6wi5eQK_lFbfDGSN3hRE8l-6Ep198ZsGg/src/unix/stream.c:1148:7
    #6 0x1bdb3b7 in uv__stream_io /home/kirill/.cache/zig/p/N-V-__8AAH34QwB6wi5eQK_lFbfDGSN3hRE8l-6Ep198ZsGg/src/unix/stream.c:1208:5
    #7 0x1bcfc3c in uv__io_poll /home/kirill/.cache/zig/p/N-V-__8AAH34QwB6wi5eQK_lFbfDGSN3hRE8l-6Ep198ZsGg/src/unix/linux.c:1565:11
    #8 0x1bca927 in uv_run /home/kirill/.cache/zig/p/N-V-__8AAH34QwB6wi5eQK_lFbfDGSN3hRE8l-6Ep198ZsGg/src/unix/core.c:460:5
    #9 0x1bbe425 in u3_king_commence /home/kirill/work/urbit-repos/vere/pkg/vere/king.c:1061:3
    #10 0x1323f4e in main /home/kirill/work/urbit-repos/vere/pkg/vere/main.c:3320:5
    #11 0x798dcc829d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

This PR factors out scry-over-HTTP handling into a separate function _http_peek_dispatch with semitransfer semantics for req_u->peq_u and the contained noun.

@dozreg-toplud dozreg-toplud requested a review from a team as a code owner December 22, 2025 18:33
@pkova pkova merged commit 33671ea into develop Jan 9, 2026
2 checks passed
@pkova pkova deleted the dozreg/http-scry-refactor branch January 9, 2026 16:10
pkova added a commit that referenced this pull request Jan 12, 2026
After #932 I decided to take a closer look on memory leak reports on
exit from vere, which were previously shrugged off as false positives on
objects that have static lifetimes.

I found that `_lick_io_exit` forgets to free the path to IPC directory
before freeing the struct itself. I also decided to explicitly annotate
objects that supposedly have static lifetimes, so that LSAN printouts on
exit have less noise.

To review: do the objects annotated with `__lsan_ignore_object` actually
have static lifetimes?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants