Releases: kolkov/racedetector
v0.8.4
Pure-Go Race Detector v0.8.4 (2025-12-19)
Production-ready race detection without CGO!
Works with CGO_ENABLED=0 - perfect for Docker, cloud functions, and embedded systems.
Bug Fixes
Issue #33: GetVersion() Missing 'v' Prefix
Release binaries returned version without 'v' prefix (0.8.3 instead of v0.8.3), causing racedetector test to fail on external projects:
go: errors parsing go.mod:
require github.com/kolkov/racedetector: version "0.8.3" invalid
Issue #34: Type Names in make/new Incorrectly Instrumented
Code like make([]*CustomType, 0) caused compilation errors because type names were incorrectly instrumented as variable reads:
SexpFunction (type) is not an expression
Changes
GetVersion()now ensures 'v' prefix for non-dev versionsextractReads()skips type expression AST nodes (ArrayType, MapType, ChanType, etc.)- Special handling for
make/new- skip first argument (always a type)
Found while testing on zygomys project.
Installation:
go install github.com/kolkov/racedetector/cmd/racedetector@v0.8.4Quick Start:
racedetector build main.go
racedetector run main.go
racedetector test ./...Documentation: https://github.com/kolkov/racedetector#readme
v0.8.3
Pure-Go Race Detector v0.8.3 (2025-12-19T19:05:28Z)
Production-ready race detection without CGO!
Works with CGO_ENABLED=0 - perfect for Docker, cloud functions, and embedded systems.
Changelog
🐛 Bug Fixes
Installation:
# Using go install (recommended):
go install github.com/kolkov/racedetector/cmd/racedetector@v0.8.3
# Or download binary for your platform aboveQuick Start:
# Build with race detection:
racedetector build main.go
# Run with race detection:
racedetector run main.goDocumentation: https://github.com/kolkov/racedetector#readme
Report Issues: https://github.com/kolkov/racedetector/issues
v0.8.2
Pure-Go Race Detector v0.8.2
Production-ready race detection without CGO!
Works with CGO_ENABLED=0 - perfect for Docker, cloud functions, and embedded systems.
🐛 Bug Fix: Issue #27 - Pointer Dereferences Not Instrumented
Critical bug found by @thepudds (Go Team member)
Pointer dereferences like *ptr++ were not being instrumented, causing false negatives:
func update(ptr *int) { // ptr doesn't escape (correct)
*ptr++ // BUT *ptr accesses potentially shared memory!
}Root cause: Go parser uses *ast.StarExpr for pointer dereference in IncDecStmt, but our code only checked *ast.UnaryExpr.
Changes:
- Added
*ast.StarExprhandling in visitor.go - Added test cases for Issue #27 reproduction
- Race now correctly detected in @thepudds example
Before fix: 0 writes, 0 reads instrumented for *ptr++
After fix: Race correctly detected ✅
Acknowledgments
Thanks to @thepudds for finding this critical bug and providing the reproduction case!
Installation
# Using go install (recommended):
go install github.com/kolkov/racedetector/cmd/racedetector@v0.8.2
# Or download binary for your platform aboveQuick Start
# Build with race detection:
racedetector build main.go
# Run with race detection:
racedetector run main.go
# Test with race detection:
racedetector test ./...Documentation: https://github.com/kolkov/racedetector#readme
Report Issues: https://github.com/kolkov/racedetector/issues
v0.8.1
Pure-Go Race Detector v0.8.1
Production-ready race detection without CGO!
What's New
Escape Analysis Integration
- Uses compiler
go build -gcflags="-m"to detect stack-local variables - 30-50% reduction in instrumentation on real codebases
- Named return value false positives eliminated
New toolexec Command
go build -toolexec="racedetector toolexec" ./...Intercepts compile calls for complex build systems and IDE integration.
Tested On
- zygomys (Issue #17): lexer.go 14 writes/35 reads → 9 writes/18 reads
Installation
go install github.com/kolkov/racedetector/cmd/racedetector@v0.8.1Fixes
- #17 - False positives on named return values
Full Changelog: v0.7.2...v0.8.1
v0.7.2
Pure-Go Race Detector v0.7.2
Production-ready race detection without CGO!
Works with CGO_ENABLED=0 - perfect for Docker, cloud functions, and embedded systems.
What's Fixed
Stack Trace Display (Issue #17)
- Expanded
isInternalStackFrame()filter to cover all racedetector packages - Updated
captureCallerPC()to skip 6 frames for accurate user code PC - Test functions are now correctly shown in stack traces
False Positives on Stack-Local Variables (Issue #20)
- Skip instrumentation of named return values (stack-local)
- Skip instrumentation of function parameters (pass-by-value copies)
- Added
isStackLocal()check in instrumentor
Phase 2 Roadmap
Detailed tasks created for further false positive reduction:
- #21: Loop variables (~30% reduction)
- #22: Short declarations (~40% reduction)
- #23: go/types integration (~20% reduction)
Installation:
# Using go install (recommended):
go install github.com/kolkov/racedetector/cmd/racedetector@v0.7.2
# Or download binary for your platform aboveQuick Start:
# Build with race detection:
racedetector build main.go
# Run with race detection:
racedetector run main.goDocumentation: https://github.com/kolkov/racedetector#readme
Report Issues: https://github.com/kolkov/racedetector/issues
v0.7.1
Pure-Go Race Detector v0.7.1 - Hotfix Release
Production-ready race detection without CGO!
Works with CGO_ENABLED=0 - perfect for Docker, cloud functions, and embedded systems.
Bug Fixes (Thanks @glycerine!)
Issue #15: Test command flags
-cflag now works correctly (compile only, don't run)-oflag now works correctly (output file path)- Version injection fixed (was hardcoded v0.4.10)
Issue #16: CGO file handling
- CGO files (
import "C") are now detected and copied unchanged - Skips instrumentation to avoid C symbol errors
Issue #17: Stack traces
- Stack traces now show user code location instead of internal frames
- Filters out
OnWrite,OnRead,runtime.*frames
Performance Note
Stack trace capture adds ~145ns per memory access (runtime.Callers baseline).
Overall overhead remains within <20x target.
Further optimization tracked in Issue #18.
Installation
# Using go install (recommended):
go install github.com/kolkov/racedetector/cmd/racedetector@v0.7.1
# Or download binary for your platform aboveQuick Start
# Build with race detection:
racedetector build ./...
# Run with race detection:
racedetector run main.go
# Test with race detection:
racedetector test -c -o mytest.exe ./...Full Changelog: https://github.com/kolkov/racedetector/blob/main/CHANGELOG.md
Documentation: https://github.com/kolkov/racedetector#readme
Report Issues: https://github.com/kolkov/racedetector/issues
v0.7.0
v0.7.0 - Major Performance Optimizations
Target: <20x overhead (down from ~100x)
This release delivers major performance optimizations through lazy evaluation, lock-free data structures, and memory pooling techniques.
Performance Improvements
| Optimization | Improvement |
|---|---|
| Lazy Stack Capture | 2.6x faster hot path (329ns → 127ns) |
| Lock-Free VarState | 10x faster access (atomic operations) |
| Sharded Shadow Memory | 12.5% faster concurrent access |
| VectorClock Pooling | 99.7% fewer allocations, 3,387x faster creation |
Technical Details
Lazy Stack Capture
- Removed
CaptureStack()from hot path - Before: ~329ns per write (full stack capture)
- After: ~127ns per write (PC only, lazy full capture on race)
Lock-Free VarState
- Hot-path fields now use
atomic.Uint64,atomic.Int64,atomic.Uintptr - Mutex only for complex operations (VectorClock promotion)
Sharded Shadow Memory
- 256 shards instead of single sync.Map
- Cache-line padding prevents false sharing
- Reduces contention under concurrent load
VectorClock Pooling
sync.Poolfor VectorClock reuse- Before: 1,009 allocations per benchmark
- After: 3 allocations per benchmark
Quality
- 359/359 race detection tests passing
- 0 linter issues
- 100% backward compatible
Installation
go install github.com/kolkov/racedetector/cmd/racedetector@v0.7.0Acknowledgments
Research Papers:
- FastTrack: "Efficient and Precise Dynamic Race Detection" (PLDI 2009)
- SmartTrack: "Efficient Predictive Race Detection" (PLDI 2020)
- ThreadSanitizer design documents
v0.6.0
v0.6.0 - Unsynchronized Access Detection
100% test reliability for race detection tests!
Fixed
Unsynchronized Access Detection
- GoStart/GoEnd instrumentation: VectorClock inheritance from parent to child goroutines
- SmartTrack TOCTOU race fix: CAS-based atomic ownership claim
- Spawn context FIFO ordering: Strict first-spawn-first-child matching
- sync.Map reassignment race: Safe map clearing via Range+Delete
CI Reliability
- Added
GOMAXPROCS=1to CI (same workaround as official Go race tests) - Test reliability: 70% → 100%
Added
Go Race Test Suite
- 359/359 test scenarios from official Go race detector
- 21 test category files covering all race patterns
- 100% pass rate
Changed
- Professional README rewrite (662 → 189 lines)
Installation:
go install github.com/kolkov/racedetector/cmd/racedetector@v0.6.0Usage:
racedetector build -o app main.go
racedetector run main.go
racedetector test ./...Documentation: https://github.com/kolkov/racedetector#readme
v0.5.2
Pure-Go Race Detector v0.5.2 (2025-12-10T11:15:55Z)
Production-ready race detection without CGO!
Works with CGO_ENABLED=0 - perfect for Docker, cloud functions, and embedded systems.
Changelog
🐛 Bug Fixes
Installation:
# Using go install (recommended):
go install github.com/kolkov/racedetector/cmd/racedetector@v0.5.2
# Or download binary for your platform aboveQuick Start:
# Build with race detection:
racedetector build main.go
# Run with race detection:
racedetector run main.goDocumentation: https://github.com/kolkov/racedetector#readme
Report Issues: https://github.com/kolkov/racedetector/issues
v0.4.10
Pure-Go Race Detector v0.4.10 (2025-12-10T01:32:34Z)
Production-ready race detection without CGO!
Works with CGO_ENABLED=0 - perfect for Docker, cloud functions, and embedded systems.
Changelog
🐛 Bug Fixes
Installation:
# Using go install (recommended):
go install github.com/kolkov/racedetector/cmd/racedetector@v0.4.10
# Or download binary for your platform aboveQuick Start:
# Build with race detection:
racedetector build main.go
# Run with race detection:
racedetector run main.goDocumentation: https://github.com/kolkov/racedetector#readme
Report Issues: https://github.com/kolkov/racedetector/issues