<?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>4403</bug_id>
          
          <creation_ts>2013-04-23 12:42:59 +0000</creation_ts>
          <short_desc>stap fails on core-image-sato x86-64</short_desc>
          <delta_ts>2017-06-13 11:15:51 +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>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexandru Georgescu">alexandru.c.georgescu</reporter>
          <assigned_to name="Tom Zanussi">tom.zanussi</assigned_to>
          <cc>bogdan.a.marinescu</cc>
    
    <cc>ioanax.grigoropol</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>32526</commentid>
    <comment_count>0</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2013-04-23 12:42:59 +0000</bug_when>
    <thetext>poky 789b2b7e0cca404ff8ba8ed5ba823d215e6ba5b4
HOST: Fedora 18 64bit


STEPS TO REPRODUCE:
1. Build a core-image-sato qemux86-64 with stap support (add tools-profile to EXTRA_IMAGE_FEATURES)

2. Launch the qemu image

3. I have the following error in qemux86-64 core-image-sato when using stap:

root@qemux86-64:~# stap trace.stp 
Checking &quot;/lib/modules/3.8.4-yocto-standard/build/.config&quot; failed with error: No such file or directory
root@qemux86-64:~# 



Trace file: 
root@qemux86-64:~# cat trace.stp 
probe syscall.open
{
        printf (&quot;%s(%d) open (%s)\n&quot;, execname(), pid(), argstr)
}

probe timer.ms(4000) # after 4 seconds
{
        exit ()
}
root@qemux86-64:~# 


5. When using crosstap from the host, I have the following:

[yocto@localhost build]$ crosstap root@192.168.7.4 trace.stp 
/mnt/ssd/0418-1/poky/build /mnt/ssd/0418-1/poky/build
/mnt/ssd/0418-1/poky/build
root@192.168.7.4&apos;s password: 
[yocto@localhost build]$</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32559</commentid>
    <comment_count>1</comment_count>
    <who name="Tom Zanussi">tom.zanussi</who>
    <bug_when>2013-04-23 22:05:30 +0000</bug_when>
    <thetext>OK, the first thing is that invoking a script in the target isn&apos;t a supported use-case - only from the host.  Invoking a .stp script directly on the target requires the ability to compile a kernel module on the target, and hasn&apos;t been tested under those conditions.

The only supported mechanism is via &apos;crosstap&apos;, and I don&apos;t see any indication in the output that it failed - just no output, which is very possible if no files were opened on the target.  Try opening some files on the host and see if there&apos;s still no output.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32580</commentid>
    <comment_count>2</comment_count>
    <who name="Ioana Grigoropol">ioanax.grigoropol</who>
    <bug_when>2013-04-24 13:19:34 +0000</bug_when>
    <thetext>Hi Tom,

The error message Alex received is reproducible by running the crosstap script on a qemu machine that has a different architecture than specified in conf/local.conf.
I have two macines: arm and x86_64, and conf/local.conf MACHINE points to qemuarm.

When running crosstap script for the arm machine, the output is:
~/git-repos/poky/build [master] $ crosstap root@192.168.7.2 ../test.stp
~/git-repos/poky/build ~/git-repos/poky/build
~/git-repos/poky/build
syslogd(391) open (&quot;/var/log/messages&quot;, O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE|O_NOCTTY|O_NONBLOCK, 0666)

If I run the script for qemux86-64(without changing the config), the output is:
~/git-repos/poky/build [master] $ crosstap root@192.168.7.4 ../test.stp
~/git-repos/poky/build ~/git-repos/poky/build
~/git-repos/poky/build
Checking &quot;/lib/modules/3.8.4-yocto-standard/build/.config&quot; failed with error: No such file or directory

After changing to qemux84-64, everything works fine:

~/git-repos/poky/build [master] $ vim conf/local.conf 
~/git-repos/poky/build [master] $ crosstap root@192.168.7.4 ../test.stp
~/git-repos/poky/build ~/git-repos/poky/build
~/git-repos/poky/build
dmesg(628) open (&quot;/etc/ld.so.cache&quot;, O_RDONLY|O_CLOEXEC|O_LARGEFILE|O_CLOEXEC)
dmesg(628) open (&quot;/lib/tls/x86_64/libc.so.6&quot;, O_RDONLY|O_CLOEXEC|O_LARGEFILE|O_CLOEXEC)
dmesg(628) open (&quot;/lib/tls/libc.so.6&quot;, O_RDONLY|O_CLOEXEC|O_LARGEFILE|O_CLOEXEC)
dmesg(628) open (&quot;/lib/x86_64/libc.so.6&quot;, O_RDONLY|O_CLOEXEC|O_LARGEFILE|O_CLOEXEC)
dmesg(628) open (&quot;/lib/libc.so.6&quot;, O_RDONLY|O_CLOEXEC|O_LARGEFILE|O_CLOEXEC)
~/git-repos/poky/build [master] $ 

Couldn&apos;t the architecture be determined using the ip from the script instead of the local.conf ? Something like &quot;ssh root@IP uname -m&quot; ?

Thanks,
Ioana</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32581</commentid>
    <comment_count>3</comment_count>
    <who name="Tom Zanussi">tom.zanussi</who>
    <bug_when>2013-04-24 13:43:21 +0000</bug_when>
    <thetext>Yeah, the problem in this case is that crosstap uses bitbake to get a number of variables that it uses in the script:

BITBAKE_VARS=`bitbake -e virtual/kernel`

So having MACHINE pointing to something different will cause it to used the wrong values.

At minimum, this should be documented, and probably the script can detect this and print out a message to that effect.

We could also provide a way to override the settings it gets from the wrong machine, as you suggest.

I&apos;m not sure at this point about the best way to fix it robustly, but in any case it&apos;s easily worked around, and in fact not a common thing that people run into - hadn&apos;t seen it until now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74062</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-06-13 11:15:51 +0000</bug_when>
    <thetext>This appears to be user error in setting an incorrect MACHINE. In an ideal world we&apos;d check the MACHINE setting matched the target but I&apos;m not sure how we&apos;d do that. This doesn&apos;t stand much chance of being implemented as we&apos;re not actively working on crosstap so resolving as user error when testing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>