<?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>287</bug_id>
          
          <creation_ts>2010-09-07 23:47:44 +0000</creation_ts>
          <short_desc>connmand segfault with qemumips sato/sdk images</short_desc>
          <delta_ts>2010-12-21 06:07:12 +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>0.9</version>
          <rep_platform>x86</rep_platform>
          <op_sys>mips</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.9 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="xianchao zhang">xianchao.zhang</reporter>
          <assigned_to name="Qing He">qing.he</assigned_to>
          <cc>dongxiao.xu</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>kevin.tian</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>qing.he</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>xianchao.zhang</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          <cf_verified>Program Management</cf_verified>
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>9644</commentid>
    <comment_count>0</comment_count>
    <who name="xianchao zhang">xianchao.zhang</who>
    <bug_when>2010-09-07 23:47:44 +0000</bug_when>
    <thetext>Testing Env:    
Host: Ubuntu 10.04 LTS
Kernel: 2.6.32-21-generic-pae
Image location: http://autobuilder.pokylinux.org/milestone/20100905-1/

1. download sato or sdk image from milesone build.
2. boot up qemumips with either image
3. run command &apos;connmand&apos;, segfault will arise.

###################

root@qemumips:~# connmand
 Segmentation fault

####################</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9871</commentid>
    <comment_count>1</comment_count>
    <who name="Qing He">qing.he</who>
    <bug_when>2010-09-16 18:28:51 +0000</bug_when>
    <thetext>I&apos;ll look at this bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9876</commentid>
    <comment_count>2</comment_count>
    <who name="Qing He">qing.he</who>
    <bug_when>2010-09-16 23:00:23 +0000</bug_when>
    <thetext>It&apos;s interesting, crash actually happened in /lib/ld.so.1.

Tracing back, found it&apos;s in elf/rtld.c:1612
&gt;   /* Set up debugging before the debugger is notified for the first time.  */
&gt; #ifdef ELF_MACHINE_DEBUG_SETUP
&gt;   /* Some machines (e.g. MIPS) don&apos;t use DT_DEBUG in this way.  */
&gt;   ELF_MACHINE_DEBUG_SETUP (main_map, r);                  // &lt;== 1612
&gt;   ELF_MACHINE_DEBUG_SETUP (&amp;GL(dl_rtld_map), r);
&gt; #else

and ELF_MACHINE_DEBUG_SETUP is defined in ports/sysdeps/mips/dl-machine.h:
&gt; /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in
&gt;    with the run-time address of the r_debug structure  */
&gt; #define ELF_MACHINE_DEBUG_SETUP(l,r) \
&gt; do { if ((l)-&gt;l_info[DT_MIPS (RLD_MAP)]) \
&gt;        *(ElfW(Addr) *)((l)-&gt;l_info[DT_MIPS (RLD_MAP)]-&gt;d_un.d_ptr) = \
&gt;        (ElfW(Addr) *)(r); \
&gt;    } while (0)

Looking at the connmand binary:
&gt;  0x70000016 (MIPS_RLD_MAP)      0

So this is where it crashes.

According to sysv-abi mips supplement, &quot;DT_MIPS_RLD_MAP ... is used by debugging. It contains the address of a 32-bit word in the .data section which is supplied by the compilation environment. The word&apos;s contents are not specified and programs using this value are not ABI - compliant.&quot;

This means MIPS_RLD_MAP should have legitimate values rather than 0, the problem probably lies in binutils. Will look around to see which configuration triggers the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9877</commentid>
    <comment_count>3</comment_count>
    <who name="Qing He">qing.he</who>
    <bug_when>2010-09-17 01:02:14 +0000</bug_when>
    <thetext>the triggering parameter is -Wl,--version-script=connman.ver, since the _RLD_MAP variable is rendered local by the version script, DT_MIPS_RLD_MAP cannot get the value of the variable and thus leaves 0 there.

Possible solutions are:
1. add _RLD_MAP in global section of connman.ver
2. modify binutils to let it fill DT_MIPS_RLD_MAP regardless the locality of _RLD_MA
3. add sanity check in glibc to ignore MIPS_RLD_MAP if it&apos;s 0

we also needs to checkif  eglibc suffers from this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9968</commentid>
    <comment_count>4</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2010-09-27 11:23:34 +0000</bug_when>
    <thetext>http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=0f55d28a4d1f425343eb5aeae3eb7ffb3efd266a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10053</commentid>
    <comment_count>5</comment_count>
    <who name="xianchao zhang">xianchao.zhang</who>
    <bug_when>2010-09-29 18:59:10 +0000</bug_when>
    <thetext>With the latest nightly build (20100928), this issue has been fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>