mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pipewire: module-profiler: fix misaligned access
Fix the following misaligned access that happens when `pw-top` is started:
../src/modules/module-profiler.c:144:5: runtime error: member access within misaligned address 0x7f7fa11fe8d9 for type 'struct spa_pod_struct', which requires 4 byte alignment
0x7f7fa11fe8d9: note: pointer points here
60 00 00 01 00 00 00 00 00 00 00 00 88 02 00 00 0f 00 00 00 0a 00 04 00 00 00 00 00 01 00 01 00
^
#0 0x7f7fa64a65e1 in do_flush_event ../src/modules/module-profiler.c:144
#1 0x7f7fa36d658e in source_event_func ../spa/plugins/support/loop.c:650
#2 0x7f7fa36cfbab in loop_iterate ../spa/plugins/support/loop.c:483
#3 0x7f7fa80a71cd in pw_main_loop_run ../src/pipewire/main-loop.c:128
#4 0x55af46ff4722 in main ../src/daemon/pipewire.c:111
#5 0x7f7fa8a3984f (/usr/lib/libc.so.6+0x2384f) (BuildId: 2f005a79cd1a8e385972f5a102f16adba414d75e)
#6 0x7f7fa8a39909 in __libc_start_main (/usr/lib/libc.so.6+0x23909) (BuildId: 2f005a79cd1a8e385972f5a102f16adba414d75e)
#7 0x55af46ff32a4 in _start (src/daemon/pipewire+0x42a4) (BuildId: 2d6250e405f52fb86992fef8584ccfdfdb85569f)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/modules/module-profiler.c:144:5 in
This commit is contained in:
parent
536129343a
commit
0cbcf88eaa
1 changed files with 2 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdalign.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
@ -103,6 +104,7 @@ struct impl {
|
|||
struct spa_source *flush_event;
|
||||
unsigned int listening:1;
|
||||
|
||||
alignas(max_align_t)
|
||||
uint8_t flush[FLUSH_BUFFER + sizeof(struct spa_pod_struct)];
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue