[BusyBox 0005594]: atan2, builtin function of awk, causes Segmentation Fault.

bugs at busybox.net bugs at busybox.net
Mon Oct 20 11:32:59 UTC 2008


The following issue has been SUBMITTED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=5594 
====================================================================== 
Reported By:                kotak
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   5594
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             10-20-2008 04:32 PDT
Last Modified:              10-20-2008 04:32 PDT
====================================================================== 
Summary:                    atan2, builtin function of awk, causes Segmentation
Fault.
Description: 
The following command causes "Segmentation Fault" though should return
"0.785398". 

awk 'BEGIN {print atan2(1,1);}'

The following patch fixes this.

Index: editors/awk.c
===================================================================
--- editors/awk.c       (revision 23739)
+++ editors/awk.c       (working copy)
@@ -2025,7 +2025,7 @@

        case B_a2:
 #if ENABLE_FEATURE_AWK_MATH
-               setvar_i(res, atan2(getvar_i(av[i]), getvar_i(av[1])));
+               setvar_i(res, atan2(getvar_i(av[0]), getvar_i(av[1])));
 #else
                syntax_error(EMSG_NO_MATH);
 #endif


Regards,
kotak
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-20-08 04:32  kotak          New Issue                                    
10-20-08 04:32  kotak          Status                   new => assigned     
10-20-08 04:32  kotak          Assigned To               => BusyBox         
======================================================================




More information about the busybox-cvs mailing list