[Click] Elements with large arrays - "Unable to handle kernel NULL pointer..."

Cliff Frey cliff at meraki.com
Tue Jun 5 18:34:20 EDT 2012


if you are using click_lalloc correctly, it should be calling vmalloc() in
the kernel.  You can see how much of that memory you are using with 'grep
Vmalloc /proc/meminfo'.

You could add debugging statements around the vmalloc call to verify that
it is indeed failing, and look at the meminfo file.

Cliff

On Tue, Jun 5, 2012 at 3:20 PM, Jakub Dudek <qubu88 at gmail.com> wrote:

> Thank for replies. Unfortunatelly click_lalloc() doesn't help. Cliff, you
> wrote that memory is limited to few hundred MB, but I'm using sample router
> configuration with 20 queues and my array (size 2^21, uint32_t). In my
> opinion all of this should require max  ~15MB. Is there any way to debug
> this problem?
>
> Jakub
>
>
> 2012/6/5 Cliff Frey <cliff at meraki.com>
>
>> Beyers is correct.  However, you will still likely be limited to at most a
>> few hundred MB (and quite possibly much smaller).  If you want larger than
>> that, you probably want to go to x86-64.
>>
>> Cliff
>>
>> On Tue, Jun 5, 2012 at 6:54 AM, Beyers Cronje <bcronje at gmail.com> wrote:
>>
>> > Hi Jakub,
>> >
>> > Use click_lalloc() instead of new[] too allocate memory for kernel
>> module.
>> > This function will either use kmalloc or vmalloc depending on the size
>> > requested. This might resolve your problem.
>> > Note to use click_lfree() to free memory allocated through
>> click_lalloc().
>> >
>> > Beyers
>> >
>> > On Tue, Jun 5, 2012 at 12:02 AM, Jakub Dudek <qubu88 at gmail.com> wrote:
>> >
>> > > Hi Experts,
>> > >
>> > > I'm implementing own elements in click, which require large arrays.
>> When
>> > > the array size is lager than 2^21 I'm getting the kernel panic with
>> > > following errors:
>> > >
>> > > [  389.399177] click: starting router thread pid 16711 (f7685a80)
>> > > [  389.409357] BUG: unable to handle kernel NULL pointer dereference
>> at
>> > > virtual address 00000000
>> > > [  389.409365] printing eip: f8f0aaf2 *pde = 00000000
>> > > [  389.409371] Oops: 0002 [#1] SMP
>> > > [  389.409375] Modules linked in: click proclikefs ppdev lp
>> speedstep_lib
>> > > cpufreq_userspace cpufreq_powersave cpufreq_stats cpufreq_conservative
>> > drm
>> > > binfmt_misc fuse loop snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm
>> > i2c_i801
>> > > snd_seq i2c_core snd_timer shpchp snd pcspkr rng_core soundcore
>> > > snd_page_alloc pci_hotplug parport_pc parport psmouse evdev serio_raw
>> > > button ext3 jbd mbcache sd_mod sr_mod cdrom ata_generic usbhid hid
>> > ata_piix
>> > > uhci_hcd tg3 libata scsi_mod 3c59x mii ehci_hcd thermal processor
>> usbcore
>> > > [  389.409411]
>> > > [  389.409415] Pid: 16707, comm: click-install Not tainted (2.6.24.7
>> #1)
>> > > [  389.409417] EIP: 0060:[<f8f0aaf2>] EFLAGS: 00010202 CPU: 0
>> > > [  389.409766] EIP is at
>> > > _ZN15DirectFlowTable10initializeEP12ErrorHandler+0x42/0x60 [click]
>> > > [  389.409770] EAX: 00000000 EBX: d6c76ea0 ECX: 000000d0 EDX: 0000000b
>> > > [  389.409773] ESI: 3b9aca00 EDI: 9022c5a7 EBP: 1294873d ESP: e4d73d8c
>> > > [  389.409775]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>> > > [  389.409779] Process click-install (pid: 16707, ti=e4d72000
>> > task=f76b91a0
>> > > task.ti=e4d72000)
>> > > [  389.409781] Stack: 00000000 00000000 0000005c f77fe800 00000000
>> > d6ef6000
>> > > f8eb0dd0 e4d73dc4
>> > > [  389.409789]        d6ef6000 f8f5c3dd d6c76ea0 00000000 d6ef6000
>> > 01000006
>> > > f8f6b728 00000000
>> > > [  389.409795]        d6ef6000 f8f58d40 00000000 00000000 f8f5b69d
>> > 00000002
>> > > 00000000 f8f58d40
>> > > [  389.409802] Call Trace:
>> > > [  389.409815]  [<f8eb0dd0>]
>> > > _ZN6Router10initializeEP12ErrorHandler+0x450/0x560 [click]
>> > > [  389.410063]  [<f8f58d00>] _ZN5Null8D0Ev+0x0/0x16 [click]
>> > > [  389.410305]  [<f8f424e2>]
>> > > _ZL12write_configRK6StringP7ElementPvP12ErrorHandler+0x122/0x1e0
>> [click]
>> > > [  389.410552]  [<f8ea8af7>]
>> > > _ZNK7Handler10call_writeERK6StringP7ElementP2EH+0xb7/0x160 [click]
>> > > [  389.410785]  [<f8f4530d>] handler_do_write+0x23d/0x9d0 [click]
>> > > [  389.411028]  [<c0160abd>] __alloc_pages+0x6c/0x2fc
>> > > [  389.411045]  [<f8e8383d>] click_lalloc+0x2d/0x60 [click]
>> > > [  389.411260]  [<f8e777c7>] _ZN6String11create_memoEPcii+0x37/0x40
>> > [click]
>> > > [  389.411469]  [<f8e77a38>] _ZN6String14append_garbageEi+0xa8/0x150
>> > > [click]
>> > > [  389.411684]  [<c01e49d8>] copy_from_user+0x2a/0x112
>> > > [  389.411695]  [<c0136596>] finish_wait+0x2a/0x4d
>> > > [  389.411704]  [<f8f45b7b>] handler_flush+0xdb/0x120 [click]
>> > > [  389.411950]  [<c013650b>] autoremove_wake_function+0x0/0x31
>> > > [  389.411959]  [<c0179ac7>] filp_close+0x32/0x58
>> > > [  389.411963]  [<c017bc52>] sys_write+0x41/0x67
>> > > [  389.411970]  [<c0179b51>] sys_close+0x64/0x96
>> > > [  389.411975]  [<c0103ee6>] sysenter_past_esp+0x6b/0xa1
>> > > [  389.411988]  [<c02e0000>] tcp6_seq_show+0x21c/0x4d4
>> > > [  389.412001]  =======================
>> > > [  389.412003] Code: 6c 24 14 31 ed e8 32 fd 22 c7 0f b6 4b 3c 89 d7
>> f7
>> > ee
>> > > 01 c7 b8 04 00 00 00 11 d5 89 7b 44 d3 e0 89 6b 48 e8 81 8d f7 ff 89
>> 43
>> > 4c
>> > > <c7> 00 00 00 00 00 31 c0 8b 5c 24 08 8b 74 24 0c 8b 7c 24 10 8b
>> > > [  389.412041] EIP: [<f8f0aaf2>]
>> > > _ZN15DirectFlowTable10initializeEP12ErrorHandler+0x42/0x60 [click]
>> SS:ESP
>> > > 0068:e4d73d8c
>> > > [  389.412311] ---[ end trace 39367dedfd773143 ]---
>> > >
>> > >
>> > >
>> > > Is there any way to fix this problem? I'm using Debian with kernel
>> > 2.6.24.7
>> > > and click router in kernel mode. Memory is used in 10%.
>> > >
>> > > Thanks in advance
>> > >
>> > > --
>> > > Jakub Dudek
>> > > _______________________________________________
>> > > click mailing list
>> > > click at amsterdam.lcs.mit.edu
>> > > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>> > >
>> > _______________________________________________
>> > click mailing list
>> > click at amsterdam.lcs.mit.edu
>> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>> >
>> _______________________________________________
>> click mailing list
>> click at amsterdam.lcs.mit.edu
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>
>
>


More information about the click mailing list