From 6314a21eb0e5d694cdb6ce1c389c0bb9fc621ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Fri, 18 May 2018 07:12:15 +0300 Subject: [PATCH] Note smash stacking bug Former-commit-id: 6b73fbac57463b6f391fb73dfd243692b2434690 --- BUGS.rst | 3 +++ qpms/translations.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BUGS.rst b/BUGS.rst index e9ff3b4..daefc43 100644 --- a/BUGS.rst +++ b/BUGS.rst @@ -60,3 +60,6 @@ Moreover, the non-normalized legendre functions that are used in translations.c are likely to overflow for even smaller values of l. Therefore TODO: modify translations.c in a way that uses normalised legendre functions everywhere. +Memory management +----------------- +When compiled with optimizations, I get stack smashing error in qpms_trans_calculator_get_2DFT_longrange_AB_arrays(). diff --git a/qpms/translations.c b/qpms/translations.c index f5963b1..14307bd 100644 --- a/qpms/translations.c +++ b/qpms/translations.c @@ -1274,7 +1274,6 @@ int qpms_trans_calculator_get_shortrange_AB_arrays(const qpms_trans_calculator * bes, leg); } - // Long-range parts static inline complex double qpms_trans_calculator_get_2DFT_longrange_A_precalcbuf(const qpms_trans_calculator *c, int m, int n, int mu, int nu, sph_t k_sph /* theta must be M_PI_2 */, @@ -1423,7 +1422,7 @@ int qpms_trans_calculator_get_2DFT_longrange_AB_arrays_buf(const qpms_trans_calc assert(0); } - +// FIXME i get stack smashing error inside the following function if compiled with optimizations int qpms_trans_calculator_get_2DFT_longrange_AB_arrays(const qpms_trans_calculator *c, complex double *Adest, complex double *Bdest, size_t deststride, size_t srcstride,