<?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>1767</bug_id>
          
          <creation_ts>2011-11-16 03:24:54 +0000</creation_ts>
          <short_desc>expr in busybox can&apos;t handle math with big numbers</short_desc>
          <delta_ts>2012-01-19 16:52:50 +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>OE-Core</product>
          <component>core</component>
          <version>1.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.2 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gary Thomas">gary</reporter>
          <assigned_to name="Andrei Gherzan">andrei</assigned_to>
          <cc>andrei</cc>
    
    <cc>lauri.hintsala</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>17228</commentid>
    <comment_count>0</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2011-11-16 03:24:54 +0000</bug_when>
    <thetext>Using the &apos;expr&apos; program from busybox returns incorrect values:
  # ln -s /bin/busybox /tmp/expr
  # /tmp/expr 111517272011 - 111517292011                                                               
  0

Large numbers are supported:
  # /tmp/expr 111517272011
  111517272011

Math works, but only for smaller values:
  # /tmp/expr 65536 - 4
  65532

The &apos;expr&apos; from coreutils works correctly
  # expr.coreutils 111517272011 - 111517292011
  -20000

I get the same results on ARM and PowerPC

Tested using master fa81f8dfb7a342e355b608aa4204cf23ed2b251c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18010</commentid>
    <comment_count>1</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-01-08 15:05:42 +0000</bug_when>
    <thetext>I compiled busybox on my machine and this bug is still present. So i think that this is a busybox bug and not a yocto one. You can test this by downloading source tar ball from upstream and:

~/Desktop/busybox-1.19.3 $ ./expr 111517272011 - 111517292011 
0
~/Desktop/busybox-1.19.3 $ ./expr 111517272011
111517272011
~/Desktop/busybox-1.19.3 $ ./expr 65536 - 4
65532</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18011</commentid>
    <comment_count>2</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-01-08 15:58:38 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; I compiled busybox on my machine and this bug is still present. So i think that
&gt; this is a busybox bug and not a yocto one. You can test this by downloading
&gt; source tar ball from upstream and:
&gt; 
&gt; ~/Desktop/busybox-1.19.3 $ ./expr 111517272011 - 111517292011 
&gt; 0
&gt; ~/Desktop/busybox-1.19.3 $ ./expr 111517272011
&gt; 111517272011
&gt; ~/Desktop/busybox-1.19.3 $ ./expr 65536 - 4
&gt; 65532

So the problem was around a busybox config. I will commit this change in order to fix this bug.

Edwin, you can assign this bug to me if you didn&apos;t already fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18022</commentid>
    <comment_count>3</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-01-09 07:22:19 +0000</bug_when>
    <thetext>http://lists.linuxtogo.org/pipermail/openembedded-core/2012-January/015853.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18114</commentid>
    <comment_count>4</comment_count>
    <who name="Lauri Hintsala">lauri.hintsala</who>
    <bug_when>2012-01-12 23:01:34 +0000</bug_when>
    <thetext>Fix: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=91367de75575e79a94b2f90b6b7aa8740a039fc5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18133</commentid>
    <comment_count>5</comment_count>
    <who name="Lauri Hintsala">lauri.hintsala</who>
    <bug_when>2012-01-13 01:53:47 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Fix:
&gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=91367de75575e79a94b2f90b6b7aa8740a039fc5

Sorry. My fix was for yocto time set issue, which was caused by this bug. You can forget my comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18283</commentid>
    <comment_count>6</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-01-19 16:52:50 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=4884ccd2362681cccc27ea0d198873c7d7a9f09e</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>