LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-30-2009, 11:30 AM   #1
cricballa
Member
 
Registered: Jan 2007
Posts: 33

Rep: Reputation: 15
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?
 
Old 09-30-2009, 12:10 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by cricballa View Post
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.
 
Old 09-30-2009, 12:38 PM   #3
cricballa
Member
 
Registered: Jan 2007
Posts: 33

Original Poster
Rep: Reputation: 15
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?
 
Old 09-30-2009, 01:01 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by cricballa View Post
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.

Last edited by i92guboj; 09-30-2009 at 01:02 PM.
 
Old 09-30-2009, 02:06 PM   #5
cricballa
Member
 
Registered: Jan 2007
Posts: 33

Original Poster
Rep: Reputation: 15
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?
 
Old 09-30-2009, 02:39 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
[confusing and incorrect info eliminated, sorry]

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

Last edited by i92guboj; 09-30-2009 at 05:56 PM.
 
Old 09-30-2009, 05:01 PM   #7
cricballa
Member
 
Registered: Jan 2007
Posts: 33

Original Poster
Rep: Reputation: 15
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.
 
Old 09-30-2009, 05:16 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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.
 
Old 09-30-2009, 05:40 PM   #9
cricballa
Member
 
Registered: Jan 2007
Posts: 33

Original Poster
Rep: Reputation: 15
Here are the posts.

http://pastebin.ca/1586800
http://pastebin.ca/1586806
 
Old 09-30-2009, 05:55 PM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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?
 
Old 09-30-2009, 06:04 PM   #11
cricballa
Member
 
Registered: Jan 2007
Posts: 33

Original Poster
Rep: Reputation: 15
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?
 
Old 09-30-2009, 06:28 PM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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.
 
Old 09-30-2009, 06:33 PM   #13
cricballa
Member
 
Registered: Jan 2007
Posts: 33

Original Poster
Rep: Reputation: 15
Thanks for your help. I would try to keep you updated.
 
Old 10-01-2009, 03:40 PM   #14
cricballa
Member
 
Registered: Jan 2007
Posts: 33

Original Poster
Rep: Reputation: 15
Indeed adding
Quote:
#include <linux/memcontrol.h>
helped and I can now build the driver. Thanks a lot for your help. Really appreciate.
 
Old 10-01-2009, 04:02 PM   #15
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Glad that it worked, see you around
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
reduced testcase?? solved bug in gcc but what now? PB0711 Programming 2 06-27-2008 12:35 PM
Bug report stevod333 LQ Suggestions & Feedback 3 08-01-2007 02:54 AM
Bug report Adriaan Nikken Linux - Newbie 1 06-17-2007 07:07 PM
bug report gibney Linux - Newbie 1 03-14-2007 09:37 AM
was it bug and how do I report it!! ngan_yine Linux - General 2 01-17-2005 11:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration