java-topology/tools/tickets/scans/v8.md
russell@unturf.com db29a08762 undefect. CWE-407 — 92 sites, 42 ecosystems
B&W print-friendly diagrams + tinkerpop-0001 + wave-3 proof sections.
Squash of 94 local commits onto remote master.
2026-03-26 19:48:18 -04:00

2.3 KiB

id priority status created
scan-v8 medium unscanned 2026-03-23

Target

Repo: https://github.com/nicowillis/v8 (GitHub mirror; canonical source requires depot_tools from https://chromium.googlesource.com/v8/v8) Language: C++ Why: JS JIT compiler affecting Chrome, Node.js, and Deno — linear vector scans in TurboFan IR graph reduction phases inflate compile time on hot functions.

Scan command

# Shallow clone (GitHub mirror)
git clone --depth 1 https://github.com/nicowillis/v8 /tmp/v8

# Submit to unsandbox
cat > /tmp/scan-v8.sh << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
GRAPH_KW="tarjan|strongly.connected|dfs|scc|topolog|topo.sort|cycle|reachab|postorder|dominator|liveness|digraph|shortest.path|path.find"
MEM="std::find|\.count\(|vector.*find|find.*begin.*end|push_back.*visited|visited\.push_back"
find /tmp/v8/src/compiler -name "*.cc" -o -name "*.h" | sort | while read f; do
  graph_lines=$(grep -inE "$GRAPH_KW" "$f" 2>/dev/null | cut -d: -f1 | head -5 || true)
  [ -z "$graph_lines" ] && continue
  while IFS= read -r lineno; do
    s=$(( lineno > 20 ? lineno - 20 : 1 )); e=$(( lineno + 20 ))
    hit=$(sed -n "${s},${e}p" "$f" 2>/dev/null | grep -iE "$MEM" | head -1 | sed 's/^\s*//' || true)
    [ -n "$hit" ] && echo "CANDIDATE\t${f}:${lineno}\t${hit}"
  done <<< "$graph_lines"
done
EOF
export UNSANDBOX_PUBLIC_KEY=unsb-pk-russ-test-isth-best
export UNSANDBOX_SECRET_KEY=unsb-sk-rk46c-3zvpg-zjf6z-hjrge
~/git/un-inception/build/un /tmp/scan-v8.sh

Key files to check

  • src/compiler/graph.cc — TurboFan graph node storage and traversal
  • src/compiler/pipeline.cc — Compilation pipeline; graph reduction phase ordering
  • src/compiler/turbofan-graph-reducer.cc — Node reduction loop; visited/revisit tracking
  • src/compiler/loop-analysis.cc — Loop detection in IR graph; SCC over nodes

Expected pattern

std::find(nodes.begin(), nodes.end(), node) or a NodeVector used as a visited set inside GraphReducer::ReduceGraph or LoopFinder::FindLoops — these are hot paths called per-compilation of JIT-compiled functions.

Acceptance criteria

  • Scan run and results saved to tools/scan-results/v8.txt
  • All CANDIDATE hits triaged (confirmed defect or false positive)
  • If confirmed: defect ticket created in tools/tickets/defects/