Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtTech.c: fix uninitialized exts_linearResist value leaks into extresist #393

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dlmiles
Copy link
Contributor

@dlmiles dlmiles commented Feb 26, 2025

This value appears to be initialised at only one spot in the codebase (under very narrow conditions) but extresist will read it and make branching decisions based on the uninitialised state.

This 'X' state propagation appears to eventually get processed in ResWriteExtFile() near where final output formatting is occurring.

It is unclear (at this time) if it perturbs output values in a problematic way, or if due to algorithmic reasons the data is discarded before output anyway. I have at least one trace run (with multiple triggers) of printf formatters handling uninitialised data in ResWriteExtFile().

…sist

This value appears to be initialised at only one spot in the codebase
(under very narrow conditions) but extresist will read it and make
branching decisions based on the uninitialised state.

This 'X' state propagation appears to eventually get processed in
ResWriteExtFile() near where final output formatting is occurring.

It is unclear (at this time) if it perturbs output values in a
problematic way, or if due to algorithmic reasons the data is
discarded before output anyway.  I have at least one trace run (with
multiple triggers) of printf formatters handling uninitialised data
in ResWriteExtFile().
@dlmiles
Copy link
Contributor Author

dlmiles commented Feb 26, 2025

Just to update on this after running more analysis:

magic/resis/ResRex.c

Lines 1851 to 1852 in 705b4da

TxPrintf("Adding %s; Tnew = %.2fns, Told = %.2fns\n",
node->name, gparams.rg_Tdi / Z_TO_P, RCdev / Z_TO_P);

It is this totalization summary that is perturbed by the data in the few project samples I have tried so far. This particular line is only printed to the logs. That doesn't rule out the main output being affected, but I have no example on that to show.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant