The NetBSD Project

CVS log for src/usr.bin/make/unit-tests/opt-file.mk

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / make / unit-tests

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.16 / (download) - annotate - [select for diffs], Mon Apr 1 12:26:02 2024 UTC (13 days, 21 hours ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +8 -4 lines
Diff to previous 1.15 (colored)

make: exit immediately after reading a null byte from a makefile

The chance of other garbage bytes in such a file is just too high.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Mar 26 13:32:31 2022 UTC (2 years ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

make: clean up comments

Revision 1.14 / (download) - annotate - [select for diffs], Thu Dec 9 20:47:33 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.13: +8 -4 lines
Diff to previous 1.13 (colored)

make: add back support for jemalloc 100

The ports sun2 and vax default to jemalloc 100, as opposed to the rest
of the ports, which use jemalloc 510.  Some developers choose to use
jemalloc 100, so let them run the tests with memory debugging as well.

Suggested by mrg on source-changes-d.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Dec 5 14:57:36 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

tests/make: migrate to jemalloc > 100

When I started working on usr.bin/make in 2020, I used NetBSD 8, which
used jemalloc 100.

After updating to NetBSD 8 to 9.99.x, the debugging options for jemalloc
stopped working since MALLOC_OPTIONS had been replaced with MALLOC_CONF
in 2019.

Enable malloc debugging again, to reliably reproduce the use-after-free
for the variable modifier ':@'.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Apr 4 10:13:09 2021 UTC (3 years ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

make: remove filler word 'Do' from function names for parsing

No functional change, except for debug logging.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Dec 22 08:57:23 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored)

make(1): fix comment in test about null bytes in makefiles

Revision 1.10 / (download) - annotate - [select for diffs], Tue Dec 22 08:51:30 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.9: +10 -1 lines
Diff to previous 1.9 (colored)

make(1): re-add improved assertion in ParseGetLine

Revision 1.9 / (download) - annotate - [select for diffs], Tue Dec 22 08:23:12 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

make(1): clean up after test opt-file

Revision 1.8 / (download) - annotate - [select for diffs], Tue Dec 22 08:05:08 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.7: +10 -1 lines
Diff to previous 1.7 (colored)

make(1): fix assertion failure for files without trailing newline

Previously, mmapped files didn't always have the final newline added.
Only those that ended at a page boundary did.

This confused ParseRawLine, which assumed (and since parse.c 1.510 from
moments ago also asserted) that every line ends with a newline, which
allows the code to assume that after a backslash, there is at least one
other character in the buffer, thereby preventing an out-of-bounds read.

This bug had been there at least since parse.c 1.170 from 2010-12-25
04:57:07, maybe even earlier, I didn't check.

Now line_end always points to the trailing newline, which allows
ParseGetLine to overwrite that character to end the string.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Dec 6 20:55:30 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.6: +22 -3 lines
Diff to previous 1.6 (colored)

make(1): document undefined behavior from 2014

Earlier versions of make didn't know the -v option to print the expanded
value of a variable.  To make the test runnable by older makes as well,
switch to -V instead, which has been available much longer.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Dec 6 20:33:44 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.5: +8 -4 lines
Diff to previous 1.5 (colored)

make(1): error out on null bytes in makefiles

Makefiles are text files, they must not contain null bytes.

The previous code in this area was rotten anyway.  It assumed that
buf_end could be NULL even if buf_ptr was a valid pointer, which is no
longer true, probably since a few years already.

Continuing parsing after a null byte does not make sense.  If there's a
null byte in a text file, that file is corrupted, and parsing it leads
to unintended effects easily.  Therefore the only sensible action is to
stop parsing immediately.

The check whether cf->readMore could be null was outdated as well, which
previously made the fatal error impossible to reach.  Because of the
missing unit tests, nobody noticed this though.

The "exit status 0" in opt-file.exp is worring but that's due to another
bug and will be fixed in a follow-up commit.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Dec 6 20:07:25 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.4: +36 -2 lines
Diff to previous 1.4 (colored)

make(1): document how make behaved for null bytes in the makefile

Revision 1.4 / (download) - annotate - [select for diffs], Sun Dec 6 19:18:26 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.3: +15 -3 lines
Diff to previous 1.3 (colored)

make(1): add test for makefile containing null bytes

Revision 1.3 / (download) - annotate - [select for diffs], Sun Dec 6 19:00:48 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.2: +10 -1 lines
Diff to previous 1.2 (colored)

make(1): test parsing a makefile that ends in a backslash

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 16 14:25:16 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

make(1): describe the purpose of each newly added unit test dummy

Revision 1.1 / (download) - annotate - [select for diffs], Sun Aug 16 12:07:51 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN

make(1): add dummies for fine-grained tests, one per single feature

The test names have been derived from the current manual page.

All these tests are dummies right now, and the code from the existing
tests will be moved into the new tests step by step.

This is done to prevent modmisc, escape, varmod-edge and varmisc from
growing without any bounds, and to reduce the side-effects of one test
to the others.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>