segfault with kerr initial data using IDAnalyticBH

Create issue
Issue #310 closed
Bruno Mundim created an issue

Yosef's bug report and patch:

Hi,

If initial_data=kerr and metric_type=physical, IDAnalyticBH writes to psi[x-z] and psi[x-z][x-z] (it tries to set these GFs to zero) even if no storage is allocated. The problem is with the code

IDAnalyticBH_zero_CCTK_REAL_array(npoints, psix); etc.., which is only executed when the metric is physical.

I was able to use the Kerr data with the following patch, but just deleting the offending lines should be sufficient.

--- Kerr.c 2011-02-10 09:08:58.000000000 -0500 +++ /tmp/Kerr.c 2011-02-23 18:15:38.000000000 -0500 @@ -103,6 +103,10 @@ conformal_storage); /NOTREACHED/ } } + else + { + *conformal_state = 0; + }

/* printf("npoints: %i\n",npoints); */

@@ -311,15 +315,22 @@ } IDAnalyticBH_zero_CCTK_REAL_array(npoints, gxz); IDAnalyticBH_zero_CCTK_REAL_array(npoints, gyz); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psix); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psiy); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psiz); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psixx); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psixy); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psixz); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psiyy); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psiyz); - IDAnalyticBH_zero_CCTK_REAL_array(npoints, psizz); + + if (psix && conformal_state < 2) + { + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psix); + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psiy); + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psiz); + } + if (psixx && conformal_state < 3) + { + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psixx); + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psixy); + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psixz); + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psiyy); + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psiyz); + IDAnalyticBH_zero_CCTK_REAL_array(npoints, psizz); + } }

return;

Keyword: IDAnalyticBH

Comments (2)

  1. Log in to comment