CGNS compiled without 64bit crashes

Issue #68 resolved
Former user created an issue

Hello,

I configured MOAB with:

./configure --exec-prefix=/mnt/opt.net/src/moab/Linux~42.2~x86_64 --prefix=/mnt/opt.net/src/moab/Linux~42.2~x86_64 --with-cgns=/usr/lib --enable-shared=yes --enable-static=no --enable-debug --with-cgm=/mnt/opt.net/src/cgm/Linux~42.2~x86_64

Compiling works fine. But I result in a segmentation fault because my CGNS library is compiled with

sizeof(cgsize_t) = 4 and sizeof(EntityHandle) = 8

So my executable ends in an error in the function ReadCGNS::create_elements() (ReadCGNS.cpp), because

memcpy(conn_array, &elemsConn[0], elemsConn.size() * sizeof(EntityHandle)); fails. Maybe it is better to check the size of the two data types and cast if necessary. Please find attached a fix. This small patch worked for me.

Cheers Alex

Comments (6)

  1. Iulian Grindeanu

    what version of cgns? on what platform? how did you build cgns; or did you use a package manager?

  2. Vijay M

    Sorry about the late reply. We will get to this soon. Our buildbot currently checks with version 3.1.4. I doubt whether they changed the API in the minor version, but we will check this.

  3. Log in to comment