<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10845</bug_id>
          
          <creation_ts>2016-12-22 14:35:43 +0000</creation_ts>
          <short_desc>test-image: compile and load a kernel module under the qemu-lsb image is failing</short_desc>
          <delta_ts>2017-01-11 16:30:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BSPs</product>
          <component>bsps-runtime</component>
          <version>2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jose Perez C">jose.perez.carranza</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>yp.kernel.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69313</commentid>
    <comment_count>0</comment_count>
    <who name="Jose Perez C">jose.perez.carranza</who>
    <bug_when>2016-12-22 14:35:43 +0000</bug_when>
    <thetext>STATUS: FAILED
BUILD: 2.3_M1_rc1: 573c646d4cc62dcd0c230381df4940bdf314d495
ENVIRONMENT: qemux86_64-lsb
Image: http://autobuilder.yoctoproject.org/pub/releases/yocto-2.3_M1.rc1/machines/qemu/qemux86-64-lsb/core-image-lsb-sdk-qemux86-64.ext4


STEPS TO REPRODUCE: THIS IS A COPY OF TC 316 AND IS REPORTED WITH THAT ID ON TESTIMAGE



1.Create a QEMU(x86 or x86-64) core-image-sato-sdk image. 
 

2.Run &apos;make scripts&apos; in /usr/src/kernel
 


3. cd /home/root and create hello.c with the following content:




#undef __KERNEL__
#define __KERNEL__

#undef MODULE
#define MODULE

#include &lt;linux/module.h&gt;	
#include &lt;linux/kernel.h&gt;	
#include &lt;linux/init.h&gt;		


static int __init hello_init(void)
{
    printk(KERN_INFO &quot;Hello world!\n&quot;);
    return 0;	
}

static void __exit hello_cleanup(void)
{
    printk(KERN_INFO &quot;Cleaning up module.\n&quot;);
}

module_init(hello_init);
module_exit(hello_cleanup);



4. Create a Makefile with the following content and run &apos;make&apos;

obj-m := hello.o
KDIR := /usr/src/kernel
PWD := $(shell pwd)

all:
	$(MAKE) -C $(KDIR) M=$(PWD) modules
 
clean:
	$(MAKE) -C $(KDIR) M=$(PWD) clean



5. Run insmod hello.ko
  

6.After the module is compiled and loaded, check that it is present by running &quot;lsmod&quot; command and dmesg | grep -i hello



EXPECTED OUTCOME: The module could be properly loaded

ACTUAL OUTCOME: 

Traceback (most recent call last):
  File &quot;/home/jgperezc/Yocto/poky-2.3-lsb/meta/lib/oeqa/utils/decorators.py&quot;, line 109, in wrapped_f
    return func(*args, **kwargs)
  File &quot;/home/jgperezc/Yocto/poky-2.3-lsb/meta/lib/oeqa/utils/decorators.py&quot;, line 97, in wrapped_f
    return f(*args, **kwargs)
  File &quot;/home/jgperezc/Yocto/poky-2.3-lsb/meta/lib/oeqa/utils/decorators.py&quot;, line 97, in wrapped_f
    return f(*args, **kwargs)
  File &quot;/home/jgperezc/Yocto/poky-2.3-lsb/meta/lib/oeqa/runtime/kernelmodule.py&quot;, line 31, in test_kernel_module
    self.assertEqual(status, 0, msg=&quot;\n&quot;.join([cmd, output]))
AssertionError: 1 != 0 : cd /tmp &amp;&amp; insmod hellomod.ko
insmod: ERROR: could not insert module hellomod.ko: Invalid module format</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69674</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2017-01-10 20:37:38 +0000</bug_when>
    <thetext>This is likely modversions kicking in.

Can you check to see if the kernel build has MODVERSIONS enabled ? Also, what does dmesg log when the module load fails ? It could also be an invalid entry point, but something should be dumped in those cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69682</commentid>
    <comment_count>2</comment_count>
    <who name="Jose Perez C">jose.perez.carranza</who>
    <bug_when>2017-01-10 21:29:39 +0000</bug_when>
    <thetext>Checking on file /proc/config.gz is giving:
# CONFIG_MODVERSIONS is not set

----

The image kernel is giving:
$uname -r 
kernel 4.8.12-yocto-standard

----
and dmesg is giving the following: 

[ 2337.132062] hello: version magic &apos;4.1.36-yocto-standard SMP preempt mod_unload PENTIUMM &apos; should be &apos;4.8.12-yocto-standard SMP preempt mod_unload PENTIUMM &apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69683</commentid>
    <comment_count>3</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2017-01-10 21:31:27 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Checking on file /proc/config.gz is giving:
&gt; # CONFIG_MODVERSIONS is not set
&gt; 
&gt; ----
&gt; 
&gt; The image kernel is giving:
&gt; $uname -r 
&gt; kernel 4.8.12-yocto-standard
&gt; 
&gt; ----
&gt; and dmesg is giving the following: 
&gt; 
&gt; [ 2337.132062] hello: version magic &apos;4.1.36-yocto-standard SMP preempt
&gt; mod_unload PENTIUMM &apos; should be &apos;4.8.12-yocto-standard SMP preempt
&gt; mod_unload PENTIUMM &apos;

aha. so it is a version skew. The running kernel is different from the SDK one. Is one build using AUTOREV ? i.e. the image one is AUTOREV but the SDK is fixed ? or vice versa ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69684</commentid>
    <comment_count>4</comment_count>
    <who name="Jose Perez C">jose.perez.carranza</who>
    <bug_when>2017-01-10 21:36:56 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Checking on file /proc/config.gz is giving:
&gt; &gt; # CONFIG_MODVERSIONS is not set
&gt; &gt; 
&gt; &gt; ----
&gt; &gt; 
&gt; &gt; The image kernel is giving:
&gt; &gt; $uname -r 
&gt; &gt; kernel 4.8.12-yocto-standard
&gt; &gt; 
&gt; &gt; ----
&gt; &gt; and dmesg is giving the following: 
&gt; &gt; 
&gt; &gt; [ 2337.132062] hello: version magic &apos;4.1.36-yocto-standard SMP preempt
&gt; &gt; mod_unload PENTIUMM &apos; should be &apos;4.8.12-yocto-standard SMP preempt
&gt; &gt; mod_unload PENTIUMM &apos;
&gt; 
&gt; aha. so it is a version skew. The running kernel is different from the SDK
&gt; one. Is one build using AUTOREV ? i.e. the image one is AUTOREV but the SDK
&gt; is fixed ? or vice versa ?

I&apos;m not building the images, I&apos;m using the ones uploaded to the public AB http://autobuilder.yoctoproject.org/pub/releases/yocto-2.3_M1.rc1/machines/qemu/qemux86-lsb/ is there a way to check this directly on the image booted?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69717</commentid>
    <comment_count>5</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2017-01-11 15:19:04 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; Checking on file /proc/config.gz is giving:
&gt; &gt; &gt; # CONFIG_MODVERSIONS is not set
&gt; &gt; &gt; 
&gt; &gt; &gt; ----
&gt; &gt; &gt; 
&gt; &gt; &gt; The image kernel is giving:
&gt; &gt; &gt; $uname -r 
&gt; &gt; &gt; kernel 4.8.12-yocto-standard
&gt; &gt; &gt; 
&gt; &gt; &gt; ----
&gt; &gt; &gt; and dmesg is giving the following: 
&gt; &gt; &gt; 
&gt; &gt; &gt; [ 2337.132062] hello: version magic &apos;4.1.36-yocto-standard SMP preempt
&gt; &gt; &gt; mod_unload PENTIUMM &apos; should be &apos;4.8.12-yocto-standard SMP preempt
&gt; &gt; &gt; mod_unload PENTIUMM &apos;
&gt; &gt; 
&gt; &gt; aha. so it is a version skew. The running kernel is different from the SDK
&gt; &gt; one. Is one build using AUTOREV ? i.e. the image one is AUTOREV but the SDK
&gt; &gt; is fixed ? or vice versa ?
&gt; 
&gt; I&apos;m not building the images, I&apos;m using the ones uploaded to the public AB
&gt; http://autobuilder.yoctoproject.org/pub/releases/yocto-2.3_M1.rc1/machines/
&gt; qemu/qemux86-lsb/ is there a way to check this directly on the image booted?

Not really. But you can check the captured kernel source in the SDK and note the version from the Makefile. 

The system is working as expected by refusing to load the version mismatched kernel module and running kernel.

Not knowing how the kernel you are booting is associated to the SDK you are downloading I can&apos;t say exactly why they are different.

Do you know where both are coming from ? Can we confirm they are from the same build / build artifacts ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69719</commentid>
    <comment_count>6</comment_count>
    <who name="Jose Perez C">jose.perez.carranza</who>
    <bug_when>2017-01-11 16:13:11 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; &gt; Checking on file /proc/config.gz is giving:
&gt; &gt; &gt; &gt; # CONFIG_MODVERSIONS is not set
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; ----
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; The image kernel is giving:
&gt; &gt; &gt; &gt; $uname -r 
&gt; &gt; &gt; &gt; kernel 4.8.12-yocto-standard
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; ----
&gt; &gt; &gt; &gt; and dmesg is giving the following: 
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; [ 2337.132062] hello: version magic &apos;4.1.36-yocto-standard SMP preempt
&gt; &gt; &gt; &gt; mod_unload PENTIUMM &apos; should be &apos;4.8.12-yocto-standard SMP preempt
&gt; &gt; &gt; &gt; mod_unload PENTIUMM &apos;
&gt; &gt; &gt; 
&gt; &gt; &gt; aha. so it is a version skew. The running kernel is different from the SDK
&gt; &gt; &gt; one. Is one build using AUTOREV ? i.e. the image one is AUTOREV but the SDK
&gt; &gt; &gt; is fixed ? or vice versa ?
&gt; &gt; 
&gt; &gt; I&apos;m not building the images, I&apos;m using the ones uploaded to the public AB
&gt; &gt; http://autobuilder.yoctoproject.org/pub/releases/yocto-2.3_M1.rc1/machines/
&gt; &gt; qemu/qemux86-lsb/ is there a way to check this directly on the image booted?
&gt; 
&gt; Not really. But you can check the captured kernel source in the SDK and note
&gt; the version from the Makefile. 
&gt; 
&gt; The system is working as expected by refusing to load the version mismatched
&gt; kernel module and running kernel.
&gt; 
&gt; Not knowing how the kernel you are booting is associated to the SDK you are
&gt; downloading I can&apos;t say exactly why they are different.
&gt; 
&gt; Do you know where both are coming from ? Can we confirm they are from the
&gt; same build / build artifacts ?

I saw that there are 2 kenles uploade to the AB, I do a test with both and below are the results :

http://autobuilder.yoctoproject.org/pub/releases/yocto-2.3_M1.rc1/machines/qemu/qemux86-lsb/  

- bzImage--4.1.36+git0+44719fa8f7_fec4924781-r0.2-qemux86-20161216115813.bin: running with this one the test PASS 

- bzImage-qemux86.bin : running with this one the test FAIL</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69720</commentid>
    <comment_count>7</comment_count>
    <who name="Jose Perez C">jose.perez.carranza</who>
    <bug_when>2017-01-11 16:30:43 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; &gt; &gt; Checking on file /proc/config.gz is giving:
&gt; &gt; &gt; &gt; &gt; # CONFIG_MODVERSIONS is not set
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; ----
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; The image kernel is giving:
&gt; &gt; &gt; &gt; &gt; $uname -r 
&gt; &gt; &gt; &gt; &gt; kernel 4.8.12-yocto-standard
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; ----
&gt; &gt; &gt; &gt; &gt; and dmesg is giving the following: 
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; [ 2337.132062] hello: version magic &apos;4.1.36-yocto-standard SMP preempt
&gt; &gt; &gt; &gt; &gt; mod_unload PENTIUMM &apos; should be &apos;4.8.12-yocto-standard SMP preempt
&gt; &gt; &gt; &gt; &gt; mod_unload PENTIUMM &apos;
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; aha. so it is a version skew. The running kernel is different from the SDK
&gt; &gt; &gt; &gt; one. Is one build using AUTOREV ? i.e. the image one is AUTOREV but the SDK
&gt; &gt; &gt; &gt; is fixed ? or vice versa ?
&gt; &gt; &gt; 
&gt; &gt; &gt; I&apos;m not building the images, I&apos;m using the ones uploaded to the public AB
&gt; &gt; &gt; http://autobuilder.yoctoproject.org/pub/releases/yocto-2.3_M1.rc1/machines/
&gt; &gt; &gt; qemu/qemux86-lsb/ is there a way to check this directly on the image booted?
&gt; &gt; 
&gt; &gt; Not really. But you can check the captured kernel source in the SDK and note
&gt; &gt; the version from the Makefile. 
&gt; &gt; 
&gt; &gt; The system is working as expected by refusing to load the version mismatched
&gt; &gt; kernel module and running kernel.
&gt; &gt; 
&gt; &gt; Not knowing how the kernel you are booting is associated to the SDK you are
&gt; &gt; downloading I can&apos;t say exactly why they are different.
&gt; &gt; 
&gt; &gt; Do you know where both are coming from ? Can we confirm they are from the
&gt; &gt; same build / build artifacts ?
&gt; 
&gt; I saw that there are 2 kenles uploade to the AB, I do a test with both and
&gt; below are the results :
&gt; 
&gt; http://autobuilder.yoctoproject.org/pub/releases/yocto-2.3_M1.rc1/machines/
&gt; qemu/qemux86-lsb/  
&gt; 
&gt; -
&gt; bzImage--4.1.36+git0+44719fa8f7_fec4924781-r0.2-qemux86-20161216115813.bin:
&gt; running with this one the test PASS 
&gt; 
&gt; - bzImage-qemux86.bin : running with this one the test FAIL

Seems like there were a mistake on the link for Artifacts download script.. I downloaded correct artifacts and tested again with both Kernels an d the error is not appearing anymore. Will close this as not a bug</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>