Segfault

On Mon, Apr 2, 2012 at 18:43, Philip B. [email protected]
wrote:

That branch is not done yet :slight_smile:

Ah, good to know :slight_smile:

I just updated github to match the current shipping kernel (from last
week) See the e100-3.0-pm-2-bugfixes branch. In particular, I added some
code to do some range checking on the values passed to the ioctl in:

Ah thanks. I just built a new kernel using that patch (i.e. from the
e100-3.0-pm-2-bugfixes branch). I hope that was the right one, the
usrp_e driver looks ok but is only at version 0.2 as opposed to the
one from the e100-3.0-pm-2-fixes-from-review branch which is at
version 0.3. I still get a segfault / kernel NULL pointer dereference
as soon as I modprobe usrp_e though.

cheers

Stefan O.
Communication and Distributed Systems
Institute of Computer Science and Applied Mathematics
University of Bern

Hey

Just curious, have you had a chance to look at this?

Also, in the meantime I tried using your kernel tree
(e100-3.0-pm-2-fixes-from-review) which seems to have a newer version
of the usrp_e driver, built with the kernel configuration that I took
from a working USRP image. However, when trying to modprobe the usrp-e
module, I get:

usrp_e entering driver initialization
Unable to handle kernel NULL pointer dereference at virtual address
0000003c
pgd = c9554000
[0000003c] *pgd=9f843831, *pte=00000000, *ppte=00000000
Internal error: Oops: 817 [#1]
Modules linked in: usrp_e(+)
CPU: 0 Not tainted (3.0.0 #1)
PC is at usrp_e_init+0x84/0x1c4 [usrp_e]
LR is at usrp_e_init+0x84/0x1c4 [usrp_e]
pc : [] lr : [] psr: 60000013
sp : c954deb0 ip : 00000000 fp : 00000000
r10: 0000001c r9 : 00000024 r8 : 00000001
r7 : bf001a38 r6 : bf001b70 r5 : 00000000 r4 : 00000000
r3 : 00000000 r2 : c954dea4 r1 : bf001914 r0 : 0000000b
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: 89554019 DAC: 00000015
Process modprobe (pid: 57, stack limit = 0xc954c2f0)
Stack: (0xc954deb0 to 0xc954e000)
dea0: bf004000 00000000 00000000
bf001a38
dec0: bf004000 00000000 c94e6680 c003737c c0569858 00000001 bf001a38
bf001a38
dee0: 00000001 bf001a38 00000001 bf001a80 c94e6680 00000001 00000024
c0088550
df00: bf001a44 000203c0 0065f11c 00000124 c0086288 c03c70bc bf001b5c
0065b018
df20: c943bc28 e08ae000 000246d5 e08c7aac e08c7891 e08d20cc c94950c0
00001b84
df40: 000020e4 00000000 00000000 00000032 00000033 0000001c 00000019
00000017
df60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
c0511494
df80: 00000000 401955b0 00000000 00000000 00000080 c003c484 c954c000
00000000
dfa0: 0065b018 c003c300 401955b0 00000000 401bc008 000246d5 0065b018
bebf89e4
dfc0: 401955b0 00000000 00000000 00000080 00016f50 000203c0 0065f11c
0065b018
dfe0: 40143cd8 bebf89e4 0000c25c 40143ce8 20000010 401bc008 e1a06007
1afffff7
[] (usrp_e_init+0x84/0x1c4 [usrp_e]) from []
(do_one_initca)
[] (do_one_initcall+0x90/0x160) from []
(sys_init_module+0x)
[] (sys_init_module+0x1628/0x181c) from []
(ret_fast_syscal)
Code: eb48b539 e5860010 e59f011c eb4ee213 (e584503c)
—[ end trace 784c802e29369acf ]—
Segmentation fault

This seems to happen in usrp_e.c on line 854: atomic_set(&p->mapped,
0); - I assume that, for some reason, “p” isn’t properly initialized.
You wouldn’t by any chance have some idea about what might be wrong
there?

Furthermore, sorry for the nagging :slight_smile:

cheers

Stefan O.
Communication and Distributed Systems
Institute of Computer Science and Applied Mathematics
University of Bern

On Tue, Apr 3, 2012 at 16:12, Stefan O. [email protected] wrote:

Ah thanks. I just built a new kernel using that patch (i.e. from the
e100-3.0-pm-2-bugfixes branch). I hope that was the right one, the
usrp_e driver looks ok but is only at version 0.2 as opposed to the
one from the e100-3.0-pm-2-fixes-from-review branch which is at
version 0.3. I still get a segfault / kernel NULL pointer dereference
as soon as I modprobe usrp_e though.

Sorry about that, I had some sort of mess and tried the wrong kernel
again. With the e100-3.0-pm-2-bugfixes branch it seems to basically
work (i.e. I can load the module and uhd_find_devices shows the E100)
but uhd_usrp_probe aborts:

uhd_usrp_probe

linux; GNU C++ version 4.6.1; Boost_104800; UHD_003.003.002-unknown

– Opening device node /dev/usrp_e0…

I will try again with the latest development version of uhd and report
back.

cheers & sorry for the noise

Stefan O.
Communication and Distributed Systems
Institute of Computer Science and Applied Mathematics
University of Bern

On Wed, Apr 4, 2012 at 15:36, Philip B. [email protected]
wrote:

Sorry about that, I had some sort of mess and tried the wrong kernel

cheers & sorry for the noise

OK, so instead of crashing, it just aborts. This suggests my check on
ioctl arguments is working. We need to poke around uhd and see what is
passing to the kernel.

Yup, seems your changes helped! Just FYI, the situation doesn’t change
regardless of whether I use uhd 3.3.2, 3.4.0, git master or git next.
I’ll try to have a closer look at the ioctls (I’m not particularly
good / experienced at this) to see whether I can find anything that’s
different on my installation when compared to the shipped microSD
cards. In particular I think it would be interesting to try my kernel
with your cards to see what happens, i.e. to figure out whether the
problem is on the kernel side or in the user-space tools.

I’ll report back when I find something new.

cheers

Stefan O.
Communication and Distributed Systems
Institute of Computer Science and Applied Mathematics
University of Bern

On Wed, Apr 4, 2012 at 16:04, Stefan O. [email protected] wrote:

I’ll report back when I find something new.
It does seem to be a user-space problem now. If I use my kernel on
your sd cards it works just fine.

cheers

Stefan O.
Communication and Distributed Systems
Institute of Computer Science and Applied Mathematics
University of Bern

On 04/04/2012 05:24 AM, Stefan O. wrote:

again. With the e100-3.0-pm-2-bugfixes branch it seems to basically
cheers & sorry for the noise
OK, so instead of crashing, it just aborts. This suggests my check on
ioctl arguments is working. We need to poke around uhd and see what is
passing to the kernel.

Philip