Fix memory leak in radTInteraction::EmptyVectOfPtrToListsOfTrans#4
Open
per-gron wants to merge 1 commit into
Open
Fix memory leak in radTInteraction::EmptyVectOfPtrToListsOfTrans#4per-gron wants to merge 1 commit into
per-gron wants to merge 1 commit into
Conversation
It seems that iterating starting from 1 is a simple typo here. It causes the two objects that are first in these two arrays not to be deallocated. The objects were allocated in radTInteraction::CountMainRelaxElems.
ochubar
reviewed
Dec 30, 2019
| inline void radTInteraction::EmptyVectOfPtrToListsOfTrans() | ||
| { | ||
| for(unsigned i=1; i<IntVectOfPtrToListsOfTransPtr.size(); i++) | ||
| for(unsigned i=0; i<IntVectOfPtrToListsOfTransPtr.size(); i++) |
Owner
There was a problem hiding this comment.
Nice catch. I'll make more tests / debugging, and will probably merge this.
ksugahar
added a commit
to ksugahar/Radia
that referenced
this pull request
Jun 2, 2026
Locks the verified converged Karl fixed point for calc_fem_coilmesh --impedance-model esim on ih_fem_kelvin_skin.vol + steel BH: esim_ converged, <=4 iters, monotone-decreasing dZ, Z_s=5.553e-3+7.338e-3j, P_wp=1.58e-4 W, L=155.7 nH, P_coil=1.39e-4 W (15% band, mesh-sensitive). Captured 2026-06-02 from a direct run; assertion logic cross-checked 10/10 PASS against the captured values. Skips gracefully on (a) the gitignored Cubit sample being absent and (b) the LAB pytest+pardiso MKL-thread-DLL-load env artifact. Physical validation vs an independent esim reference is future work (ochubar#6). Completes ochubar#4: esim was ALREADY implemented + working; this golden plus the WIP-label removal (5302e9f) close it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ksugahar
added a commit
to ksugahar/Radia
that referenced
this pull request
Jul 2, 2026
…ings) Follow-up to 5e24d4c (BEM-A unified on the impedance-EFIE; PEC post-hoc path deleted). Fixes the remaining findings from the 4-lens adversarial review of the unification diff: - coil_inductance_ngsolve docstring: the mesh MUST be a pure surface mesh (volume tets make the saddle LU singular; point at the panel's _extract_surface_mesh_filtered and the volume_vol golden). - calc_inductance: stale "Multiply real surface J" comment updated for the complex impedance-EFIE per-triangle phasor (Re/Im bridged separately). - test_coil_bem_a_impedance_efie: mesh load/extract moved inside the TaskManager region (TaskManager-Only policy). - MCP knowledge recipes (cubit scripting + build123d): both fed a VOLUME mesh straight into compute_inductance_source_sink -- the documented singular-LU pathology. cubit recipe now extracts the boundary surface first; build123d recipe meshes surface-only via MeshingParameters(perfstepsend=MeshingStep.MESHSURFACE). - ih_knowledge failed-approach ochubar#4: compute_phi_inc_from_surface_J now RAISES TypeError on complex J (was: silently cast to real). - compare_dowell_sibc_bessel_straight_wire: historical note that BEM-A is now the impedance-EFIE (coincides with the PEC path on a uniformly-loaded straight wire, so the canonical comparison stands). Validation after all fixes: test_coil_bem_a_impedance_efie 3/3 PASS (torus absolute bands + sqrt(f) scaling + DC branch; wire == Bessel; minres-complex rejection), volume_vol + vacuum_rect goldens PASS, kubota coil e2e R=4.6293 mOhm / L=411.59 nH / residual 6e-15. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems that iterating starting from 1 is a simple typo here. It causes the two objects that are first in these two arrays not to be deallocated.
The objects were allocated in radTInteraction::CountMainRelaxElems.
I found this with Address Sanitizer. The change removes the warning and seems to work. The change is tested on Linux/Clang only.