bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] Regression bug.


From: Carlo Wood
Subject: Re: [bug-gawk] Regression bug.
Date: Tue, 8 Nov 2016 01:58:06 +0100

On Sun, 06 Nov 2016 01:15:12 -0700
address@hidden wrote:

> Hi.
> 
> Thank you for reporting a bug.
> 
> Without some way for me to reproduce whatever problem you're seeing,
> I cannot proceed to find a solution.
> 
> Please send whatever instructions you think will help to reproduce the
> problem.  Code and data would be even more helpful.
> 
> Thanks,
> 
> Arnold

Hi, thanks for getting back to me.
The following demonstrates the bug.
On a GNU/linux box execute the following commands
(assuming you have all necessary tools installed,
otherwise install them too):

git clone https://github.com/CarloWood/Firmware.git
cd Firmware
git checkout cw_fix_headers
# Make sure you have an 'awk' in your PATH of version 4.1.1,
# then run:
Tools/fix_headers.sh src/drivers/gps/gps.cpp

Now you're all set for the test (the above printed
errors but you can ignore those).

First test: run Tools/fix_headers.sh again still
using gawk version 4.1.1:

Tools/fix_headers.sh --force src/drivers/gps/gps.cpp

This should end in:

[0%] Fixing headers of src/drivers/gps/gps.cpp... No change

Then make 'awk' use a later version, for example
version 4.1.3. Unfortunately I already added a test
to stop people from using that version, so you need
to edit Tools/fix_headers.sh first and change the line:

     fatal "Your version of awk ($AWK_VERSION) is broken. Please use
     version 4.1.1 or lower."

into

     echo "Your version... etc.
     ^^^^

otherwise you can't run the script.

If next you run the script again but now using a later
version than 4.1.1 it will print:

Your version of awk (4.1.3) is broken. Please use version 4.1.1 or
lower.
AWK_VERSION=4.1.3
BASEDIR="/home/carlo/tmp/Firmware"
Uncommitted changes, but running anyway because --force is used.
TMPDIR="/home/carlo/tmp/Firmware"
find: ‘/home/carlo/tmp/Firmware/NuttX/nuttx/include/cxx’: No such file
or directory
basename: missing operand
Try 'basename --help' for more information.
find: ‘/home/carlo/tmp/Firmware/NuttX/misc/uClibc++/include/uClibc++’:
No such file or directory
basename: missing operand
Try 'basename --help' for more information.
SUBMODULES="mavlink/include/mavlink/v1.0 mavlink/include/mavlink/v2.0
NuttX src/modules/uavcan/libuavcan Tools/genmsg Tools/gencpp
Tools/jMAVSim Tools/sitl_gazebo unittests/googletest src/lib/matrix
src/lib/DriverFramework src/lib/ecl cmake/cmake_hexagon
src/drivers/gps/devices"
Finding all source files with #include's (excluding submodules and
build directory)... done
Finding all submodule header files (excluding stdc++ headers)... done
Finding all header files (excluding stdc++ headers)... done
Finding all include paths... done
Determining which headers need to be included with double quotes... done
[0%] Fixing headers of src/drivers/gps/gps.cpp... Fixed lines 39-86

Note that now the last line says that it changed the file.
You can show the made changes with:

git diff -a  src/drivers/gps/gps.cpp

The -a is necessary because it's not unlikely that diff will
now think that the file has become a binary file.

In my diff I find:

-#include <poll.h>
address@hidden <dev_fs_

where the ^@ is a NUL character.

The reason for this change is because in the second awk
script that fix_headers.sh runs, in line 763:

      for (n = 0; n < len; ++n) print txt[k[b]][n];

(len is 1 here), the value of txt[13][0] has changed
from the assigned value "#include <poll.h>" into some
arbitrary undefined string with the same length (because
the memory used for the string was freed and reused)
(for you k[b] might have another value than 13).

The commit that causes this to happen is
31c6051694d3152e50eb037e20c4734c7321eac6
is the gawk repository.

-- 
Carlo Wood <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]