You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In running valgrind to debug an unrelated issue, I noticed it returned the following, relating to the cs_post_anisotropy_invariant utility function.
==585844== Invalid read of size 8
==585844== at 0x4B4FB74: cs_post_anisotropy_invariant (cs_post_util.c:780)
==585844== by 0x12C0A2: cs_user_postprocess_values (cs_user_postprocess-profiles.c:904)
==585844== by 0x4B4BE98: cs_post_time_step_output (cs_post.c:7844)
==585844== by 0x4B4C070: cs_post_write_vars (cs_post.c:7932)
==585844== by 0x4B4D674: cs_post_default_write_variables (cs_post_default.c:226)
==585844== by 0x495EC5A: caltri_ (caltri.f90:1079)
==585844== by 0x4860225: _run (cs_solver.c:511)
==585844== by 0x4860558: main (cs_solver.c:779)
==585844== Address 0x1e7ca150 is 0 bytes after a block of size 1,200 alloc'd
==585844== at 0x48447A8: malloc (vg_replace_malloc.c:446)
==585844== by 0x581D1C8: bft_mem_malloc (bft_mem.c:829)
==585844== by 0x4B4F9E2: cs_post_anisotropy_invariant (cs_post_util.c:754)
==585844== by 0x12C0A2: cs_user_postprocess_values (cs_user_postprocess-profiles.c:904)
==585844== by 0x4B4BE98: cs_post_time_step_output (cs_post.c:7844)
==585844== by 0x4B4C070: cs_post_write_vars (cs_post.c:7932)
==585844== by 0x4B4D674: cs_post_default_write_variables (cs_post_default.c:226)
==585844== by 0x495EC5A: caltri_ (caltri.f90:1079)
==585844== by 0x4860225: _run (cs_solver.c:511)
==585844== by 0x4860558: main (cs_solver.c:779)
I believe this arises because the wrong array index is used to access values of the rij array on these lines:
Rather than iel, shouldn't it be iloc? The rij array is allocated to be n_cells big, where n_cells is a value passed into the function along with a cell_ids list. Thus the indexing used here is not that of the parent mesh. Indeed, the rij array is filled by indexing across i=0; i < n_cells in the preceding code.
(Note this valgrind report is from runs on v8.0.3, but I note the code for this function hasn't changed in the master branch)
Best regards,
Dean
The text was updated successfully, but these errors were encountered:
In running valgrind to debug an unrelated issue, I noticed it returned the following, relating to the
cs_post_anisotropy_invariant
utility function.I believe this arises because the wrong array index is used to access values of the
rij
array on these lines:code_saturne/src/base/cs_post_util.cpp
Lines 788 to 800 in 45e337c
Rather than
iel
, shouldn't it beiloc
? Therij
array is allocated to ben_cells
big, wheren_cells
is a value passed into the function along with acell_ids
list. Thus the indexing used here is not that of the parent mesh. Indeed, therij
array is filled by indexing acrossi=0; i < n_cells
in the preceding code.(Note this valgrind report is from runs on v8.0.3, but I note the code for this function hasn't changed in the master branch)
Best regards,
Dean
The text was updated successfully, but these errors were encountered: