Commit 6084a50
BUG: PUCMColorKey thread-races wlenthe lazy lookup-table init
The vendored wlenthe coloring functions cubicToHemi and cubicLowToHemi
populate function-static `std::vector<T> irho, omega` lookup tables on
first call. Under ParallelDataAlgorithm (e.g. the simplnx
ComputeIPFColorsFilter with PUCM kind), multiple TBB workers all see
`omega.empty() == true` simultaneously, all enter the resize/iota/
partial_sum block, and the heap allocator eventually trips on a
partially-published vector and aborts with `free_small_botch`.
The PUCMColorKey per-class singletons in each LaueOps subclass are
already serialized by C++11 magic statics during their first
construction, so warm the wlenthe dispatch path once in the
PUCMColorKey constructor with a benign direction. By the time any
worker thread can read the lookup tables they are fully populated.
Keeps the vendored wlenthe_orientation_coloring.hpp byte-identical
(per the existing comment in PUCMColorKey.cpp about preserving
upstream for future re-syncs).
Repro: pipeline at /tmp/pucm_ipf_test.d3dpipeline (Small_IN100 .ang
read → euler rotate → sample rotate → threshold → Compute IPF Colors
with color_key_index=1 PUCM). Pre-fix: crash in `free_small_botch`
inside cubicToHemi via 8 parallel workers. Post-fix: runs cleanly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ed272c8 commit 6084a50
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
| |||
0 commit comments