LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to report and verify that a kernel bug was solved. (https://www.linuxquestions.org/questions/linux-software-2/how-to-report-and-verify-that-a-kernel-bug-was-solved-758715/)

cricballa 09-30-2009 11:30 AM

How to report and verify that a kernel bug was solved.
 
While building a driver for Fedora 11, kernel 2.6.30.5-43.fc11.i686.PAE, I encounter the following error,

[include/linux/mm_inline.h:31: error: implicit declaration of function ‘mem_cgroup_add_lru_list’
include/linux/mm_inline.h: In function ‘del_page_from_lru_list’:
include/linux/mm_inline.h:39: error: implicit declaration of function ‘mem_cgroup_del_lru_list’]

I think that this is a bug in the kernel. My questions are how and where to report the bug and how to verify that the bug has been solved in a recent version?

i92guboj 09-30-2009 12:10 PM

Quote:

Originally Posted by cricballa (Post 3702004)
While building a driver for Fedora 11, kernel 2.6.30.5-43.fc11.i686.PAE, I encounter the following error,

Code:

include/linux/mm_inline.h:31: error: implicit declaration of function ‘mem_cgroup_add_lru_list’
include/linux/mm_inline.h: In function ‘del_page_from_lru_list’:
include/linux/mm_inline.h:39: error: implicit declaration of function ‘mem_cgroup_del_lru_list’

I think that this is a bug in the kernel.

You are building a driver that's not part of the kernel, so, what's your base to state that the bug is in the kernel?

In any case, it seems to me that you just don't have the needed headers or kernel sources in place. Gcc can't find them, so it can't find the prototype for mem_cgroup_add_lru_list(), and hence it *thinks* that you are trying to declarate is implicitly. The real problem is most likely that the declaration can't be found because you are missing the source files.

I know nothing about fedora, but you will usually need to install a package that's similar to 2.6.30.5-43.fc11.i686.PAE but with the word "headers" or "src" in the middle of that, those will contain the headers and sources for this kernel that you are using, and that are needed to compile drivers for this kernel. Additional steps might be needed depending on the driver itself.

cricballa 09-30-2009 12:38 PM

I have the kernel sources at /usr/src/kernels/2.6.30.5-43.fc11.i686.PAE

If I grep for mem_cgroup_add_lru_list(), I find three references to it:

./linux/mem_inline.h mem_cgroup_add_lru_list(.....) --- function call
./linux/memcontrol.h extern void mem_cgroup_add_lru_list(.....)
./linux/memcontrol.h static inline void mem_cgroup_add_lru_list (....)

It seems that mem_inline should have included memcontrol.h which is not the case?

i92guboj 09-30-2009 01:01 PM

Quote:

Originally Posted by cricballa (Post 3702106)
I have the kernel sources at /usr/src/kernels/2.6.30.5-43.fc11.i686.PAE

If I grep for mem_cgroup_add_lru_list(), I find three references to it:

./linux/mem_inline.h mem_cgroup_add_lru_list(.....) --- function call
./linux/memcontrol.h extern void mem_cgroup_add_lru_list(.....)
./linux/memcontrol.h static inline void mem_cgroup_add_lru_list (....)

It seems that mem_inline should have included memcontrol.h which is not the case?

It entirely depends on *where* is this driver looking for the kernel sources/headers. The make or configure output and the config.log should offer you some hints on this. Usually (and don't take this as a rule), programs will use either /lib/modules/`uname -r`/build OR /usr/src/linux to determine the correct source tree to use. Both of them should be symlinks pointing to your kernel sources.

cricballa 09-30-2009 02:06 PM

Here are couple of lines from the build log:

make -C /lib/modules/2.6.30.5-43.fc11.i686.PAE/build
make[4]: Entering directory `/usr/src/kernels/2.6.30.5-43.fc11.i686.PAE'

However, if I go and do a grep in lib/modules/2.6.30.5-43.fc11.i686.PAE/build, I get the same three hits. Is not it clear that mem_inline.h is not including the header file with the correct definition of the function?

i92guboj 09-30-2009 02:39 PM

[confusing and incorrect info eliminated, sorry]

Or paste the .h file somewhere, pastebin.ca or whatever.

cricballa 09-30-2009 05:01 PM

I can paste both the header files on pastebin.ca. I have never used it. So what is the procedure? How would you pick that up from there. Do you need some info, or a tag from me.

Thanks for your support.

i92guboj 09-30-2009 05:16 PM

You need to paste a link here.

When you paste something in a pastebin, it gives you an url as response, you need to copy it and paste it here. It's useful to exchange big log files, kernel configs, source files, the output of commands, and things like that. A lot of people us it for collaborative debugging, which is kind of the case here.

cricballa 09-30-2009 05:40 PM

Here are the posts.

http://pastebin.ca/1586800
http://pastebin.ca/1586806

i92guboj 09-30-2009 05:55 PM

Mine look the same, strange. I think that the problem in in the driver itself. Can you point me to these drivers so I can try to compile them myself?

cricballa 09-30-2009 06:04 PM

It might not be possible for me to send you the drivers. I am under a contract. Is there any way, you could help me debug the issue without compiling the driver yourself?

i92guboj 09-30-2009 06:28 PM

Oh, sorry, I thought they were publicly available.

Well, I suggest you to try this on the sources of that driver:

Code:

grep -r 'mm_inline.h'
Try to locate from where is that header included, and make sure that memcontrol.h is included before mm_inline.sh. You will probably find something like this:

Code:

#ifndef LINUX_MM_INLINE_H
#include <linux/mm_inline.h>
#endif

Or something similar. Probably you need to add something like this before:

Code:

#ifndef _LINUX_MEMCONTROL_H
#include <linux/memcontrol.h>
#endif

That's all the help I can give though, note that even if I have the sources, I am not really a kernel hacker and don't know much about the internals. I know and understand C, but never wondered to deep inside the linux kernel. In any case, even if there's any other problem, now your driver should not complain about the implicit declaration of that function, because it's declared in memcontrol.h, but the fact that it's an extern function can have many implications.

cricballa 09-30-2009 06:33 PM

Thanks for your help. I would try to keep you updated.

cricballa 10-01-2009 03:40 PM

Indeed adding
Quote:

#include <linux/memcontrol.h>
helped and I can now build the driver. Thanks a lot for your help. Really appreciate.

i92guboj 10-01-2009 04:02 PM

Glad that it worked, see you around ;)


All times are GMT -5. The time now is 05:56 AM.