memcpy spinning #314

Open
opened 2026-01-29 20:41:51 +00:00 by claunia · 0 comments
Owner

Originally created by @splitice on GitHub (Apr 14, 2020).

Today on a production service we saw near 100% cpu usage. Some quick debugging with GDB and ltrace revealed brotli spinning in a 0 byte memcpy.

memcpy(0x5690200, "", 0)        = 0x5690200
[...]
memcpy(0x5690200, "", 0)        = 0x5690200

gdb revealed this to be Brotli:

Breakpoint 1, __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:25
25      ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file or directory.
(gdb) bt
#0  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:25
#1  0x0000000000932c4e in WriteRingBuffer ()
#2  0x0000000000935a7e in BrotliDecoderDecompressStream ()
#3  0x000000000061cf04 in ngx_http_brunzip_filter_inflate ()

We are still troubleshooting this. However I thought I would ask if anyone has encountered something similar, or if there is any common traps that we could fall into that could cause this behavior?

Revision: c435f06675

Originally created by @splitice on GitHub (Apr 14, 2020). Today on a production service we saw near 100% cpu usage. Some quick debugging with GDB and ltrace revealed brotli spinning in a 0 byte memcpy. ``` memcpy(0x5690200, "", 0) = 0x5690200 [...] memcpy(0x5690200, "", 0) = 0x5690200 ``` gdb revealed this to be Brotli: ``` Breakpoint 1, __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:25 25 ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file or directory. (gdb) bt #0 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:25 #1 0x0000000000932c4e in WriteRingBuffer () #2 0x0000000000935a7e in BrotliDecoderDecompressStream () #3 0x000000000061cf04 in ngx_http_brunzip_filter_inflate () ``` We are still troubleshooting this. However I thought I would ask if anyone has encountered something similar, or if there is any common traps that we could fall into that could cause this behavior? Revision: c435f066751ef83aa4194445085a70ad9d193704
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#314