Hello everyone,
I am using ALSA (alsa-lib-1.1.6) on Gentoo laptop with x32 ABI (linux-4.16.7). My mpv (0.27.2) gets segfault each time I try to play video with sound: pashgan@light ~/temp $ mpv ./SampleVideo_1280x720_10mb.mp4 Playing: ./SampleVideo_1280x720_10mb.mp4 (+) Video --vid=1 (*) (h264 1280x720 25.000fps) (+) Audio --aid=1 --alang=und (*) (aac 6ch 48000Hz) AO: [alsa] 48000Hz stereo 2ch float VO: [opengl] 1280x720 yuv420p Segmentation fault
dmesg shows: [12526.319909] traps: mpv/ao[13621] general protection ip:f28ce4fa sp:e46f2d60 error:0 in libasound.so.2.0.0[f2843000+fe000]
gdb session: (gdb) bt #0 0xf29b14fa in mix_areas_32_smp (size=3935624896, dst=0x56a6e7f0, src=0x56a6e7f0, sum=0x1, dst_step=4, src_step=4, sum_step=4) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm_dmix_x86_64.h:143 #1 0xf29b2361 in mix_areas (size=3935493824, dst_ofs=4056, src_ofs=0, dst_areas=0x56a6cd90, src_areas=0x56a6dc30, dmix=0x56a6c900) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm_dmix.c:197 #2 snd_pcm_dmix_sync_area (pcm=pcm@entry=0x56a6d270) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm_dmix.c:379 #3 0xf29b267f in snd_pcm_dmix_start (pcm=<optimized out>) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm_dmix.c:611 #4 0xf2972349 in __snd_pcm_start (pcm=0x56a6d270, pcm=0x56a6d270) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm_local.h:434 #5 snd_pcm_start (pcm=<optimized out>) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm.c:1226 #6 0xf2972349 in __snd_pcm_start (pcm=0x56a6d8b0, pcm=0x56a6d8b0) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm_local.h:434 #7 snd_pcm_start (pcm=<optimized out>) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm.c:1226 #8 0xf2979a78 in __snd_pcm_start (pcm=0x56a52e60, pcm=0x56a52e60) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm_local.h:434 #9 snd1_pcm_write_areas (pcm=pcm@entry=0x56a52e60, areas=areas@entry=0xe47f2f00, offset=offset@entry=0, size=<optimized out>, size@entry=12288, func=func@entry=0xf2988770 <snd_pcm_plugin_write_areas>) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm.c:7421 #10 0xf29890e7 in snd_pcm_plugin_writei (pcm=<optimized out>, buffer=<optimized out>, size=12288) at /tmp/portage/media-libs/alsa-lib-1.1.6-r1/work/alsa-lib-1.1.6/src/pcm/pcm_plugin.c:358 #11 0x56590280 in ?? () #12 0x56594846 in ?? () #13 0xf1b9808b in start_thread () from /libx32/libpthread.so.0 #14 0xf18d4e2f in clone () from /libx32/libc.so.6 (gdb)
Same bug in Gentoo bug tracker: https://bugs.gentoo.org/654754
I need help to investigate pcm_dmix behaviour, I see asm code there (pcm_dmix_x86_64.h:143) but have no idea how can I debug it (my asm experience is far from ok). Can somebody guide me?