Skip to content

Conversation

@demerphq
Copy link
Collaborator

@demerphq demerphq commented Mar 29, 2023

This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.

@DrHyde - this was motivated by your recent efforts.

@demerphq demerphq force-pushed the yves/taint_disabled branch from 626ba2e to 1923a28 Compare March 29, 2023 09:59
@DrHyde
Copy link
Contributor

DrHyde commented Mar 29, 2023

Might be a good idea to incorporate this commit 988dc01 from #20972 so it gets regularly tested in the future.

@demerphq
Copy link
Collaborator Author

Might be a good idea to incorporate this commit

Good idea. Ill add it shortly.

@demerphq
Copy link
Collaborator Author

@DrHyde : added as suggested, thanks.

@Leont
Copy link
Contributor

Leont commented Mar 29, 2023

I think this should be wired the other way around. There should be a taint_disabled option in Configure, and that sets SILENT_NO_TAINT_SUPPORT

@demerphq
Copy link
Collaborator Author

I think this should be wired the other way around.

That breaks backwards compatibility with the people who have been creating taint-free perl with -Accflags=-DNO_TAINT_SUPPORT or -Accflags=-DSILENT_NO_TAINT_SUPPORT. Those defines have existed for 10 years or so. The configure support for it still doesn't exist properly. Part of the reason the Configure support was retracted was that it didn't support setting the define directly, so I think that idea has already been proved broken.

As a general observation we need to get out of the business of assuming the only thing that setup a config variable is Configure. It puts the horse before the cart. We add new defines to control subsystems in the perl codebase all the time, we rarely add support to Configure to set these defines directly. We should not have to coordinate two repositories to have code be able to introspect these things through the easy API of %Config.

@demerphq
Copy link
Collaborator Author

IMO there is a bigger issue here. We have a variety of defines which control how things work which Configure does not know about. Currently we report those things only via Internals::V().

So what do we do when something gets Configure support?

IMO it is a regression if we stop supporting the "old way" of setting a define directly. Which seems to support the notion that Configure should just set the define, and we should follow the pattern in this patch. Overall it would be backwards compatible, and we could rollout Config.pm support for these things without worrying about the Configure repo.

There are other options of course. We could introduce a new setting that is "owned" by Configure, which then causes the perl defines to be set up internally if they have not been set explicitly. For instance we could introduce d_taint_disabled, which would then cause SILENT_NO_TAINT_SUPPORT or NO_TAINT_SUPPORT to be set, which in turn would set 'taint_disabled' and 'taint_support'

We could also make it so that if Configure sets taint_disabled, then we set SILENT_NO_TAINT_SUPPORT or NO_TAINT_SUPPORT based on it, but if it is not set we set it depending on the state of those defines. That would be the most complex approach IMO.

Personally I favour the the first option, where for things like this Configure sets the define, which then makes things Just Work regardless if you use the -Accflags=... or if you use a Configure Q&A support for it. Conceptually it is the simplest, and it sets a precedent which we can use for many of the other define based controls. For instance the controls for what hash function we support, or if your perl uses a fixed seed, or whatnot.

@DrHyde
Copy link
Contributor

DrHyde commented Mar 29, 2023

When I got started on what became #20972 my use case was that I have code on the CPAN that uses taint-mode and I'd like to be able to test it to make sure it copes OK when taint-mode is not available, while still using a perl that passes all its own tests.

I'm also one of the CPAN-testers, and am planning on running a tester regularly like what I already do with the various options for float- and int-size - and again, I want to use a perl that passes all its own tests.

This scratches that itch.

@demerphq demerphq force-pushed the yves/taint_disabled branch 4 times, most recently from 4c53223 to 4bc59e3 Compare March 30, 2023 12:49
@demerphq
Copy link
Collaborator Author

Without this patch we fail a lot of tests with -DSILENT_NO_TAINT_SUPPORT:


Test Summary Report
-------------------
op/taint.t                                                         (Wstat: 65280 (exited 255) Tests: 23 Failed: 17)
  Failed tests:  2-9, 11-18, 23
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 1065 tests but ran 23.
perf/taint.t                                                       (Wstat: 0 Tests: 4 Failed: 2)
  Failed tests:  1, 3
run/runenv.t                                                       (Wstat: 0 Tests: 106 Failed: 1)
  Failed test:  25
run/switcht.t                                                      (Wstat: 0 Tests: 13 Failed: 4)
  Failed tests:  1, 3, 7, 9
../cpan/Encode/t/taint.t                                           (Wstat: 64000 (exited 250) Tests: 498 Failed: 250)
  Failed tests:  1-248, 497-498
  Non-zero exit status: 250
../cpan/Scalar-List-Utils/t/tainted.t                              (Wstat: 768 (exited 3) Tests: 5 Failed: 3)
  Failed tests:  3-5
  Non-zero exit status: 3
../cpan/Test-Harness/t/compat/test-harness-compat.t                (Wstat: 1536 (exited 6) Tests: 120 Failed: 6)
  Failed tests:  6-7, 98-99, 102-103
  Non-zero exit status: 6
../cpan/Text-ParseWords/t/taint.t                                  (Wstat: 0 Tests: 2 Failed: 2)
  Failed tests:  1-2
../cpan/Test-Harness/t/regression.t                                (Wstat: 8704 (exited 34) Tests: 7632 Failed: 34)
  Failed tests:  3023, 3026, 3028, 3031-3037, 3042-3043
                3048-3049, 3054-3056, 3062-3064, 6787, 6790
                6792, 6795, 6798, 6802-6803, 6806-6808
                6816-6817, 6819-6820
  Non-zero exit status: 34
../lib/locale.t                                                    (Wstat: 0 Tests: 681 Failed: 157)
  Failed tests:  17-26, 32-37, 45-49, 57-61, 64-68, 71-75
                78-82, 85-89, 92-96, 98-102, 116-120, 123-128
                131-136, 155, 169, 171-176, 178-183, 185-190
                192-197, 451, 453, 455, 457, 459, 461, 463
                465, 467, 469, 471, 473, 475, 477, 507
                509, 511, 513, 515, 517, 519, 521, 523
                525, 527, 529, 531, 533, 563, 565, 567
                569, 571, 573, 575, 577, 579, 581, 603
                605, 607, 609, 611, 613, 615, 617, 619
                621, 643, 645, 647, 649, 651, 653, 655
                657, 659, 661
../lib/overload.t                                                  (Wstat: 0 Tests: 5363 Failed: 780)
  Failed tests:  622-623, 628, 633, 636, 641, 646, 649-650
                655, 660, 663, 668, 673, 676-677, 682, 687
                690, 695, 700, 703-704, 709, 714, 717, 722
                727, 730-731, 736, 741, 744, 749, 754, 757-758
                763, 768, 771, 776, 781, 784-785, 790, 795
                798, 803, 808, 811-812, 817, 822, 825, 830
                835, 838-839, 844, 849, 852, 857, 862, 865-866
                871, 876, 879, 884, 889, 892-893, 898, 903
                906, 911, 916, 919-920, 925, 930, 933, 938
                943, 946-947, 952, 957, 960, 965, 970, 973-974
                979, 984, 987, 992, 997, 1000-1001, 1006
                1011, 1014, 1019, 1024, 1027-1028, 1033
                1038, 1041, 1046, 1051, 1054-1055, 1060
                1065, 1068, 1073, 1078, 1081-1082, 1087
                1092, 1095, 1100, 1105, 1108-1109, 1114
                1119, 1122, 1127, 1132, 1135-1136, 1141
                1146, 1149, 1154, 1159, 1162-1163, 1168
                1173, 1176, 1181, 1186, 1189-1190, 1195
                1200, 1203, 1208, 1213, 1216-1217, 1222
                1227, 1230, 1235, 1240, 1243-1244, 1249
                1254, 1257, 1262, 1267, 1270-1271, 1276
                1281, 1284, 1289, 1294, 1297-1298, 1303
                1308, 1311, 1316, 1321, 1324-1325, 1330
                1335, 1338, 1343, 1348, 1351-1352, 1357
                1362, 1365, 1370, 1375, 1378-1379, 1384
                1389, 1392, 1397, 1402, 1405-1406, 1411
                1416, 1419, 1424, 1429, 1432-1433, 1438
                1443, 1446, 1451, 1456, 1459-1460, 1465
                1470, 1473, 1478, 1483, 1486-1487, 1492
                1497, 1500, 1505, 1510, 1513-1514, 1519
                1524, 1527, 1532, 1537, 1540-1541, 1546
                1551, 1554, 1559, 1564, 1567-1568, 1573
                1578, 1581, 1586, 1591, 1594-1595, 1600
                1605, 1608, 1613, 1618, 1621-1622, 1627
                1632, 1635, 1640, 1645, 1648-1649, 1654
                1659, 1662, 1667, 1672, 1675-1676, 1681
                1686, 1689, 1694, 1699, 1702-1703, 1708
                1713, 1716, 1721, 1726, 1729-1730, 1735
                1740, 1743, 1748, 1753, 1756-1757, 1762
                1767, 1770, 1775, 1780, 1783-1784, 1789
                1794, 1797, 1802, 1807, 1810-1811, 1816
                1821, 1824, 1829, 1834, 1837-1838, 1843
                1848, 1851, 1856, 1861, 1864-1865, 1870
                1875, 1878, 1883, 1888, 1891-1892, 1897
                1902, 1905, 1910, 1915, 1918-1919, 1924
                1929, 1932, 1937, 1942, 1945-1946, 1951
                1956, 1959, 1964, 1969, 1972-1973, 1978
                1983, 1986, 1991, 1996, 1999-2000, 2005
                2010, 2013, 2018, 2023, 2026-2027, 2032
                2037, 2040, 2045, 2050, 2053-2054, 2059
                2064, 2067, 2072, 2077, 2080-2081, 2086
                2091, 2094, 2099, 2104, 2107-2108, 2113
                2118, 2121, 2126, 2131, 2134-2135, 2140
                2145, 2148, 2153, 2158, 2161-2162, 2167
                2172, 2175, 2180, 2185, 2188-2189, 2194
                2199, 2202, 2207, 2212, 2215-2216, 2221
                2226, 2229, 2234, 2239, 2242-2243, 2248
                2253, 2256, 2261, 2266, 2269-2270, 2275
                2280, 2283, 2288, 2293, 2296-2297, 2302
                2307, 2310, 2315, 2320, 2323-2324, 2329
                2334, 2337, 2342, 2347, 2350-2351, 2356
                2361, 2364, 2369, 2374, 2377-2378, 2383
                2388, 2391, 2396, 2401, 2404-2405, 2410
                2415, 2418, 2423, 2428, 2431-2432, 2437
                2442, 2445, 2450, 2455, 2458-2459, 2464
                2469, 2472, 2477, 2482, 2485-2486, 2491
                2496, 2499, 2504, 2509, 2512-2513, 2518
                2523, 2526, 2531, 2536, 2539-2540, 2545
                2550, 2553, 2558, 2563, 2566-2567, 2572
                2577, 2580, 2585, 2590, 2593-2594, 2599
                2604, 2607, 2612, 2617, 2620-2621, 2626
                2631, 2634, 2639, 2644, 2647-2648, 2653
                2658, 2661, 2666, 2671, 2674-2675, 2680
                2685, 2688, 2693, 2698, 2701-2702, 2707
                2712, 2715, 2720, 2725, 2728-2729, 2734
                2739, 2742, 2747, 2752, 2755-2756, 2761
                2766, 2769, 2774, 2779, 2782-2783, 2788
                2793, 2796, 2801, 2806, 2809-2810, 2815
                2820, 2823, 2828, 2833, 2836-2837, 2842
                2847, 2850, 2855, 2860, 2863-2864, 2869
                2874, 2877, 2882, 2887, 3538-3539, 3544
                3549, 3552, 3557, 3562, 3565-3566, 3571
                3576, 3579, 3584, 3589, 3592-3593, 3598
                3603, 3606, 3611, 3616, 3619-3620, 3625
                3630, 3633, 3638, 3643, 3646-3647, 3652
                3657, 3660, 3665, 3670, 3673-3674, 3679
                3684, 3687, 3692, 3697, 3700-3701, 3706
                3711, 3714, 3719, 3724, 3727-3728, 3733
                3738, 3741, 3746, 3751, 3754-3755, 3760
                3765, 3768, 3773, 3778, 3781-3782, 3787
                3792, 3795, 3800, 3805, 3808-3809, 3814
                3819, 3822, 3827, 3832, 3835-3836, 3841
                3846, 3849, 3854, 3859, 3862-3863, 3868
                3873, 3876, 3881, 3886, 3889-3890, 3895
                3900, 3903, 3908, 3913, 3916-3917, 3922
                3927, 3930, 3935, 3940, 3943-3944, 3949
                3954, 3957, 3962, 3967, 3970-3971, 3976
                3981, 3984, 3989, 3994, 3997-3998, 4003
                4008, 4011, 4016, 4021, 4024-4025, 4030
                4035, 4038, 4043, 4048, 4051-4052, 4057
                4062, 4065, 4070, 4075, 4078-4079, 4084
                4089, 4092, 4097, 4102, 4105-4106, 4111
                4116, 4119, 4124, 4129, 4186-4187, 4192
                4197, 4200, 4205, 4210, 4213-4214, 4219
                4224, 4227, 4232, 4237, 4789, 4803, 4845
                4859, 4873, 4887, 4892-4893, 4898, 4903
                4906, 4911-4912, 4917, 4922, 4925, 4930-4931
                4936, 4941, 4944-4945, 4950, 4955
../lib/warnings.t                                                  (Wstat: 0 Tests: 941 Failed: 3)
  Failed tests:  767-769
../lib/perl5db.t                                                   (Wstat: 0 Tests: 142 Failed: 1)
  Failed test:  18
Files=2755, Tests=1129357, 352 wallclock secs (224.21 usr 14.80 sys + 1880.75 cusr 75.86 csys = 2195.62 CPU)
Result: FAIL
Finished test run at Thu Mar 30 17:05:33 2023.
make: *** [makefile:865: test_harness] Error 236

@demerphq
Copy link
Collaborator Author

These are the test failures without this branch, but compiled with -DNO_TAINT_SUPPORT

Test Summary Report
-------------------
op/taint.t                                                         (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
op/utftaint.t                                                      (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
perf/taint.t                                                       (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
re/substT.t                                                        (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
run/runenv.t                                                       (Wstat: 0 Tests: 106 Failed: 2)
  Failed tests:  25-26
run/switchDx.t                                                     (Wstat: 0 Tests: 9 Failed: 1)
  Failed test:  8
run/switcht.t                                                      (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/autodie/t/00-load.t                                        (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Encode/t/taint.t                                           (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/ExtUtils-MakeMaker/t/testlib.t                             (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/File-Path/t/taint.t                                        (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Module-Metadata/t/taint.t                                  (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Scalar-List-Utils/t/tainted.t                              (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Sys-Syslog/t/00-load.t                                     (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Sys-Syslog/t/constants.t                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Sys-Syslog/t/cpan-rt-21516.t                               (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Sys-Syslog/t/cpan-rt-21866.t                               (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Sys-Syslog/t/cpan-rt-25488.t                               (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Sys-Syslog/t/syslog.t                                      (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Sys-Syslog/t/syslog-inet-udp.t                             (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Term-ANSIColor/t/taint/basic.t                             (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/aggregator.t                                (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/bailout.t                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/base.t                                      (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/callbacks.t                                 (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/compat/version.t                            (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/compat/inc_taint.t                          (Wstat: 256 (exited 1) Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
../cpan/Test-Harness/t/errors.t                                    (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/compat/inc-propagation.t                    (Wstat: 256 (exited 1) Tests: 2 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
../cpan/Test-Harness/t/nested.t                                    (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/object.t                                    (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/premature-bailout.t                         (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/results.t                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/compat/test-harness-compat.t                (Wstat: 2048 (exited 8) Tests: 120 Failed: 8)
  Failed tests:  6-7, 34-35, 98-99, 102-103
  Non-zero exit status: 8
../cpan/Test-Harness/t/streams.t                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/source_handler.t                            (Wstat: 1024 (exited 4) Tests: 79 Failed: 4)
  Failed tests:  13-14, 39-40
  Non-zero exit status: 4
../cpan/Test-Harness/t/yamlish-output.t                            (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/taint.t                                     (Wstat: 512 (exited 2) Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
../cpan/Test-Simple/t/Test2/behavior/Taint.t                       (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Text-ParseWords/t/taint.t                                  (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Tie-RefHash/t/rebless.t                                    (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Tie-RefHash/t/storable.t                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Tie-RefHash/t/threaded.t                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Tie-RefHash/t/refhash.t                                    (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/version/t/11_taint.t                                       (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/constant/t/constant.t                                      (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/constant/t/utf8.t                                          (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/IO/t/io_taint.t                                            (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/01_about_verbose.t                       (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/09_compile.t                             (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/10_make.t                                (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/20_get.t                                 (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/40_super.t                               (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/50_super.t                               (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/60_super.t                               (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/70_fail_auto.t                           (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/90_utf8.t                                (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/91_backslash.t                           (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/92_blacklist.t                           (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/93_whitelist.t                           (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/94_denylist.t                            (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Locale-Maketext/t/95_allowlist.t                           (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/Net-Ping/t/000_load.t                                      (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/PathTools/t/Spec-taint.t                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/PathTools/t/taint.t                                        (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../dist/SelfLoader/t/03taint.t                                     (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../cpan/Test-Harness/t/regression.t                                (Wstat: 8448 (exited 33) Tests: 7552 Failed: 33)
  Failed tests:  1473-1474, 2994, 2998-2999, 5305, 5307-5311
                5314-5316, 5319-5321, 5328-5329, 6716, 6720-6721
                6728-6730, 6733, 6736-6742
  Non-zero exit status: 33
../dist/XSLoader/t/XSLoader.t                                      (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/Devel-Peek/t/Peek.t                                         (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/DynaLoader/t/DynaLoader.t                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/File-Find/t/taint.t                                         (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/File-Glob/t/taint.t                                         (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/Hash-Util/t/builtin.t                                       (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/Hash-Util/t/Util.t                                          (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/I18N-Langinfo/t/Langinfo.t                                  (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/POSIX/t/sysconf.t                                           (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/POSIX/t/taint.t                                             (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/POSIX/t/termios.t                                           (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../ext/XS-APItest/t/call.t                                         (Wstat: 0 Tests: 538 Failed: 1)
  Failed test:  538
../lib/blib.t                                                      (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../lib/builtin.t                                                   (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../lib/DB.t                                                        (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../lib/File/Basename.t                                             (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../lib/Getopt/Std.t                                                (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../lib/Internals.t                                                 (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../lib/locale.t                                                    (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../lib/overload.t                                                  (Wstat: 7424 (exited 29) Tests: 0 Failed: 0)
  Non-zero exit status: 29
  Parse errors: No plan found in TAP output
../lib/B/Deparse.t                                                 (Wstat: 0 Tests: 332 Failed: 2)
  Failed tests:  303, 328
../lib/warnings.t                                                  (Wstat: 0 Tests: 941 Failed: 3)
  Failed tests:  767-769
../lib/perl5db.t                                                   (Wstat: 0 Tests: 142 Failed: 1)
  Failed test:  18

@demerphq demerphq force-pushed the yves/taint_disabled branch from 4bc59e3 to 8bf72b4 Compare March 31, 2023 10:24
@DrHyde
Copy link
Contributor

DrHyde commented Mar 31, 2023

Maybe add a CONFIGURE_ARGS matrix to the automated Windows tests so that the gotcha that @tonycoz pointed out is tested. Having a matrix of CONFIGURE_ARGS there in the workflow would hopefully remind people in the future that build options like this need testing per-platform, not just per-option.

@demerphq
Copy link
Collaborator Author

Maybe add a CONFIGURE_ARGS matrix to the automated Windows tests

I am a bit reluctant to do that, although I did think about it. We don't run the win32 build and test in parallel mode, so they take a long time, and apparently we consume a lot of resources with our Win32 tests already. So I am not sure if it would be a good thing to add yet more win32 tests. I wonder if there is some way to have our cake and eat it too tho, maybe run a reduced test of tests only.

@demerphq demerphq force-pushed the yves/taint_disabled branch from 8bf72b4 to 87c7f60 Compare April 1, 2023 14:14
@demerphq
Copy link
Collaborator Author

demerphq commented Apr 1, 2023

I just added a patch to disable or skip the tests that break under -DNO_TAINT_SUPPORT.

@DrHyde
Copy link
Contributor

DrHyde commented Apr 1, 2023

Latest patches look good. Perhaps excessively pedantically, the commit message for 77c56f9 might have its first paragraph better phrased as "This patch uses a collection of heuristics to skip test files which would die on a perl compiled with -DNO_TAINT_SUPPORT but without -DSILENT_NO_TAINT_SUPPORT", for as we discussed elsewhere, SILENT_NO_TAINT_SUPPORT also turns on NO_TAINT_SUPPORT, it just makes it shut the hell up. Given that we're OK with editing history and force-pushing I think it's worth updating.

@demerphq demerphq force-pushed the yves/taint_disabled branch from 87c7f60 to 11cafc0 Compare April 2, 2023 09:10
@demerphq
Copy link
Collaborator Author

demerphq commented Apr 2, 2023

might have its first paragraph better phrased as ...

Done. Thank you for the suggestion.

demerphq and others added 4 commits April 2, 2023 11:16
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
Add an entry for -DSILENT_NO_TAINT_SUPPORT to our linux based test
matrix. Currently we cannot do the same for plain -DNO_TAINT_SUPPORT
as it chokes on -t and -T on the command line.

[Committers note: edited commit message to add detail]
This patch uses a collection of heuristics to skip test files which
would die on a perl compiled with -DNO_TAINT_SUPPORT but without
-DSILENT_NO_TAINT_SUPPORT.

-DNO_TAINT_SUPPORT disables taint support in a "safe" way, such that if
you try to use taint mode with the -t or -T options an exception will be
thrown informing you that the perl you are using does not support taint.
(The related setting -DSILENT_NO_TAINT_SUPPORT disables taint support
but causes the -t and -T options to be silently ignored.)

The error from using -t and -T is thrown very early in the process
startup and there is no way to "gracefully" handle it and convert it
into something else, for instance to skip a test file which contains it.

This patch generally fixes our code to skip these tests.

* Make t/TEST and t/harness check shebang lines and use filename checks
  to filter out tests that use -t or -T. Primarily this is the result of
  checking their shebang line, but some cpan/ files are excluded by
  name, either from a very short list of exclusions, or because their
  file name contains the word "taint". Non-cpan test files were fixed
  individually as noted below.

* test.pl - make run_multiple_progs() skip test cases based on the
  switches that are part of the test definition. This function is
  used in a great deal of our internal tests, so it fixes a lot of
  tests in one go.

* XS-APITest/t/call.t, t/run/switchDX.t, lib/B/Deparse.t - Skip a small
  set of tests in each file.
Test that we can pass test with -DNO_TAINT_SUPPORT but without
-DSILENT_NO_TAINT_SUPPORT. Both disable taint mode, but the latter
causes -t and -T to be silently ignored, whereas the former by itself
causes use of -t and -T to throw fatal exceptions during process
startup.
@demerphq demerphq force-pushed the yves/taint_disabled branch from 11cafc0 to 5b2d453 Compare April 2, 2023 09:22
@demerphq demerphq merged commit 5940297 into blead Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants