Open zsitvaij opened 4 years ago
This crash occurs inside libsoxr; it is hard to tell if this is a MPD bug or a libsoxr bug. Please paste a disassembly of the crashing function, at least the region around the current instruction pointer, and a dump of all registers.
(gdb) i r
rax 0x0 0
rbx 0x7f719ebfc938 140125971401016
rcx 0x1f6 502
rdx 0x0 0
rsi 0x7f719ebfe050 140125971406928
rdi 0x7f719404c4d0 140125791372496
rbp 0x7f719ebfe050 0x7f719ebfe050
rsp 0x7f719ebfc900 0x7f719ebfc900
r8 0x0 0
r9 0x1 1
r10 0x0 0
r11 0x8 8
r12 0x2 2
r13 0x7f719404c4d8 140125791372504
r14 0x1f6 502
r15 0x7f719ebfe050 140125971406928
rip 0x7f71ab06ba39 0x7f71ab06ba39 <_soxr_deinterleave_f+121>
eflags 0x10246 [ PF ZF IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
(gdb) disass /m
Dump of assembler code for function _soxr_deinterleave_f:
46 {
47 #undef DEINTERLEAVE_TO
48 #define DEINTERLEAVE_TO float
49 switch (data_type & 3) {
0x00007f71ab06b9c0 <+0>: push %r13
0x00007f71ab06b9c2 <+2>: and $0x3,%esi
0x00007f71ab06b9c5 <+5>: push %r12
0x00007f71ab06b9c7 <+7>: vxorps %xmm1,%xmm1,%xmm1
0x00007f71ab06b9cb <+11>: push %rbp
0x00007f71ab06b9cc <+12>: push %rbx
0x00007f71ab06b9cd <+13>: mov %rdx,%rbx
0x00007f71ab06b9d0 <+16>: sub $0x8,%rsp
0x00007f71ab06b9d4 <+20>: mov (%rdx),%rbp
0x00007f71ab06b9d7 <+23>: cmp $0x2,%esi
0x00007f71ab06b9da <+26>: je 0x7f71ab06ba70 <_soxr_deinterleave_f+176>
0x00007f71ab06b9e0 <+32>: cmp $0x3,%esi
0x00007f71ab06b9e3 <+35>: je 0x7f71ab06bb60 <_soxr_deinterleave_f+416>
0x00007f71ab06b9e9 <+41>: cmp $0x1,%esi
0x00007f71ab06b9ec <+44>: je 0x7f71ab06bae0 <_soxr_deinterleave_f+288>
50 case SOXR_FLOAT32: DEINTERLEAVE_FROM(float, 1); break;
0x00007f71ab06b9f2 <+50>: cmp $0x1,%r8d
0x00007f71ab06b9f6 <+54>: jbe 0x7f71ab06bc72 <_soxr_deinterleave_f+690>
0x00007f71ab06b9fc <+60>: test %rcx,%rcx
0x00007f71ab06b9ff <+63>: je 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
0x00007f71ab06ba01 <+65>: lea -0x1(%r8),%r9d
0x00007f71ab06ba05 <+69>: mov %rbp,%rsi
0x00007f71ab06ba08 <+72>: xor %r10d,%r10d
0x00007f71ab06ba0b <+75>: lea 0x1(%r9),%r12
0x00007f71ab06ba0f <+79>: lea 0x0(,%r12,4),%r11
0x00007f71ab06ba17 <+87>: nopw 0x0(%rax,%rax,1)
0x00007f71ab06ba20 <+96>: lea 0x0(,%r10,4),%r8
0x00007f71ab06ba28 <+104>: xor %eax,%eax
0x00007f71ab06ba2a <+106>: nopw 0x0(%rax,%rax,1)
0x00007f71ab06ba30 <+112>: vmovss (%rsi,%rax,4),%xmm0
0x00007f71ab06ba35 <+117>: mov (%rdi,%rax,8),%rdx
=> 0x00007f71ab06ba39 <+121>: vmovss %xmm0,(%rdx,%r8,1)
0x00007f71ab06ba3f <+127>: mov %rax,%rdx
0x00007f71ab06ba42 <+130>: inc %rax
0x00007f71ab06ba45 <+133>: cmp %rdx,%r9
0x00007f71ab06ba48 <+136>: jne 0x7f71ab06ba30 <_soxr_deinterleave_f+112>
0x00007f71ab06ba4a <+138>: inc %r10
0x00007f71ab06ba4d <+141>: add %r11,%rsi
0x00007f71ab06ba50 <+144>: cmp %r10,%rcx
0x00007f71ab06ba53 <+147>: jne 0x7f71ab06ba20 <_soxr_deinterleave_f+96>
0x00007f71ab06ba55 <+149>: imul %r12,%rcx
0x00007f71ab06ba59 <+153>: lea 0x0(%rbp,%rcx,4),%rbp
0x00007f71ab06bc72 <+690>: mov (%rdi),%rdi
0x00007f71ab06bc75 <+693>: lea 0x0(,%rcx,4),%r12
0x00007f71ab06bc8b <+715>: jmpq 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
51 case SOXR_FLOAT64: DEINTERLEAVE_FROM(double, 0); break;
0x00007f71ab06bae0 <+288>: cmp $0x1,%r8d
0x00007f71ab06bae4 <+292>: jbe 0x7f71ab06bc41 <_soxr_deinterleave_f+641>
0x00007f71ab06baea <+298>: test %rcx,%rcx
0x00007f71ab06baed <+301>: je 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
0x00007f71ab06baf3 <+307>: lea -0x1(%r8),%r9d
0x00007f71ab06baf7 <+311>: mov %rbp,%rsi
0x00007f71ab06bafa <+314>: xor %r10d,%r10d
0x00007f71ab06bafd <+317>: lea 0x1(%r9),%r12
0x00007f71ab06bb01 <+321>: lea 0x0(,%r12,8),%r11
0x00007f71ab06bb09 <+329>: nopl 0x0(%rax)
0x00007f71ab06bb10 <+336>: lea 0x0(,%r10,4),%r8
0x00007f71ab06bb18 <+344>: xor %eax,%eax
0x00007f71ab06bb1a <+346>: nopw 0x0(%rax,%rax,1)
0x00007f71ab06bb20 <+352>: mov (%rdi,%rax,8),%rdx
0x00007f71ab06bb24 <+356>: vcvtsd2ss (%rsi,%rax,8),%xmm1,%xmm0
0x00007f71ab06bb29 <+361>: vmovss %xmm0,(%rdx,%r8,1)
0x00007f71ab06bb2f <+367>: mov %rax,%rdx
0x00007f71ab06bb32 <+370>: inc %rax
0x00007f71ab06bb35 <+373>: cmp %rdx,%r9
0x00007f71ab06bb38 <+376>: jne 0x7f71ab06bb20 <_soxr_deinterleave_f+352>
0x00007f71ab06bb3a <+378>: inc %r10
0x00007f71ab06bb3d <+381>: add %r11,%rsi
0x00007f71ab06bb40 <+384>: cmp %r10,%rcx
0x00007f71ab06bb43 <+387>: jne 0x7f71ab06bb10 <_soxr_deinterleave_f+336>
0x00007f71ab06bb45 <+389>: imul %r12,%rcx
0x00007f71ab06bb49 <+393>: lea 0x0(%rbp,%rcx,8),%rbp
0x00007f71ab06bc41 <+641>: test %rcx,%rcx
0x00007f71ab06bc44 <+644>: je 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
0x00007f71ab06bc4a <+650>: mov (%rdi),%rdx
0x00007f71ab06bc4d <+653>: xor %eax,%eax
0x00007f71ab06bc4f <+655>: nop
0x00007f71ab06bc50 <+656>: vmovsd 0x0(%rbp,%rax,8),%xmm0
0x00007f71ab06bc56 <+662>: inc %rax
0x00007f71ab06bc59 <+665>: vcvtsd2ss %xmm0,%xmm0,%xmm0
0x00007f71ab06bc5d <+669>: vmovss %xmm0,-0x4(%rdx,%rax,4)
0x00007f71ab06bc63 <+675>: cmp %rax,%rcx
0x00007f71ab06bc66 <+678>: jne 0x7f71ab06bc50 <_soxr_deinterleave_f+656>
0x00007f71ab06bc68 <+680>: lea 0x0(%rbp,%rcx,8),%rbp
0x00007f71ab06bc6d <+685>: jmpq 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
52 case SOXR_INT32: DEINTERLEAVE_FROM(int32_t, 0); break;
0x00007f71ab06ba70 <+176>: cmp $0x1,%r8d
0x00007f71ab06ba74 <+180>: jbe 0x7f71ab06bbe0 <_soxr_deinterleave_f+544>
0x00007f71ab06ba7a <+186>: test %rcx,%rcx
0x00007f71ab06ba7d <+189>: je 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
0x00007f71ab06ba7f <+191>: lea -0x1(%r8),%r9d
0x00007f71ab06ba83 <+195>: mov %rbp,%rsi
0x00007f71ab06ba86 <+198>: xor %r10d,%r10d
0x00007f71ab06ba89 <+201>: lea 0x1(%r9),%r12
0x00007f71ab06ba8d <+205>: lea 0x0(,%r12,4),%r11
0x00007f71ab06ba95 <+213>: data16 nopw %cs:0x0(%rax,%rax,1)
0x00007f71ab06baa0 <+224>: lea 0x0(,%r10,4),%r8
0x00007f71ab06baa8 <+232>: xor %eax,%eax
0x00007f71ab06baaa <+234>: nopw 0x0(%rax,%rax,1)
0x00007f71ab06bab0 <+240>: mov (%rdi,%rax,8),%rdx
0x00007f71ab06bab4 <+244>: vcvtsi2ssl (%rsi,%rax,4),%xmm1,%xmm0
0x00007f71ab06bab9 <+249>: vmovss %xmm0,(%rdx,%r8,1)
0x00007f71ab06babf <+255>: mov %rax,%rdx
0x00007f71ab06bac2 <+258>: inc %rax
0x00007f71ab06bac5 <+261>: cmp %r9,%rdx
0x00007f71ab06bac8 <+264>: jne 0x7f71ab06bab0 <_soxr_deinterleave_f+240>
0x00007f71ab06baca <+266>: inc %r10
0x00007f71ab06bacd <+269>: add %r11,%rsi
0x00007f71ab06bad0 <+272>: cmp %r10,%rcx
0x00007f71ab06bad3 <+275>: jne 0x7f71ab06baa0 <_soxr_deinterleave_f+224>
0x00007f71ab06bad5 <+277>: jmpq 0x7f71ab06ba55 <_soxr_deinterleave_f+149>
0x00007f71ab06bada <+282>: nopw 0x0(%rax,%rax,1)
0x00007f71ab06bbe0 <+544>: test %rcx,%rcx
0x00007f71ab06bbe3 <+547>: je 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
0x00007f71ab06bbe9 <+553>: mov (%rdi),%rsi
0x00007f71ab06bbec <+556>: xor %edx,%edx
0x00007f71ab06bbee <+558>: xchg %ax,%ax
0x00007f71ab06bbf0 <+560>: mov 0x0(%rbp,%rdx,4),%eax
0x00007f71ab06bbf4 <+564>: inc %rdx
0x00007f71ab06bbf7 <+567>: vcvtsi2ss %eax,%xmm1,%xmm0
0x00007f71ab06bbfb <+571>: vmovss %xmm0,-0x4(%rsi,%rdx,4)
0x00007f71ab06bc01 <+577>: cmp %rdx,%rcx
0x00007f71ab06bc04 <+580>: jne 0x7f71ab06bbf0 <_soxr_deinterleave_f+560>
0x00007f71ab06bc06 <+582>: lea 0x0(%rbp,%rcx,4),%rbp
0x00007f71ab06bc0b <+587>: jmpq 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
53 case SOXR_INT16: DEINTERLEAVE_FROM(int16_t, 0); break;
0x00007f71ab06ba5e <+158>: mov %rbp,(%rbx)
0x00007f71ab06ba61 <+161>: add $0x8,%rsp
0x00007f71ab06ba65 <+165>: pop %rbx
0x00007f71ab06ba66 <+166>: pop %rbp
0x00007f71ab06ba67 <+167>: pop %r12
0x00007f71ab06ba69 <+169>: pop %r13
0x00007f71ab06ba6b <+171>: retq
0x00007f71ab06ba6c <+172>: nopl 0x0(%rax)
0x00007f71ab06bb4e <+398>: mov %rbp,(%rbx)
0x00007f71ab06bb51 <+401>: add $0x8,%rsp
0x00007f71ab06bb55 <+405>: pop %rbx
0x00007f71ab06bb56 <+406>: pop %rbp
0x00007f71ab06bb57 <+407>: pop %r12
0x00007f71ab06bb59 <+409>: pop %r13
0x00007f71ab06bb5b <+411>: retq
0x00007f71ab06bb5c <+412>: nopl 0x0(%rax)
0x00007f71ab06bb60 <+416>: cmp $0x1,%r8d
0x00007f71ab06bb64 <+420>: jbe 0x7f71ab06bc10 <_soxr_deinterleave_f+592>
0x00007f71ab06bb6a <+426>: test %rcx,%rcx
0x00007f71ab06bb6d <+429>: je 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
0x00007f71ab06bb73 <+435>: lea -0x1(%r8),%r10d
0x00007f71ab06bb77 <+439>: xor %r11d,%r11d
0x00007f71ab06bb7a <+442>: mov %rbp,%r8
0x00007f71ab06bb7d <+445>: lea 0x1(%r10),%r13
0x00007f71ab06bb81 <+449>: lea 0x0(%r13,%r13,1),%r12
0x00007f71ab06bb86 <+454>: nopw %cs:0x0(%rax,%rax,1)
0x00007f71ab06bb90 <+464>: lea 0x0(,%r11,4),%r9
0x00007f71ab06bb98 <+472>: xor %edx,%edx
0x00007f71ab06bb9a <+474>: nopw 0x0(%rax,%rax,1)
0x00007f71ab06bba0 <+480>: movswl (%r8,%rdx,2),%eax
0x00007f71ab06bba5 <+485>: mov (%rdi,%rdx,8),%rsi
0x00007f71ab06bba9 <+489>: vcvtsi2ss %eax,%xmm1,%xmm0
0x00007f71ab06bbad <+493>: mov %rdx,%rax
0x00007f71ab06bbb0 <+496>: vmovss %xmm0,(%rsi,%r9,1)
0x00007f71ab06bbb6 <+502>: inc %rdx
0x00007f71ab06bbb9 <+505>: cmp %rax,%r10
0x00007f71ab06bbbc <+508>: jne 0x7f71ab06bba0 <_soxr_deinterleave_f+480>
0x00007f71ab06bbbe <+510>: inc %r11
0x00007f71ab06bbc1 <+513>: add %r12,%r8
0x00007f71ab06bbc4 <+516>: cmp %r11,%rcx
0x00007f71ab06bbc7 <+519>: jne 0x7f71ab06bb90 <_soxr_deinterleave_f+464>
0x00007f71ab06bbc9 <+521>: imul %r13,%rcx
0x00007f71ab06bbcd <+525>: lea 0x0(%rbp,%rcx,2),%rbp
0x00007f71ab06bbd2 <+530>: mov %rbp,(%rbx)
0x00007f71ab06bbd5 <+533>: add $0x8,%rsp
0x00007f71ab06bbd9 <+537>: pop %rbx
0x00007f71ab06bbda <+538>: pop %rbp
0x00007f71ab06bbdb <+539>: pop %r12
0x00007f71ab06bbdd <+541>: pop %r13
0x00007f71ab06bbdf <+543>: retq
0x00007f71ab06bc10 <+592>: test %rcx,%rcx
0x00007f71ab06bc13 <+595>: je 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
0x00007f71ab06bc19 <+601>: mov (%rdi),%rsi
0x00007f71ab06bc1c <+604>: xor %edx,%edx
0x00007f71ab06bc1e <+606>: xchg %ax,%ax
0x00007f71ab06bc20 <+608>: movswl 0x0(%rbp,%rdx,2),%eax
0x00007f71ab06bc25 <+613>: inc %rdx
0x00007f71ab06bc28 <+616>: vcvtsi2ss %eax,%xmm1,%xmm0
0x00007f71ab06bc2c <+620>: vmovss %xmm0,-0x4(%rsi,%rdx,4)
0x00007f71ab06bc32 <+626>: cmp %rdx,%rcx
0x00007f71ab06bc35 <+629>: jne 0x7f71ab06bc20 <_soxr_deinterleave_f+608>
0x00007f71ab06bc37 <+631>: lea 0x0(%rbp,%rcx,2),%rbp
0x00007f71ab06bc3c <+636>: jmpq 0x7f71ab06ba5e <_soxr_deinterleave_f+158>
End of assembler dump.
EDIT: I amended the disassembly with /m to associate source lines with. Thanks for looking into this!
libsoxr source code is very obscure and riddled with macros... shudder.... This:
0x00007f71ab06ba30 <+112>: vmovss (%rsi,%rax,4),%xmm0
0x00007f71ab06ba35 <+117>: mov (%rdi,%rax,8),%rdx
=> 0x00007f71ab06ba39 <+121>: vmovss %xmm0,(%rdx,%r8,1)
is from data-io.c
:
dest[i][j] = (DEINTERLEAVE_TO)*src++;
Here, dest=%rdi=0x7f719404c4d0
and i=%rax=0
but dest[0]=NULL
, so it's trying to write to the NULL
pointer. This pointer however is not given by MPD; it is allocated internally by libsoxr:
STATIC real * _soxr_input(rate_t * p, real const * samples, size_t n)
{
if (p->flushing)
return 0;
p->samples_in += (int64_t)n;
return fifo_write(&p->stages[0].fifo, (int)n, samples);
}
So the null pointer is generated while flushing... the code in version 0.1.2 however looked like this:
static sample_t * rate_input(rate_t * p, sample_t const * samples, size_t n)
{
p->samples_in += n;
return fifo_write(&p->stages[0].fifo, (int)n, samples);
}
Which means: this is a breaking libsoxr API change, but I can't find any documentation. Not even the NEWS
file mentions anything related.
Bottom line: libsoxr fucked up.
This very obscure badly documented doing-everything-in-one commit broke it: https://sourceforge.net/p/soxr/code/ci/52888cd410ae356bf3aa26d8fa106754b8fd8990 Given that the code is extremely ugly, and there is no API documentation and no usable changelog, and now this crash bug, maybe the best idea would be to remove libsoxr support from MPD ... or refuse to build with 0.1.3 for now.
Thanks! I'll recompile with another resampling method, I don't remember the rationale for choosing soxr in the first place.
You can switch at runtime between all resamplers that have been enabled at compile time: https://www.musicpd.org/doc/html/plugins.html#resampler-plugins
I see "internal" would have worked, but I didn't have libsamplerate enabled until now, and a recompile was under a minute.
Looking at the backtrace above, I can see that soxr_process is being called with an input size of 502. This doesn’t seem consistent with the analysis ‘the null pointer is generated while flushing’, since when flushing, no input should be being supplied. I wonder, is it possible that MPD is attempting to reuse a soxr context without having called SoxrPcmResampler::Reset()?
Is that necessary? Where is that documented?
It seems so: a simple standalone test where I tried to use a soxr context for two consecutive streams (with flushing) either succeeds or fails with or without using soxr_clear respectively. However, if this is what is happening for the OP, not sure why it would be intermittent. Wondering if seamless transition between tracks with the same sample-rate (e.g. a segue) which should have no flushing, no reset/clear, might be involved here.
The soxr documentation on this is not as explicit as it might be; soxr.h has: setting `in' to NULL when no data is available nor shall be available, and soxr_clear() as: Ready for fresh signal, same config.
"not as explicit as it might be" is an understatement. The "documentation" is not only not explicit, it is also not even implicit. Nothing in these brief comments tells me that calling soxr_clear() is necessary, ever. This is the kind of thing which is utterly important to document - it is a vital part of the semantic API of a library.
Bump, if anyone can help with the following, I'd be very interested to hear: "Looking at the backtrace above, I can see that soxr_process is being called with an input size of 502. This doesn’t seem consistent with the analysis ‘the null pointer is generated while flushing’, since when flushing, no input should be being supplied. I wonder, is it possible that MPD is attempting to reuse a soxr context without having called SoxrPcmResampler::Reset()? However, if this is what is happening for the OP, not sure why it would be intermittent."
@MaxKellermann, it would be good to be able get to the bottom of this issue—are you able to help with the above questions?
I seem to be having a similar issue:
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 0, dts 0
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: All info found
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0: start_time: 0 duration: 240.043
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 1: start_time: 0 duration: 240.043
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: format: start_time: 0 duration: 240.043 (estimate from stream) bitrate=255 kb/s
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: After avformat_find_stream_info() pos: 67 bytes read:94115 seeks:2 frames:2
ffmpeg: codec 'aac'
decoder: audio_format=48000:f:2, seekable=true
client: [12] command returned 0
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 1, dts 21333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 2, dts 42667
playlist: queue song 18:"infected_mushroom/infected_mushroom-blue_rythmic_night__feat._i._zen_-128kbps.mp3"
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 3, dts 64000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 4, dts 85333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 5, dts 106667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 6, dts 128000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 7, dts 149333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 8, dts 170667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 9, dts 192000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 10, dts 213333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 11, dts 234667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 12, dts 256000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 13, dts 277333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 14, dts 298667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 15, dts 320000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 16, dts 341333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 17, dts 362667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 18, dts 384000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 19, dts 405333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 20, dts 426667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 21, dts 448000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 22, dts 469333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 23, dts 490667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 24, dts 512000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 25, dts 533333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 26, dts 554667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 27, dts 576000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 28, dts 597333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 29, dts 618667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 30, dts 640000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 31, dts 661333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 32, dts 682667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 33, dts 704000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 34, dts 725333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 35, dts 746667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 36, dts 768000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 37, dts 789333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 38, dts 810667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 39, dts 832000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 40, dts 853333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 41, dts 874667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 42, dts 896000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 43, dts 917333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 44, dts 938667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 45, dts 960000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 46, dts 981333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 47, dts 1002667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 48, dts 1024000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 49, dts 1045333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 50, dts 1066667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 51, dts 1088000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 52, dts 1109333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 53, dts 1130667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 54, dts 1152000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 55, dts 1173333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 56, dts 1194667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 57, dts 1216000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 58, dts 1237333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 59, dts 1258667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 60, dts 1280000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 61, dts 1301333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 62, dts 1322667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 63, dts 1344000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 64, dts 1365333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 65, dts 1386667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 66, dts 1408000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 67, dts 1429333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 68, dts 1450667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 69, dts 1472000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 70, dts 1493333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 71, dts 1514667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 72, dts 1536000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 73, dts 1557333
output: opened "mpd pipewire" (pipewire) audio_format=48000:f:2
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 74, dts 1578667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 75, dts 1600000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 76, dts 1621333
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 77, dts 1642667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 78, dts 1664000
soxr: soxr engine 'cr32s'
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 79, dts 1685333
soxr: soxr precision=20, phase_response=50.00, passband_end=0.91, stopband_begin=1.00
soxr: samplerate conversion ratio to 0.92
output: converting in=48000:f:2 -> f=48000:f:2 -> out=44100:16:2
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 80, dts 1706667
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 81, dts 1728000
ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, sample 82, dts 1749333
[1] 2254 segmentation fault mpd --no-daemon --verbose --stdout
△ ~ mpd --version 10m
Music Player Daemon 0.23.9 (0.23.9)
Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2021 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Database plugins:
simple proxy
Storage plugins:
local
Decoders plugins:
[mad] mp3 mp2
[mpg123] mp3
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[audiofile] wav au aiff aif
[dsdiff] dff
[dsf] dsf
[hybrid_dsd] m4a
[faad] aac
[ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve rtp:// rtsp:// rtsps://
[gme] ay gbs gym hes kss nsf nsfe rsn sap spc vgm vgz
[pcm]
Filters:
soxr
Tag plugins:
id3tag
Output plugins:
shout null fifo pipe alsa openal pipewire httpd recorder
Encoder plugins:
null vorbis lame wave flac
Archive plugins:
[bz2] bz2
[zzip] zip
Input plugins:
file io_uring archive alsa qobuz curl ffmpeg
Playlist plugins:
extm3u m3u pls soundcloud flac cue embcue
Protocols:
file:// alsa:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mmsh:// mmst:// qobuz:// rtmp:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtp:// rtsp:// rtsps:// scp:// sftp:// smb:// srtp://
Other features:
dbus epoll icu inotify ipv6 tcp un
@mrusme your post was not helpful because it does not contain a backtrace. So far, we only know it's "similar" because it also crashes, but that's useless for debugging this issue.
@MaxKellermann understood, will update MPD to the latest GitHub commit and try again with gdb/strace or similar tooling. However, if running --verbose
is not helpful it might be worth increasing the verbosity in order to at least get a bit more insights out of these kind of crashes. I'd argue that not everyone using mpd is knowledgeable enough to backtrace a segfault, so maybe a little more debug output might be helpful in first place. :-)
Bug report
Describe the bug
MPD sometimes crashes on song change. Sometimes the same playlist runs unchanged for days without issue, other times crashes almost immediately after server starts. No local audio output, just icecast and httpd. Client used for control is ncmpc.
Expected Behavior
No segfault.
Actual Behavior
Segfault.
Version
Build configuration
Distro is Gentoo with the following USE flags: chromaprint cue curl dbus debug eventfd faad ffmpeg flac icu inotify ipv6 libmpdclient libsoxr network opus pulseaudio signalfd sqlite systemd udisks unicode vorbis -alsa -ao -audiofile -bzip2 -cdio -expat -fifo -fluidsynth -gme -id3tag -jack -lame -libav -libsamplerate -mad -mikmod -mms -modplug -mpg123 -musepack -nfs -openal -oss -pipe -qobuz -recorder -samba (-selinux) -sid -sndfile -soundcloud -test -tidal -twolame -upnp -wavpack -webdav -wildmidi -zeroconf -zip -zlib
This results in the following meson command:
Log
~/.mpd/log abbreviated:
Backtrace
Config file
I have multiple outputs defined, but only icecast and vorbis httpd is enabled. I realize I have zeroconf disabled at build time, I forgot to update my config to reflect it.