-
Notifications
You must be signed in to change notification settings - Fork 178
Add CONFIG_KALLSYMS_ALL check #6
Comments
Thanks for the bug report jberzins. I've got a hunch this was caused by not having 'awk' installed on your system due to the minimal install. Can you double check that /usr/bin/awk exists. If it doesn't please pull in the gawk package and try again. |
Hi, thanks for reply. awk does exist, here results of the script:
Not sure about internals, but it seems spl dir does not exist when the helper script is executed. If this does not make sense - I can install full ubuntu and try again. I do not have much experience with modules, but I can follow instructions. |
Interesting. So the way this is designed to work is when the spl module loads that missing directory is created. After it knows the directory exists it then makes the call to user space to extract that address from kallsyms and pass it back to the kernel through the proc file. In your case this fails for some reason and the module stops loading and removes the directory which is why you don't see it. What would be good is if you could verify that the file does exist in the right place during the module load. You might be able to catch it if your watching /proc/ carefully when the module loads. Or better yet you can modify the following lines in the spl source to call a helper script which calls awk and then you can add some debugging to the helper script to see what the issue is. Simply change the following macro like this, recompile the spl, and add the helper script let's call it /tmp/spl-awk.sh. Then you can try and load the module and look at the contents of /tmp/spl-awk.log to see what went wrong. spl-generic.c:336 #define GET_KALLSYMS_ADDR_CMD \ "awk '{ if ( $3 == \"kallsyms_lookup_name\") { print $1 } }' " \ "/proc/kallsyms >/proc/sys/kernel/spl/kallsyms_lookup_name" #define GET_KALLSYMS_ADDR_CMD "/tmp/spl-awk.sh" #! /bin/sh ls -l /proc/sys/kernel/spl/ >/tmp/spl-awk.log awk '{ if ( $3 == \"kallsyms_lookup_name\") { print $1 } }' /proc/kallsyms >/proc/sys/kernel/spl/kallsyms_lookup_name |
Thanks for advice, unfortunately the results are irrational. Does NOT work: Works: All tests passed: Cheers, |
I hate bugs like this. OK, well thanks for all your debugging lets leave the bug open for now until I can setup a similar system. Perhaps there's a bug in the proc handler or some such. |
It sounds like a stdio buffering difference. |
I'm using VMWare Server, maybe it contributes to the issue. strace -e write -o /tmp/spl-strace.log I'm not familiar with the tool so a desperate strace.
jb |
Well that's interesting. Everything worked fine writing to the spl proc file, the error EBADF occurred while closing file descriptor 2. Since I never see this file descriptor being opened in the log the error makes sense, but it seems like this is an issue with awk and not the spl. If the spl we're to wrongly ignore the error everything should be fine. |
Since it seems to be something with awk, I thought I'd see how I could rewrite it. Here's my diff, which seems to compile and work fine on my system that was experiencing this problem. splat -a passes all tests, as well:
|
This turns out to be an issue with awk. It does not behave properly when called from the kernel usermode helper, this may have something to do with have awk handles its argument parsing. The reason I never saw this is I was using gawk on all the platforms I tested which does not suffer from this same issue. I've updated the ./configure script to check explicitly for gawk and make it a mandatory requirement (1814251). This seems like a pretty reasonable requirement so I'm closing the bug as fixed. |
Hi, SPL: Failed user helper '/bin/sh -c gawk '{ if ( $3 == "kallsyms_lookup_name") { print $1 } }' /proc/kallsyms >/proc/sys/kernel/spl/kallsyms_lookup_name', rc = 512 i tried gawk 3.1.8 too, same results should i use another version of gawk, is gentoo using some bizarre gawk version? thanks |
You can try an earlier gawk version, 3.1.7 works fine for me. But before trying that please try this simple experiment. Run the following simple gawk command and see if returns something reasonable. You should see something like ffffffff81157680 which is the memory address of kallsyms_lookup_name function for your kernel. If you don't we'll have to investigate if that symbol is missing on your system or if it's just being misreported somehow.
|
hi, thanks for the reply apparently,.. i don't have /proc/kallsyms gawk: cmd. line:1: fatal: cannot open file `/proc/kallsyms' for reading (No such file or directory) so maybe the problem is the kernel version?? many thanks! |
That is absolutely the problem. Make sure your kernel is built with CONFIG_KALLSYMS=y and CONFIG_KALLSYMS_ALL=y. |
it works with many thanks |
CONFIG_KALLSYMS_ALL isn't strictly required, most distro's just happen to define both in their default kernels. I wouldn't worry about it, thanks for letting me know it worked! |
If there is a check for other kernel config flags during configure than may be add check for this option too? |
In fact there are checks for other CONFIG_* options and checking for this at build time is a good idea. I'll reopen the issue until this check gets added. |
I'm having the same problem, and as far as I can tell, I have gawk, kallsyms (the gawk command works), the helper command line work, and the modules load after the boot process switches to an ext4 rootFS |
If your using zfs as your root filesystem are you sure you have gawk in your initramfs? |
spl-crypto rework.
xbmc@xbmc:~/spl-0.4.9$ uname -a
Linux xbmc 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:28:05 UTC 2010 x86_64 GNU/Linux
Steps:
FATAL: Could not load /lib/modules/2.6.32-22-generic/modules.dep: No such file or directory
FATAL: Error inserting splat (/lib/modules/2.6.32-22-generic/addon/spl/splat/splat.ko): Cannot assign requested address
Jun 1 00:09:51 xbmc kernel: [ 5482.698506] SPL: Failed user helper '/bin/sh -c awk '{ if ( $3 == "kallsyms_lookup_name") { print $1 } }' /proc/kallsyms >/proc/sys/kernel/spl/kallsyms_lookup_name', rc = 512
Jun 1 00:09:51 xbmc kernel: [ 5482.698537] SPL: Failed to Load Solaris Porting Layer v0.4.9, rc = -99
The test ubuntu is 64 bit 10.04 minimal cd install + updates + build-essential + psmisc + linux-headers-
uname -r
Regards,
jb
The text was updated successfully, but these errors were encountered: