[Bug 12981] New: awk: seems to try to falsely expand strings

bugzilla at busybox.net bugzilla at busybox.net
Thu Jun 4 21:48:48 UTC 2020


https://bugs.busybox.net/show_bug.cgi?id=12981

            Bug ID: 12981
           Summary: awk: seems to try to falsely expand strings
           Product: Busybox
           Version: 1.31.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: steffen at sdaoden.eu
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Created attachment 8491
  --> https://bugs.busybox.net/attachment.cgi?id=8491&action=edit
Test script for reproduction

Hello!

I have encountered a busybox 1.31.1 awk (AlpineLinux edge) problem that cannot
be seen with mawk, mawk-debian nor gawk.  nawk segfaults for the script so i
cannot say :-)

Please find attached a reduced script which must be run like

 # awk="/bin/busybox awk" CC=gcc TARGET=1 sh ./su-make-errors.sh

Sorry for $CC, it can be any ISO C89 compiler i would say.
The difference (compared to the other awks running on CRUX-Linux) will be

  --- .x.gawk     2020-06-04 23:24:13.000905415 +0200
  +++ .x.busybox-awk      2020-06-04 23:23:51.210905829 +0200
  @@ -2,8 +2,8 @@
   #define su__ERR_NUMBER_MAX 0xFFu
   #define su__ERR_NUMBER_ENUM_C \
      su_ERR_NONE = 0,\
  -   su_ERR_AGA = (su__ERR_NUMBER_MAX - 1),\
  -   su_ERR_AGA2 = (su__ERR_NUMBER_MAX - 2),\
  +   su_ERR_AGA = 00),\
  +   su_ERR_AGA2 = 10),\

These strings come from code which says

         while(getline dl < dat){
            ++cnt
            split(dl, ia)
            if(ia[1] < 0)
               ia[1] = "(su__ERR_NUMBER_MAX - " ++unavail ")"
            map[ia[2]] = ia[1]
            print verb "su_ERR_" ia[2] " = " ia[1] ",\134"
         }
         close(dat)

Ciao!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list