[MOAB-dev] a bug in Coupler::locate_points

Vijay S. Mahadevan vijay.m at gmail.com
Tue Jul 21 12:49:31 CDT 2015


Huayi,

Thank you for this bug report. We didn't have a test case that caught
this particular call tree and so we appreciate the pointer to
inconsistencies.

I'll push a patch to the repo in the next couple of days along with a unit test.

Vijay

On Mon, Jul 13, 2015 at 7:55 PM, Huayi Wei <weihuayi at xtu.edu.cn> wrote:
> Hi, Moab Dev,
>
> In the following member function,  I think it is a bug for line ` tl = new
> TupleList(3, 0, 0, 0, num_points);`.
>
> Here create new TupleList which address will cover the address tl passed by
> user, and then user can not accsess
> it.
>
> I think  it should be ' tl->initialize(3, 0, 0, 0, num_points)`,
>
> ````
> ErrorCode Coupler::locate_points(double *xyz, unsigned int num_points,
>                                  double rel_eps,
>                                  double abs_eps,
>                                  TupleList *tl,
>                                  bool store_local)
> {
>
> .......
>
>   // Copy into tl if passed in and storing locally
>   if (tl && store_local) {
>     tl = new TupleList(3, 0, 0, 0, num_points);
>     tl->enableWriteAccess();
>     memcpy(tl->vi_wr, tl_tmp->vi_rd, 3 * tl_tmp->get_n() * sizeof(int));
>     tl->set_n(tl_tmp->get_n());
>     tl->disableWriteAccess();
>   }
> ....
> }
> ```
>
> Best
>
> Huayi


More information about the moab-dev mailing list