[BusyBox 0000136]: expr get weird results with long numbers

bugs at busybox.net bugs at busybox.net
Thu Dec 8 11:20:32 UTC 2005


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=136 
====================================================================== 
Reported By:                dreamworks
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   136
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             03-08-2005 11:50 PST
Last Modified:              12-08-2005 03:20 PST
====================================================================== 
Summary:                    expr get weird results with long numbers
Description: 
hi guys,

i'm trying to use busybox within an ramdisk installer image and expr to do
some free disk space calculation... Seems to me that expr just works with
ints or at most unsigned ints... please be aware that modern hard drives
contain 120 GB which are a lot of bytes... (which can not be divided
within expr busybox)

Greetings from Germany




====================================================================== 

---------------------------------------------------------------------- 
 landley - 12-07-05 22:08  
---------------------------------------------------------------------- 
Looking at fixing this, but a reproduction test case would be good. 

---------------------------------------------------------------------- 
 dreamworks - 12-08-05 03:20  
---------------------------------------------------------------------- 
ok, let's do it with a simple example:

(1) On current RHEL v4
mschoen at debug:/home/hindenburg/msc > expr 2147483647 + 1
2147483648

(2) within busybox
/ # /bin/expr 2147483647 + 1
-2147483648

So the bug is quite simple; the implementation uses unsigend int(32bit)
which is not sufficient for modern systems, e.g. take the example
mentioned above with size calculations for Installer Images with 120GByte
Hard disks. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-08-05 11:50  dreamworks     New Issue                                    
03-16-05 12:27  andersen       Assigned To              andersen => BusyBox 
12-07-05 22:08  landley        Note Added: 0000740                          
12-07-05 22:08  landley        Status                   assigned => feedback
12-08-05 03:20  dreamworks     Note Added: 0000745                          
======================================================================




More information about the busybox-cvs mailing list