Browse Source
Completes G-036's remaining acceptance item - version-based detection of the vulnerable combination (tcludp < 1.0.13 on Tcl 9 Windows: the per-thread exit handler closes the process-global sockListLock/waitForSock events, silently freezing every other udp-using thread's event loop after any udp-loaded thread exits; root-caused and fixed-by-upgrade in 0.4.3). - punk::lib 0.3.0: has_libbug_udp_threadexit gathers live facts (loaded udp version, else best available registered version discovered without loading the binary via an unsatisfiable package require triggering the index scan) and delegates the verdict to the pure classifier libbug_udp_threadexit_applies (facts in, verdict out - testable). has_libbug_* is the new check family for bundled/vendored library bugs; buginfo dicts may carry a full 'url' reference key for non tcl-core trackers. - punk 0.2.1: 'help tcl' scans has_libbug_* alongside has_tclbug_*, renders the url key when present, and no longer errors on a triggered check carrying a reference without a description (latent unset-indent fix). - new checkbugs.test: classifier combination matrix, live-check dict shape and classifier consistency, and a buginfo-contract test across all existing check procs. - verified: current kit (udp 1.0.13) reports bug=0 with no warning; a simulated triggered has_libbug_* check renders description + url in the help tcl warning block. Suites: punk/lib 21 pass, punk/ns 26 pass. - G-036 flipped to achieved 2026-07-08 (index acceptance REMAINING annotated DONE; detail file gains the Detection section). Open non-gating decisions recorded in the detail file: punk8win (8.6) kit udp 1.0.12 swap; optional upstream tickets for residual tcludp trunk weaknesses. - project 0.4.7 (CHANGELOG entry) Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.commaster
9 changed files with 176 additions and 12 deletions
@ -1,3 +1,3 @@
|
||||
[project] |
||||
name = "punkshell" |
||||
version = "0.4.6" |
||||
version = "0.4.7" |
||||
|
||||
@ -1,4 +1,5 @@
|
||||
0.2.0 |
||||
0.2.1 |
||||
#First line must be a semantic version number |
||||
#all other lines are ignored. |
||||
#0.2.1 - 'help tcl' warning scan extended to the has_libbug_* check family (bundled/vendored library bugs, e.g. the G-036 tcludp detection) alongside has_tclbug_*; buginfo 'url' key supported for reference links to non tcl-core trackers; fixed latent unset-indent error when a triggered check had a bugref/url but no description |
||||
#0.2.0 - help system restructured onto a topic registry (::punk::helptopic: register/resolve, per-topic handler procs each with a punk::args definition); ::punk::help and ::punk::help_chunks punk::args definitions (re)generated from the registry so 'i help' / 'i help <topic>' render documented usage; 'help topics' derived from the registry; command-fallthrough and no-arg overview output unchanged; 'help env' degrades cleanly when punk::config is not initialised; help table objects destroyed after printing (leak fix) |
||||
|
||||
@ -1,6 +1,7 @@
|
||||
0.2.1 |
||||
0.3.0 |
||||
#First line must be a semantic version number |
||||
#all other lines are ignored. |
||||
#0.3.0 - new: punk::lib::check::has_libbug_udp_threadexit + libbug_udp_threadexit_applies classifier - version-based detection of tcludp < 1.0.13 on Tcl 9 Windows (per-thread exit handler closes process-global event handles; G-036). has_libbug_* is the new check family for bundled/vendored library bugs, surfaced through 'help tcl' alongside has_tclbug_*; buginfo dicts may carry a full 'url' reference key (non tcl-core trackers) |
||||
#0.2.1 - call-site update for punk::console 0.6.0 tsv array rename: console -> punk_console (is_raw); no behaviour change |
||||
#0.2.0 - new: snapshot_package_paths proc returns a script string reproducing tm list, auto_path, and package prefer for use in thread::create init scripts |
||||
#0.2.0 - extended: interp_sync_package_paths now propagates package prefer and supports optional -libunknown 1 flag for epoch copy + libunknown init |
||||
|
||||
@ -0,0 +1,79 @@
|
||||
package require tcltest |
||||
|
||||
package require punk::lib |
||||
|
||||
#Tests for the punk::lib::check bug-check machinery - added 2026-07-08 with the G-036 |
||||
#tcludp detection (has_libbug_udp_threadexit: tcludp < 1.0.13 on Tcl 9 Windows closes |
||||
#process-global event handles at thread exit - version-based detection per G-036). |
||||
|
||||
namespace eval ::testspace { |
||||
namespace import ::tcltest::* |
||||
variable common { |
||||
set result "" |
||||
} |
||||
|
||||
test libbug_udp_threadexit_classifier {version/platform/tclversion combinations for the tcludp thread-exit bug}\ |
||||
-setup $common -body { |
||||
#vulnerable: udp < 1.0.13, windows, tcl 9 |
||||
lappend result [punk::lib::check::libbug_udp_threadexit_applies 1.0.12 windows 9.0.2] |
||||
lappend result [punk::lib::check::libbug_udp_threadexit_applies 1.0.11 windows 9.1] |
||||
#fixed versions |
||||
lappend result [punk::lib::check::libbug_udp_threadexit_applies 1.0.13 windows 9.0.2] |
||||
lappend result [punk::lib::check::libbug_udp_threadexit_applies 1.0.14 windows 9.0.2] |
||||
#not windows |
||||
lappend result [punk::lib::check::libbug_udp_threadexit_applies 1.0.12 unix 9.0.2] |
||||
#tcl 8.6 (apparent immunity - detection scoped to tcl 9 per G-036 acceptance) |
||||
lappend result [punk::lib::check::libbug_udp_threadexit_applies 1.0.12 windows 8.6.16] |
||||
#no udp package known |
||||
lappend result [punk::lib::check::libbug_udp_threadexit_applies "" windows 9.0.2] |
||||
}\ |
||||
-cleanup { |
||||
}\ |
||||
-result [list 1 1 0 0 0 0 0] |
||||
|
||||
test has_libbug_udp_threadexit_shape {the live check returns the standard buginfo dict shape}\ |
||||
-setup $common -body { |
||||
set buginfo [punk::lib::check::has_libbug_udp_threadexit] |
||||
foreach key {bug description level url} { |
||||
lappend result [dict exists $buginfo $key] |
||||
} |
||||
lappend result [string is boolean -strict [dict get $buginfo bug]] |
||||
lappend result [expr {[dict get $buginfo level] in {minor medium major}}] |
||||
#consistency: the live verdict must match the classifier applied to the reported facts |
||||
lappend result [expr { |
||||
[dict get $buginfo bug] == [punk::lib::check::libbug_udp_threadexit_applies\ |
||||
[dict get $buginfo libversion] $::tcl_platform(platform) [package provide Tcl]] |
||||
}] |
||||
}\ |
||||
-cleanup { |
||||
}\ |
||||
-result [list 1 1 1 1 1 1 1] |
||||
|
||||
test has_bugcheck_procs_return_standard_dict {every has_tclbug_*/has_libbug_* check returns a dict with a boolean bug key and a level}\ |
||||
-setup $common -body { |
||||
set checkprocs [concat\ |
||||
[info procs ::punk::lib::check::has_tclbug*]\ |
||||
[info procs ::punk::lib::check::has_libbug*]\ |
||||
] |
||||
lappend result [expr {[llength $checkprocs] > 0}] |
||||
set badprocs [list] |
||||
foreach bp $checkprocs { |
||||
if {[catch {$bp} buginfo]} { |
||||
lappend badprocs [list $bp error $buginfo] |
||||
continue |
||||
} |
||||
if {![dict exists $buginfo bug] || ![string is boolean -strict [dict get $buginfo bug]]} { |
||||
lappend badprocs [list $bp badbugkey] |
||||
continue |
||||
} |
||||
if {[dict exists $buginfo level] && [dict get $buginfo level] ni {minor medium major}} { |
||||
lappend badprocs [list $bp badlevel [dict get $buginfo level]] |
||||
} |
||||
} |
||||
lappend result $badprocs |
||||
}\ |
||||
-cleanup { |
||||
}\ |
||||
-result [list 1 {}] |
||||
} |
||||
tcltest::cleanupTests ;#needed to produce test summary line. |
||||
Loading…
Reference in new issue