Commit 510f589
Fix threading bugs: recv pointer arithmetic, signal handler safety, dead macro
renderd.c slave_thread recv loop: apply the same fix as upstream commit
fddb0a9 applied to mod_tile.c -- the loop was overwriting ret_size with
each recv() return value instead of accumulating it, and using struct
pointer arithmetic (resp + ret_size) instead of byte arithmetic
((char*)resp + ret_size), so partial reads wrote into the wrong memory
location. Also handle EINTR and separate n==0 (EOF) from n<0 (error).
renderd.c request_exit: remove g_logger/strerror calls from this signal
handler. Both functions are non-async-signal-safe (they use mutexes and
malloc internally). Only write(2) -- which is async-signal-safe -- is
needed here.
render_config.h: remove dead HASHIDX_SIZE 22123 definition in the
#else branch of #ifdef METATILE. METATILE is defined unconditionally
two lines above, so this branch is unreachable. The authoritative value
2213 lives in request_queue.h. The dead definition caused confusion
about which value would be used if METATILE were ever undefined.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 62ee90c commit 510f589
2 files changed
Lines changed: 25 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
174 | 176 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 177 | + | |
181 | 178 | | |
182 | 179 | | |
183 | 180 | | |
| |||
683 | 680 | | |
684 | 681 | | |
685 | 682 | | |
686 | | - | |
687 | | - | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
688 | 702 | | |
689 | | - | |
| 703 | + | |
690 | 704 | | |
691 | 705 | | |
692 | 706 | | |
693 | 707 | | |
694 | 708 | | |
695 | 709 | | |
696 | 710 | | |
697 | | - | |
| 711 | + | |
698 | 712 | | |
699 | 713 | | |
700 | 714 | | |
| |||
0 commit comments