- fix erroneous use of `{project}` in CIBW_ENVIRONMENT
- fix resulting breaking of PKG_CONFIG_PATH which is set in the manylinux environment to /usr/local/lib/pkgconfig
- cibw_before_all.sh now pulls and builds bison and static libffi into local prefixes on an as-needed basis
- remove linux download and homebrew install of bison in wheels.yml
- add (rewritten) _test_cibw_local.py, based on earlier _run_cibw_linux.py but a bit more robust
Commit fae99416d ("Only init modwalker once.") introduced a shared
ModWalker in OptDffWorker reused across run_constbits() and
run_eqbits(). However, when run_constbits() proves a flip-flop bit is
constant, the below sequence occurs:
OptDffPass::execute()
|
+-> worker.run_constbits()
| |-> fold_const_bits()
| | `-> add_const_target()
| | `-> worker.get_modwalker() #[caches FF Cell* info in modwalker]
| |-> ...
| `-> worker.remove_ff_bits()
| `-> new_ff.emit() #[deletes FF Cell* info in module. cell info in modwalker is stale]
|
`-> worker.run_eqbits()
|-> gather_initial_eq_classes()
`-> filter_classes_sim()
|-> BitSim::sim() #[passes modwalker which has stale cell info]
`-> sim.eval_bit()
|-> cell = modwalker...find().cell #[derives stale cell info]
`-> if (cell->is_builtin_ff()) #[*** crashed as cell pointer is already freed *** ]
So, reset modwalker_ptr in remove_ff_bits() whenever flip-flop bits
are removed so run_eqbits() rebuilds a fresh ModWalker only when the
module netlist was modified.
Reported-by: Sean Luchen <[email protected]>
Signed-off-by: Lokesh Vutla <[email protected]>
- use CIBW_CONFIG_SETTINGS to pass cmake options
- disable homebrew for wheel build - bison is set explicitly
- update cmake option parsing to use shlex so multiple arguments can be provided
- use common CIBW environment (MACOSX_DEPLOYMENT_TARGET has no effect on linux)
When `run_command` reads subprocess output via `fgets` in a multi-threaded process, incoming signals can interrupt the underlying `read` syscall with `EINTR`. Previously, `while (fgets(...) != NULL)` exited the read loop immediately on `EINTR` and called `pclose`, closing the pipe early while the child was still running (or causing the child to die with `SIGPIPE`). Additionally, `run_command` returned `WEXITSTATUS(ret)` without checking `WIFEXITED(ret)`, which evaluates to `0` when a child terminates due to an unhandled signal.
Retry `fgets` after clearing the stream error state when `ferror(f) && errno == EINTR`, and return `-1` if `!WIFEXITED(ret)`.