CGNS compiled without 64bit crashes
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)
-
-
Account Deleted reporter It is cgns version 3.2.1 . I install the package from the science repository in openSUSE 42.2. https://build.opensuse.org/package/show/science/cgns
To figure out the bug I download the sources of cgns 3.2.1 and compile it with cmake option CGNS_ENABLE_64BIT . And this works for me without my small patch.
-
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.
-
Account Deleted reporter This is still an issue. Tested newest version.
-
A new PR [1] with your provided patch has been submitted. Thanks. Feel free to review and approve. This fix should be available in the upcoming release.
[1] https://bitbucket.org/fathomteam/moab/pull-requests/545/cgns-issue-fix
-
- changed status to resolved
The fix submitted in PR #545 has been merged now
- Log in to comment
what version of cgns? on what platform? how did you build cgns; or did you use a package manager?