kernel BUG at mm/slab.c:3231!

Bug #1191716 reported by Dieter Stubler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
Invalid
Undecided
Unassigned

Bug Description

Hallo,

when capturing sound from my usb sound card (DeLock -Virtual 7.1 Sound - Xear 3D Sound) using pyaudio everything is work as expected at the beginning.

My system is an unchanged out of the box:

Linux raspberrypi 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l GNU/Linux

After a while (sometimes minuts, some hours) the sound capturing breaks and my system istn't working good afterwards.
Seems that the also sound driver is running wild derstroying the integrity of whole system.

syslog shows:

Jun 17 07:17:01 raspberrypi kernel: [34045.381754] ------------[ cut here ]------------
Jun 17 07:17:01 raspberrypi kernel: [34045.385121] WARNING: at include/linux/kref.h:42 usb_get_urb+0x40/0x48()
Jun 17 07:17:01 raspberrypi kernel: [34045.388319] Modules linked in: snd_bcm2835 evdev 8192cu leds_gpio led_class snd_usb_audio snd_pcm snd_page_alloc snd_hwdep snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_timer snd_seq_device snd cm109
Jun 17 07:17:01 raspberrypi kernel: [34045.398059] [<c0013a7c>] (unwind_backtrace+0x0/0xf0) from [<c001e2b4>] (warn_slowpath_common+0x4c/0x64)
Jun 17 07:17:01 raspberrypi kernel: [34045.404332] [<c001e2b4>] (warn_slowpath_common+0x4c/0x64) from [<c001e2e8>] (warn_slowpath_null+0x1c/0x24)
Jun 17 07:17:01 raspberrypi kernel: [34045.410598] [<c001e2e8>] (warn_slowpath_null+0x1c/0x24) from [<c027473c>] (usb_get_urb+0x40/0x48)
Jun 17 07:17:01 raspberrypi kernel: [34045.416893] [<c027473c>] (usb_get_urb+0x40/0x48) from [<c02732a8>] (usb_hcd_submit_urb+0x2c/0x77c)
Jun 17 07:17:01 raspberrypi kernel: [34045.423257] [<c02732a8>] (usb_hcd_submit_urb+0x2c/0x77c) from [<bf08c2dc>] (snd_usb_endpoint_start+0x160/0x368 [snd_usb_audio])
Jun 17 07:17:01 raspberrypi kernel: [34045.429681] [<bf08c2dc>] (snd_usb_endpoint_start+0x160/0x368 [snd_usb_audio]) from [<bf091e58>] (start_endpoints+0xec/0x170 [snd_usb_audio])
Jun 17 07:17:01 raspberrypi kernel: [34045.436153] [<bf091e58>] (start_endpoints+0xec/0x170 [snd_usb_audio]) from [<bf092f70>] (snd_usb_substream_capture_trigger+0x38/0xb0 [snd_usb_audio])
Jun 17 07:17:01 raspberrypi kernel: [34045.442668] [<bf092f70>] (snd_usb_substream_capture_trigger+0x38/0xb0 [snd_usb_audio]) from [<bf070ff8>] (snd_pcm_do_start+0x2c/0x30 [snd_pcm])
Jun 17 07:17:01 raspberrypi kernel: [34045.449120] [<bf070ff8>] (snd_pcm_do_start+0x2c/0x30 [snd_pcm]) from [<bf070bdc>] (snd_pcm_action_single+0x38/0x78 [snd_pcm])
Jun 17 07:17:01 raspberrypi kernel: [34045.455549] [<bf070bdc>] (snd_pcm_action_single+0x38/0x78 [snd_pcm]) from [<bf070f38>] (snd_pcm_action_lock_irq+0xac/0xe0 [snd_pcm])
Jun 17 07:17:01 raspberrypi kernel: [34045.462015] [<bf070f38>] (snd_pcm_action_lock_irq+0xac/0xe0 [snd_pcm]) from [<bf071c90>] (snd_pcm_common_ioctl1+0x214/0xf0c [snd_pcm])
Jun 17 07:17:01 raspberrypi kernel: [34045.468690] [<bf071c90>] (snd_pcm_common_ioctl1+0x214/0xf0c [snd_pcm]) from [<bf0729b8>] (snd_pcm_capture_ioctl1+0x30/0x490 [snd_pcm])
Jun 17 07:17:01 raspberrypi kernel: [34045.475379] [<bf0729b8>] (snd_pcm_capture_ioctl1+0x30/0x490 [snd_pcm]) from [<c00d1f7c>] (do_vfs_ioctl+0x80/0x5d0)
Jun 17 07:17:01 raspberrypi kernel: [34045.481969] [<c00d1f7c>] (do_vfs_ioctl+0x80/0x5d0) from [<c00d2500>] (sys_ioctl+0x34/0x60)
Jun 17 07:17:01 raspberrypi kernel: [34045.488507] [<c00d2500>] (sys_ioctl+0x34/0x60) from [<c000da60>] (ret_fast_syscall+0x0/0x30)
Jun 17 07:17:01 raspberrypi kernel: [34045.495020] ---[ end trace b9acafc6edf0c7f6 ]---

this is repeating many times (i think every time my program is trying to capture)

after that the system isn't working in aseterministic way any more and behaviour isn't always the same.
Somtimes i cannot kill the python program running the capturing any more (kill -9 doesn't work!).
Sometimes i get strange messages beginning with:

kernel:[30925.236759] Internal error: Oops: 5 [#1] PREEMPT ARM
...

followed by:

kernel:[30925.267375] Process sh (pid: 2652, stack limit = 0xd8e94268)

where the process is not always the same, somtimes python, sometimes a sh, ...

The last time cron was the victim:

Jun 17 08:17:01 raspberrypi kernel: [37645.786662] ------------[ cut here ]------------
Jun 17 08:17:01 raspberrypi kernel: [37645.789979] kernel BUG at mm/slab.c:3231!
Jun 17 08:17:01 raspberrypi kernel: [37645.793076] Internal error: Oops - BUG: 0 [#2] PREEMPT ARM
Jun 17 08:17:01 raspberrypi kernel: [37645.796206] Modules linked in: snd_bcm2835 evdev 8192cu leds_gpio led_class snd_usb_audio snd_pcm snd_page_alloc snd_hwdep snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_timer snd_seq_device snd cm109
Jun 17 08:17:01 raspberrypi kernel: [37645.805614] CPU: 0 Tainted: G D W (3.6.11+ #456)
Jun 17 08:17:01 raspberrypi kernel: [37645.808672] PC is at cache_alloc_refill+0x27c/0x6a0
Jun 17 08:17:01 raspberrypi kernel: [37645.811670] LR is at __kmalloc+0xc4/0x11c
Jun 17 08:17:01 raspberrypi kernel: [37645.814574] pc : [<c00bc728>] lr : [<c00bcc10>] psr: a0000093
Jun 17 08:17:01 raspberrypi kernel: [37645.814574] sp : d8e8bf28 ip : 00000000 fp : 00200200
Jun 17 08:17:01 raspberrypi kernel: [37645.820298] r10: da8021b0 r9 : da8021a0 r8 : c05df6a0
Jun 17 08:17:01 raspberrypi kernel: [37645.823083] r7 : da800240 r6 : da803c00 r5 : 00000010 r4 : d8daf000
Jun 17 08:17:01 raspberrypi kernel: [37645.825841] r3 : 00000014 r2 : da80029c r1 : ffffd698 r0 : da800240
Jun 17 08:17:01 raspberrypi kernel: [37645.828545] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Jun 17 08:17:01 raspberrypi kernel: [37645.831244] Control: 00c5387d Table: 18e70008 DAC: 00000015
Jun 17 08:17:01 raspberrypi kernel: [37645.833894] Process cron (pid: 2680, stack limit = 0xd8e8a268)
Jun 17 08:17:01 raspberrypi kernel: [37645.836513] Stack: (0xd8e8bf28 to 0xd8e8c000)
Jun 17 08:17:01 raspberrypi kernel: [37645.839107] bf20: 00000000 000200d0 00000000 d8e8a000 da5334d0 00000002
Jun 17 08:17:01 raspberrypi kernel: [37645.844128] bf40: a0000013 da800240 000200d0 00b10178 d8e8a000 00000000 00b12448 c00bcc10
Jun 17 08:17:01 raspberrypi kernel: [37645.849110] bf60: da94e1e0 00000002 b6b7b194 00000001 000000ce c00422ec da94e1e0 00000002
Jun 17 08:17:01 raspberrypi kernel: [37645.854147] bf80: b6b7b194 b6fd2000 000000ce c004252c be9e836c b6b7b194 b6fd2000 000000ce
Jun 17 08:17:01 raspberrypi kernel: [37645.859355] bfa0: c000dbe8 c000da60 be9e836c b6b7b194 00000002 00b10178 00b10c68 b6fd2000
Jun 17 08:17:01 raspberrypi kernel: [37645.864751] bfc0: be9e836c b6b7b194 b6fd2000 000000ce b6b79174 00b10c68 b6b7b194 00b12448
Jun 17 08:17:01 raspberrypi kernel: [37645.870258] bfe0: 00000002 be9e8348 b6b63240 b6b633f0 60000010 00000002 00000000 00000000
Jun 17 08:17:01 raspberrypi kernel: [37645.875804] [<c00bc728>] (cache_alloc_refill+0x27c/0x6a0) from [<c00bcc10>] (__kmalloc+0xc4/0x11c)
Jun 17 08:17:01 raspberrypi kernel: [37645.881543] [<c00bcc10>] (__kmalloc+0xc4/0x11c) from [<c00422ec>] (groups_alloc+0x2c/0xc4)
Jun 17 08:17:01 raspberrypi kernel: [37645.887448] [<c00422ec>] (groups_alloc+0x2c/0xc4) from [<c004252c>] (sys_setgroups+0x2c/0xfc)
Jun 17 08:17:01 raspberrypi kernel: [37645.893575] [<c004252c>] (sys_setgroups+0x2c/0xfc) from [<c000da60>] (ret_fast_syscall+0x0/0x30)
Jun 17 08:17:01 raspberrypi kernel: [37645.899861] Code: e3520000 0affffbb eb0b64fa eaffffb9 (e7f001f2)
Jun 17 08:17:01 raspberrypi kernel: [37645.906292] ---[ end trace b9acafc6edf0c7f7 ]---
Jun 17 08:17:01 raspberrypi kernel: [37645.909475] note: cron[2680] exited with preempt_count 1

This is my python program which just grabbing mic input and doing fft spectrum analysis:
I' running it in an lxterminal which is shown on my PC Xserver.
I'm using EDIMAX EW-7811UN Wireless USB Adapter directly connect to the raspberry and the usb sound card (DeLock -Virtual 7.1 Sound - Xear 3D Sound) is connect via an AmazonBasics USB 2.0 Ultra Mini Hub

from pylab import *
import time
import pyaudio
import numpy
import sys

device = 1
sampFreq = 44100
numSamples = 512 # muss eine 2er potenz sein!!
ESC = chr(27)

def clearScreen():
    sys.stdout.write(ESC + '[2J')

def cursorHome():
    sys.stdout.write(ESC + '[H')

pyaud = pyaudio.PyAudio()

clearScreen()
cursorHome()

window = np.blackman(numSamples)

freqs = arange(0, numSamples/2+1, 1.0) * (sampFreq / numSamples) ;

spektrum = [0] * numSamples

def processSamples(in_data, frame_count, time_info, status_flags):
    global spektrum
    global noData
    if frame_count != numSamples:
        print "Ooops, Disn't get enough samples for fft"
    else:
     samples = numpy.fromstring(in_data, dtype=short)
     samples = (samples / 32768.0 ) + 1
     samples = samples*window
     p = fft(samples)
        p = 2*abs(p)
        p = p**2
        p = 10*log10(p)
        spektrum = p[1:]
        noData = False
    return (None,pyaudio.paContinue)

noData = True

stream = pyaud.open(
    format = pyaudio.paInt16,
    channels = 1,
    rate = sampFreq,
    input_device_index = device,
    input = True,
    frames_per_buffer = numSamples,
    stream_callback = processSamples
)

clearScreen()

mini = [50]*len(freqs)

while True:
    if noData:
        continue

    cursorHome()

    lastf = 0.0
    total = 0.0
    cnt = 0
    for i in range(3, len(freqs)):
        total += spektrum[i]
        cnt += 1
        f = freqs[i]
        if f / (f - lastf) < 10:
            val = int(total/cnt)+50
            if val < mini[i]:
                 mini[i] = val
            val -= mini[i]
            val -= 10
            print (" "+str(int(freqs[i])))[-5:] + "[Hz]:" + '*'*val + ' '*50
            lastf = f
            total = 0.0
            cnt = 0

Revision history for this message
Dieter Stubler (dieter-stubler) wrote :
Download full text (3.5 KiB)

One more thing.

Just tried to reboot my pi with:

sudo shutdown -r now

didn't work because of:

Jun 17 09:13:33 raspberrypi kernel: [41037.935811] ------------[ cut here ]------------
Jun 17 09:13:33 raspberrypi kernel: [41037.939096] kernel BUG at mm/slab.c:3231!
Jun 17 09:13:33 raspberrypi kernel: [41037.942203] Internal error: Oops - BUG: 0 [#3] PREEMPT ARM
Jun 17 09:13:33 raspberrypi kernel: [41037.945261] Modules linked in: snd_bcm2835 evdev 8192cu leds_gpio led_class snd_usb_audio snd_pcm snd_page_alloc snd_hwdep snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_timer snd_seq_device snd cm109
Jun 17 09:13:33 raspberrypi kernel: [41037.954639] CPU: 0 Tainted: G D W (3.6.11+ #456)
Jun 17 09:13:33 raspberrypi kernel: [41037.957683] PC is at cache_alloc_refill+0x27c/0x6a0
Jun 17 09:13:33 raspberrypi kernel: [41037.960668] LR is at __kmalloc+0xc4/0x11c
Jun 17 09:13:33 raspberrypi kernel: [41037.963557] pc : [<c00bc728>] lr : [<c00bcc10>] psr: a0000093
Jun 17 09:13:33 raspberrypi kernel: [41037.963557] sp : da863f28 ip : 00000000 fp : 00200200
Jun 17 09:13:33 raspberrypi kernel: [41037.969250] r10: da8021b0 r9 : da8021a0 r8 : c05df6a0
Jun 17 09:13:33 raspberrypi kernel: [41037.972013] r7 : da800240 r6 : da803c00 r5 : 00000010 r4 : d8daf000
Jun 17 09:13:33 raspberrypi kernel: [41037.974746] r3 : 00000014 r2 : da80029c r1 : ffffd698 r0 : da800240
Jun 17 09:13:33 raspberrypi kernel: [41037.977416] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Jun 17 09:13:33 raspberrypi kernel: [41037.980079] Control: 00c5387d Table: 18e84008 DAC: 00000015
Jun 17 09:13:33 raspberrypi kernel: [41037.982707] Process sudo (pid: 2708, stack limit = 0xda862268)
Jun 17 09:13:33 raspberrypi kernel: [41037.985304] Stack: (0xda863f28 to 0xda864000)
Jun 17 09:13:33 raspberrypi kernel: [41037.987842] 3f20: 00000000 000200d0 00000000 da862000 da5334d0 00000002
Jun 17 09:13:33 raspberrypi kernel: [41037.992813] 3f40: a0000013 da800240 000200d0 01bebc64 da862000 00000000 0000001c c00bcc10
Jun 17 09:13:33 raspberrypi kernel: [41037.997736] 3f60: d8d8a340 00000002 00000002 00000001 000000ce c00422ec d8d8a340 00000002
Jun 17 09:13:33 raspberrypi kernel: [41038.002759] 3f80: 00000002 01bebc64 000000ce c004252c b6c552c0 00000002 01bebc64 000000ce
Jun 17 09:13:33 raspberrypi kernel: [41038.007940] 3fa0: c000dbe8 c000da60 b6c552c0 00000002 00000002 01bebc64 00000000 00000000
Jun 17 09:13:33 raspberrypi kernel: [41038.013304] 3fc0: b6c552c0 00000002 01bebc64 000000ce 00000038 00000005 01bebc4c 0000001c
Jun 17 09:13:33 raspberrypi kernel: [41038.018761] 3fe0: 00000002 bededfd0 b6c3c71c b6ebfce8 60000010 00000002 dcfe7fff fffff7f7
Jun 17 09:13:33 raspberrypi kernel: [41038.024270] [<c00bc728>] (cache_alloc_refill+0x27c/0x6a0) from [<c00bcc10>] (__kmalloc+0xc4/0x11c)
Jun 17 09:13:33 raspberrypi kernel: [41038.030010] [<c00bcc10>] (__kmalloc+0xc4/0x11c) from [<c00422ec>] (groups_alloc+0x2c/0xc4)
Jun 17 09:13:33 raspberrypi kernel: [41038.035878] [<c00422ec>] (groups_alloc+0x2c/0xc4) from [<c004252c>] (sys_setgroups+0x2c/0xfc)
Jun 17 09:13:33 raspberrypi kernel: [41038.041990] [<c004252c>] (sys_se...

Read more...

Revision history for this message
Dieter Stubler (dieter-stubler) wrote :

Little more info now.
Watching mem usage with top i see a decrease of free mem after time.
Speed of decreasing is going faster and faster after a while.
None of the user processes is growing.
After stopping my capture programm free mem stops to decrease but stys where it is.
mem is not reclaimed.
top is still showing about 160000 free mem after i stopped my program.
trying to sudo does not work and shows up the same bug i described in my last comment.
Hope that helps.

Revision history for this message
Dieter Stubler (dieter-stubler) wrote :

And some more info:
if i switch off output in my programm the problem cannot be reproduced until now.
so sound grabbing for itsself seems not to cause it alone.
writing a lot of output from python without sound grabbing also didn't reproduce the problem.
But grabbing from sound card and outpuit to termeinal (=usb wlan network trafic) together seem to beak it.
For me it look like flaw in the USB handling under heavy load.

Revision history for this message
Dieter Stubler (dieter-stubler) wrote :

Now after running many sound garbs without output the problem was again reproducable.

This time the system just suddenly died.
all reminals were closed and no way get on the system without rebooting.

Is it possible my raspberry is just broken (ill memory ? or something)

How can i test my memory ?

Revision history for this message
dodger (franziskaner-fan) wrote :

Hi,
Same problem here, but I'm running Archlinux with the same kernel as you...
I'm getting the kernel panic while running asterisk just a few seconds after starting it.
I'll try to submit a bug on the arch forums

Revision history for this message
peter green (plugwash) wrote :

The raspberry pi foundation's github tracker would probablly be the best place if you want a chance of it actually getting fixed.

Revision history for this message
Diederik (didi-debian) wrote :

As peter green already indicated, it should be reported at: https://github.com/raspberrypi/linux/issues/

As this is not a raspbian.org bug, I'm marking it as invalid.

Changed in raspbian:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.