Bug 131886 - __put_task_struct unresolved when loading externally compiled module
__put_task_struct unresolved when loading externally compiled module
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Ernie Petrides
Brian Brock
: FutureFeature
Depends On:
Blocks: 156320
  Show dependency treegraph
Reported: 2004-09-06 07:40 EDT by Robin Crook
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHSA-2005-663
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-28 10:29:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
tar file of sources (60.00 KB, application/octet-stream)
2004-09-06 08:46 EDT, Robin Crook
no flags Details

  None (edit)
Description Robin Crook 2004-09-06 07:40:48 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
I have compiled a module against the 2.4.21-15.0.3.EL linux kernel 
source tree.  Initially I got the following when I tried to load it:

[root@stratum11 rms]# insmod ./rms.o
./rms.o: unresolved symbol free_task_struct

Googling resulted in me changing free_task_struct to put_task_struct 
but I now get:

[root@stratum11 rms]# insmod ./rms.o
./rms.o: unresolved symbol __put_task_struct
[root@stratum11 rms]# 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Include a call to put_task_struct(tsk) in module code and build it 
against the 2.4.21-15.0.3.EL source tree
2. try to insmod the module - insmod ./rms.o 

Actual Results:  [root@stratum11 rms]# insmod ./rms.o
./rms.o: unresolved symbol __put_task_struct
[root@stratum11 rms]# 

Expected Results:  The module should have loaded.

Additional info:
Comment 1 Arjan van de Ven 2004-09-06 07:43:35 EDT
can you give a pointer to the sourcecode of this module so that we can
see what you are trying to achieve ?
Comment 2 Robin Crook 2004-09-06 08:46:39 EDT
Created attachment 103507 [details]
tar file of sources

I've attached a tarfile of the sources.  The put_task_struct call is in the
rms_kern.c file.
We are in the process of removing the need to use a 
patch (that we call ptrack) that provides containers
for the set of processes in a parallel job. One of
the operations we perform is to accumulate its stats. 

We increment the reference count on the proc so that 
it doesn't disappear under our feet, we do this with 
get_task_struct (rms_kern.c:453). We decrement the 
reference count with free_task_struct (or put_task_struct 
in some kernels) when we are finished with the process 

This all works ok on 2.4.20 and vanilla 2.6 kernels
but not on RHEL 3.0 where the put_task_struct macro
exists but the __put_task_struct fn is not defined.
Comment 3 Robin Crook 2004-09-07 12:56:43 EDT
This bug is present in the 2.6.7 vanilla kernel as well and I've 
found this by googling: 


From: Frank Cornelis (Frank.Cornelis@elis.ugent.be)
Date: Mon Aug 04 2003 - 07:54:13 EST 

Next message: Alan Cox: "Re: DVD-RAM errors (was: DVD-RAM crashing 


In order to be able to safely manipulate a task_struct from within a 
module one should use get/put_task_struct. This is currently not 
possible because __put_task_struct is not exported. Next patch solves 
this issue. 


--- linux-2.6.0-test2.orig/kernel/ksyms.c 2003-07-29 
10:04:45.000000000 +0200 
+++ linux-2.6.0-test2/kernel/ksyms.c 2003-07-29 14:11:40.000000000 
@@ -495,6 +495,7 @@ 
 #if !defined(__ia64__) 

 /* misc */ 

We would really like this patch to make it into the distribution.
Comment 4 Ernie Petrides 2005-04-29 21:23:40 EDT
Patch posted for review on 29-Apr-2005.
Comment 5 Ernie Petrides 2005-05-04 20:44:20 EDT
A fix for this problem has just been committed to the RHEL3 U6
patch pool this evening (in kernel version 2.4.21-32.3.EL).
Comment 15 Red Hat Bugzilla 2005-09-28 10:29:35 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.