mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
pulsecore: Add exception judgment to fix the crash when playing music
When playing music for a period of time, the Shared Memory is frequently accessed, and occasionally read/write errors occur, which causes the program to crash [Current thread is 1 (Thread 0xffff86823010 (LWP 2841))] (gdb) bt 0 0x0000ffff8702a714 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 1 0x0000ffff870188e8 in __GI_abort () at abort.c:79 2 0x0000ffff873b5728 in do_read (p=p@entry=0x3673a170, re=re@entry=0x3673a338) at pulsecore/pstream.c:856 3 0x0000ffff873b7fd8 in do_pstream_read_write (p=0x3673a170) at pulsecore/pstream.c:248 4 0x0000ffff873b8368 in srb_callback (srb=<optimized out>, userdata=0x3673a170) at pulsecore/pstream.c:287 5 0x0000ffff873b8bec in srbchannel_rwloop (sr=0x36766ae0) at pulsecore/srbchannel.c:190 6 0x0000ffff87339c70 in dispatch_pollfds (m=0x36670db0) at pulse/mainloop.c:655 7 0x0000ffff87339c70 in pa_mainloop_dispatch (m=m@entry=0x36670db0) at pulse/mainloop.c:898 8 0x0000ffff8733a01c in pa_mainloop_iterate (m=0x36670db0, block=<optimized out>, retval=0xffffd9683030) at pulse/mainloop.c:929 9 0x0000ffff8733a0d8 in pa_mainloop_run (m=m@entry=0x36670db0, retval=retval@entry=0xffffd9683030) at pulse/mainloop.c:945 10 0x0000000000406894 in main (argc=<optimized out>, argv=<optimized out>) at daemon/main.c:1144 Signed-off-by: zhaochengyi <zhaochengyi@uniontech.com>
This commit is contained in:
parent
f32977831a
commit
b5a6365f18
1 changed files with 10 additions and 2 deletions
|
|
@ -244,8 +244,16 @@ static void do_pstream_read_write(pa_pstream *p) {
|
|||
p->mainloop->defer_enable(p->defer_event, 0);
|
||||
|
||||
if (!p->dead && p->srb) {
|
||||
do_write(p);
|
||||
while (!p->dead && do_read(p, &p->readsrb) == 0);
|
||||
int r = 0;
|
||||
|
||||
if(do_write(p) < 0)
|
||||
goto fail;
|
||||
|
||||
while (!p->dead && r == 0) {
|
||||
r = do_read(p, &p->readsrb);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (!p->dead && pa_iochannel_is_readable(p->io)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue