Bug#572943: qemu-kvm: Segaults when using sound device

2010-03-07 Thread malc
On Mon, 8 Mar 2010, Michael Tokarev wrote:

> 2 Vassili: full bugreport can be seen online at
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572943
> We (Debian) just updated qemu-kvm from 0.11 to 0.12.3.
> Can you comment please?  Thank you.

If the OP uses SDL, then it's most likely fixed by
ff5414990645653bf43bf64adfc1ca77ffb9edcb i've no idea whether kvm
0.12.3 includes this though, if not i'm interested in seeing
-audio-help output.

[..snip..]

-- 
mailto:av1...@comtv.ru



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#572943: qemu-kvm: Segaults when using sound device

2010-03-07 Thread malc
On Mon, 8 Mar 2010, Michael Tokarev wrote:

> malc wrote:
> > On Mon, 8 Mar 2010, Michael Tokarev wrote:
> > 
> >> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572943
> > 
> > If the OP uses SDL, then it's most likely fixed by
> > ff5414990645653bf43bf64adfc1ca77ffb9edcb i've no idea whether kvm
> > 0.12.3 includes this though, if not i'm interested in seeing
> > -audio-help output.
> 
> No, ff5414990645653bf43bf64adfc1ca77ffb9edcb is not in 0.12.3.
> Oh well.
> 
> Relevant link from the commit:
>  http://bugs.gentoo.org/show_bug.cgi?id=294269
> (and the commit itself, for example:
> http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=ff5414990645653bf43bf64adfc1ca77ffb9edcb
> )

Well, yeah, i know, i authored this commit after all.
 
> It talks about sdl output.  I just tried here with QEMU_AUDIO_DRV=sdl,
> and can reproduce it.
> 
> In Debian we build with
>  --audio-drv-list="alsa oss sdl pa"
> so the default should be alsa not sdl.
> 
> Christian, can you tell us how you've set it to SDL?  Do
> you have $QEMU_AUDIO_DRV set?

Yes he does.
 
> Here's my -audio-help output, from the system where I can finally
> reproduce the thing... but is it really interesting?  To me it
> looks pretty standard...

The only relevant part is the audio driver.
 
[..snip..]

> 
> Thank you!

You are welcome.

-- 
mailto:av1...@comtv.ru



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#572943: qemu-kvm: Segaults when using sound device

2010-03-07 Thread Michael Tokarev
malc wrote:
> On Mon, 8 Mar 2010, Michael Tokarev wrote:
> 
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572943
> 
> If the OP uses SDL, then it's most likely fixed by
> ff5414990645653bf43bf64adfc1ca77ffb9edcb i've no idea whether kvm
> 0.12.3 includes this though, if not i'm interested in seeing
> -audio-help output.

No, ff5414990645653bf43bf64adfc1ca77ffb9edcb is not in 0.12.3.
Oh well.

Relevant link from the commit:
 http://bugs.gentoo.org/show_bug.cgi?id=294269
(and the commit itself, for example:
http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=ff5414990645653bf43bf64adfc1ca77ffb9edcb
)

It talks about sdl output.  I just tried here with QEMU_AUDIO_DRV=sdl,
and can reproduce it.

In Debian we build with
 --audio-drv-list="alsa oss sdl pa"
so the default should be alsa not sdl.

Christian, can you tell us how you've set it to SDL?  Do
you have $QEMU_AUDIO_DRV set?

Here's my -audio-help output, from the system where I can finally
reproduce the thing... but is it really interesting?  To me it
looks pretty standard...

 cut 
Audio options:
  QEMU_AUDIO_DAC_FIXED_SETTINGS: boolean, default = 1
Use fixed settings for host DAC
  QEMU_AUDIO_DAC_FIXED_FREQ: integer, default = 44100
Frequency for fixed host DAC
  QEMU_AUDIO_DAC_FIXED_FMT: format, default = S16, (one of: U8 S8 U16 S16 U32 
S32)
Format for fixed host DAC
  QEMU_AUDIO_DAC_FIXED_CHANNELS: integer, default = 2
Number of channels for fixed DAC (1 - mono, 2 - stereo)
  QEMU_AUDIO_DAC_VOICES: integer, default = 1
Number of voices for DAC
  QEMU_AUDIO_DAC_TRY_POLL: boolean, default = 1
Attempt using poll mode for DAC
  QEMU_AUDIO_ADC_FIXED_SETTINGS: boolean, default = 1
Use fixed settings for host ADC
  QEMU_AUDIO_ADC_FIXED_FREQ: integer, default = 44100
Frequency for fixed host ADC
  QEMU_AUDIO_ADC_FIXED_FMT: format, default = S16, (one of: U8 S8 U16 S16 U32 
S32)
Format for fixed host ADC
  QEMU_AUDIO_ADC_FIXED_CHANNELS: integer, default = 2
Number of channels for fixed ADC (1 - mono, 2 - stereo)
  QEMU_AUDIO_ADC_VOICES: integer, default = 1
Number of voices for ADC
  QEMU_AUDIO_ADC_TRY_POLL: boolean, default = 1
Attempt using poll mode for ADC
  QEMU_AUDIO_TIMER_PERIOD: integer, default = 250
Timer period in HZ (0 - use lowest possible)
  QEMU_AUDIO_PLIVE: boolean, default = 0
(undocumented)
  QEMU_AUDIO_LOG_TO_MONITOR: boolean, default = 0
Print logging messages to monitor instead of stderr

Available drivers:
Name: alsa
Description: ALSA http://www.alsa-project.org
Theoretically supports many playback voices
Theoretically supports many capture voices
Options:
  QEMU_ALSA_DAC_SIZE_IN_USEC: boolean, default = 0
DAC period/buffer size in microseconds (otherwise in frames)
  QEMU_ALSA_DAC_PERIOD_SIZE: integer, default = 1024
DAC period size (0 to go with system default)
  QEMU_ALSA_DAC_BUFFER_SIZE: integer, default = 4096
DAC buffer size (0 to go with system default)
  QEMU_ALSA_ADC_SIZE_IN_USEC: boolean, default = 0
ADC period/buffer size in microseconds (otherwise in frames)
  QEMU_ALSA_ADC_PERIOD_SIZE: integer, default = 0
ADC period size (0 to go with system default)
  QEMU_ALSA_ADC_BUFFER_SIZE: integer, default = 0
ADC buffer size (0 to go with system default)
  QEMU_ALSA_THRESHOLD: integer, default = 0
(undocumented)
  QEMU_ALSA_DAC_DEV: string, default = default
DAC device name (for instance dmix)
  QEMU_ALSA_ADC_DEV: string, default = default
ADC device name
  QEMU_ALSA_VERBOSE: boolean, default = 0
Behave in a more verbose way

Name: oss
Description: OSS http://www.opensound.com
Theoretically supports many playback voices
Theoretically supports many capture voices
Options:
  QEMU_OSS_FRAGSIZE: integer, default = 4096
Fragment size in bytes
  QEMU_OSS_NFRAGS: integer, default = 4
Number of fragments
  QEMU_OSS_MMAP: boolean, default = 0
Try using memory mapped access
  QEMU_OSS_DAC_DEV: string, default = /dev/dsp
Path to DAC device
  QEMU_OSS_ADC_DEV: string, default = /dev/dsp
Path to ADC device
  QEMU_OSS_EXCLUSIVE: boolean, default = 0
Open device in exclusive mode (vmix wont work)
  QEMU_OSS_DEBUG: boolean, default = 0
Turn on some debugging messages

Name: sdl
Description: SDL http://www.libsdl.org
One playback voice
Does not support capture
Options:
  QEMU_SDL_SAMPLES: integer, default = 1024
Size of SDL buffer in samples

Name: pa
Description: http://www.pulseaudio.org/
Theoretically supports many playback voices
Theoretically supports many capture voices
Options:
  QEMU_PA_SAMPLES: integer, default = 1024
buffer size in samples
  QEMU_PA_DIVISOR: integer, default = 2
threshold divisor
  QEMU_PA_SERVER: string, default = (not set)
server address
  QEMU_PA_SINK: string, default = (not set)
sink device name
  QEMU_PA_SOURCE: string, default = (not set)
source device name

Name: none
Description: Timer based audio emulation
Theoretically supports many play

Bug#572943: qemu-kvm: Segaults when using sound device

2010-03-07 Thread Christian Ohm
On Monday,  8 March 2010 at  0:35, malc wrote:
> On Mon, 8 Mar 2010, Michael Tokarev wrote:
> 
> > 2 Vassili: full bugreport can be seen online at
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572943
> > We (Debian) just updated qemu-kvm from 0.11 to 0.12.3.
> > Can you comment please?  Thank you.
> 
> If the OP uses SDL, then it's most likely fixed by
> ff5414990645653bf43bf64adfc1ca77ffb9edcb i've no idea whether kvm
> 0.12.3 includes this though, if not i'm interested in seeing
> -audio-help output.

You're right, I had QEMU_AUDIO_DRV=sdl set - I guess that came from a time when
I was using qemu and the alsa output didn't work right. Setting it to alsa
doesn't crash, and the sound works.

Thanks for the fast answer. I guess you don't need any more info then?

Best regards,
Christian Ohm



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#572943: qemu-kvm: Segaults when using sound device

2010-03-07 Thread Michael Tokarev
2 Vassili: full bugreport can be seen online at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572943
We (Debian) just updated qemu-kvm from 0.11 to 0.12.3.
Can you comment please?  Thank you.

Christian Ohm wrote:
> Package: qemu-kvm
> Version: 0.12.3+dfsg-2
> Severity: important
> 
> Hello,
> 
> The current qemu-kvm segfaults when trying to access a sound device. I've 
> tried
> es1370 and aw97, Windows XP and Debian Etch, doesn't seem to make a 
> difference.
> With 0.11.1+dfsg-1 from testing sound works ok.

I just tried both locally built version and the one from -unstable, with
Windows7, WindowsXP and Debian Lenny images, with both es1370 and ac97.
It all works as expected as far as I can see, at least I don't see any
crashes.  Even tried it on a Lenny system, smp and non-smp... nothing.

> PS: Two gdb backtraces, one full:

Thank you for this.  However this leads to other questions see below.

> GNU gdb (GDB) 7.0.1-debian
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> ...
> Reading symbols from /usr/bin/kvm...Reading symbols from 
> /usr/lib/debug/usr/bin/kvm...done.

Aha, so it correctly finds the debugging files from qemu-kvm-dbg
package, which appears to be installed.  Excellent...

> (no debugging symbols found)...done.

but it can't find debugging symbols, which is.. wrong!..
I wonder what's going on here...

Aha, I see now.  It's gdb which appears to be broken in
current squeeze - in lenny it works fine.  Oh well, it
really is not nice when a debugging tool is buggy... :(

> (gdb) r
> Starting program: /usr/bin/kvm -m 1024 -smp 2 -localtime -soundhw es1370 -vga 
> std -usb -net vde,vlan=0,sock=/var/run/vde2/tap0.ctl -net 
> nic,model=e1000,vlan=0 -hda debian-etch -snapshot
> [Thread debugging using libthread_db enabled]
> [New Thread 0x7fffeefa3910 (LWP 21114)]
> [New Thread 0x7fffee002910 (LWP 21115)]
> [New Thread 0x7fffabdfc910 (LWP 21116)]
> [New Thread 0x7fffaa04f910 (LWP 21119)]
> audio: Failed to create voice `es1370.adc'
> audio: Failed to create voice `es1370.adc'

I remember I've seen similar messages in the past, probably when
a sound device were busy or something like this.  But now I can't
trigger them, and I think this is the difference preventing me
from reproducing the bug.

Can you see what's holding your sound card and try running the
same thing without that holder?  If that's the case anyway...

[]
> *** glibc detected *** /usr/bin/kvm: free(): invalid next size (normal): 
> 0x0137a410 ***

And here, it's probably not very useful: something's corrupting
memory or pointers, which is very difficult to debug.  Should
run whole thing under valgrind perhaps, instead of trying to
get stack traces...

[big snip]

> GNU gdb (GDB) 7.0.1-debian
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> ...
> Reading symbols from /usr/bin/kvm...Reading symbols from 
> /usr/lib/debug/usr/bin/kvm...done.
> (no debugging symbols found)...done.
> (gdb) r
> Starting program: /usr/bin/kvm -m 1024 -localtime -soundhw es1370 -vga std 
> -usb -usbdevice tablet -net vde,vlan=0,sock=/var/run/vde2/tap0.ctl -net 
> nic,model=virtio,vlan=0 -hda XP
> [Thread debugging using libthread_db enabled]
> [New Thread 0x7fffef1a4910 (LWP 20920)]
> [New Thread 0x7fffaca21910 (LWP 20921)]
> [New Thread 0x7fffac1a0910 (LWP 20922)]
> audio: Failed to create voice `es1370.adc'
> audio: Failed to create voice `es1370.adc'

And again the same thing...

> [Thread 0x7fffaca21910 (LWP 20921) exited]
> [New Thread 0x7fffaca21910 (LWP 20945)]
> A bug was just triggered in audio_run_out
> Save all your work and restart without audio
> Please send bug report to av1...@comtv.ru
> I am sorry

But now, that's probably a good advice... Copying av1474... :)

> Context:
> audio: played=880 sw->total_hw_samples_mixed=440
> A bug was just triggered in audio_run_out
> Context:
> audio: played=420 sw->total_hw_samples_mixed=220
> *** glibc detected *** /usr/bin/kvm: free(): invalid pointer: 
> 0x00e75fe0 ***
> === Backtrace: =
> /lib/libc.so.6[0x74fa0d16]
> /lib/libc.so.6(cfree+0x6c)[0x74fa59bc]
> /usr/lib/libX11.so.6[0x75554f32]
> /usr/lib/libX11.so.6(_XReply+0x140)[0x7580]
> /usr/lib/libX11.so.6(XSync

Bug#572943: qemu-kvm: Segaults when using sound device

2010-03-07 Thread Christian Ohm
Package: qemu-kvm
Version: 0.12.3+dfsg-2
Severity: important

Hello,

The current qemu-kvm segfaults when trying to access a sound device. I've tried
es1370 and aw97, Windows XP and Debian Etch, doesn't seem to make a difference.
With 0.11.1+dfsg-1 from testing sound works ok.

Best regards,
Christian Ohm

PS: Two gdb backtraces, one full:

GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/bin/kvm...Reading symbols from 
/usr/lib/debug/usr/bin/kvm...done.
(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/kvm -m 1024 -smp 2 -localtime -soundhw es1370 -vga 
std -usb -net vde,vlan=0,sock=/var/run/vde2/tap0.ctl -net 
nic,model=e1000,vlan=0 -hda debian-etch -snapshot
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffeefa3910 (LWP 21114)]
[New Thread 0x7fffee002910 (LWP 21115)]
[New Thread 0x7fffabdfc910 (LWP 21116)]
[New Thread 0x7fffaa04f910 (LWP 21119)]
audio: Failed to create voice `es1370.adc'
audio: Failed to create voice `es1370.adc'
ALSA lib pcm.c:7236:(snd_pcm_recover) underrun occured
A bug was just triggered in audio_run_out
Save all your work and restart without audio
Please send bug report to av1...@comtv.ru
I am sorry
Context:
audio: played=940 sw->total_hw_samples_mixed=21
A bug was just triggered in audio_run_out
Context:
audio: played=960 sw->total_hw_samples_mixed=940
ALSA lib pcm.c:7236:(snd_pcm_recover) underrun occured
A bug was just triggered in audio_run_out
Context:
audio: played=940 sw->total_hw_samples_mixed=560
A bug was just triggered in audio_run_out
Context:
audio: played=939 sw->total_hw_samples_mixed=400
A bug was just triggered in audio_run_out
Context:
audio: played=979 sw->total_hw_samples_mixed=940
*** glibc detected *** /usr/bin/kvm: free(): invalid next size (normal): 
0x0137a410 ***
=== Backtrace: =
/lib/libc.so.6[0x74fa0d16]
/lib/libc.so.6[0x74fa4904]
/lib/libc.so.6(__libc_memalign+0xc2)[0x74fa6002]
/lib/libc.so.6(posix_memalign+0x49)[0x74fa6269]
/usr/bin/kvm[0x47b177]
/usr/bin/kvm[0x489096]
/usr/bin/kvm[0x489410]
/usr/bin/kvm[0x476f63]
/usr/bin/kvm[0x57bd65]
/usr/bin/kvm[0x57be84]
/usr/bin/kvm[0x437da7]
/usr/bin/kvm[0x438963]
/usr/bin/kvm[0x428382]
/usr/bin/kvm[0x428549]
/usr/bin/kvm[0x428781]
/lib/libpthread.so.0[0x779c373a]
/lib/libc.so.6(clone+0x6d)[0x74ffb69d]
=== Memory map: 
0040-00636000 r-xp  08:01 139120 
/usr/bin/kvm
00835000-00857000 rw-p 00235000 08:01 139120 
/usr/bin/kvm
00857000-01419000 rw-p  00:00 0  [heap]
7fffa400-7fffa4021000 rw-p  00:00 0 
7fffa4021000-7fffa800 ---p  00:00 0 
7fffa8746000-7fffa875b000 r-xp  08:02 1687809
/lib/libgcc_s.so.1
7fffa875b000-7fffa895b000 ---p 00015000 08:02 1687809
/lib/libgcc_s.so.1
7fffa895b000-7fffa895c000 rw-p 00015000 08:02 1687809
/lib/libgcc_s.so.1
7fffa895c000-7fffa90af000 rw-s  00:04 1718779923 
/SYSV (deleted)
7fffa90af000-7fffa90b ---p  00:00 0 
7fffa90b-7fffaa05 rw-p  00:00 0 
7fffaa05-7fffaa09 rw-s  00:04 1709277195 
/SYSV0056a4d6 (deleted)
7fffaa09-7fffaa095000 r-xp  08:01 754477 
/usr/lib/libXfixes.so.3.1.0
7fffaa095000-7fffaa294000 ---p 5000 08:01 754477 
/usr/lib/libXfixes.so.3.1.0
7fffaa294000-7fffaa295000 rw-p 4000 08:01 754477 
/usr/lib/libXfixes.so.3.1.0
7fffaa295000-7fffaa29e000 r-xp  08:01 753066 
/usr/lib/libXcursor.so.1.0.2
7fffaa29e000-7fffaa49e000 ---p 9000 08:01 753066 
/usr/lib/libXcursor.so.1.0.2
7fffaa49e000-7fffaa49f000 rw-p 9000 08:01 753066 
/usr/lib/libXcursor.so.1.0.2
7fffaa49f000-7fffaaa4b000 r--p  08:01 756771 
/usr/lib/locale/locale-archive
7fffaaa4b000-7fffaaa53000 r-xp  08:01 755658 
/usr/lib/libXrandr.so.2.2.0
7fffaaa53000-7fffaac52000 ---p 8000 08:01 755658 
/usr/lib/libXrandr.so.2.2.0
7fffaac52000-7fffaac53000 rw-p 7000 08:01 755658 
/usr/lib/libXrandr.so.2.2.0
7fffaac53000-7fffaac5c000 r-xp  08:01 752308 
/usr/lib/libXrender.so.1.3.0
7fffaac5c000-7fffaae5b000 ---p 9000 08:01 752308 
/usr/lib/libXrender.so.1.3.0
7fffaae5b000-7fffaae5c000 rw-p 8000 08:01 752308