Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncopts global variable is not used properly with shared libraries on MacOSX #60

Closed
vfonov opened this issue Nov 5, 2015 · 1 comment
Assignees

Comments

@vfonov
Copy link
Member

vfonov commented Nov 5, 2015

The error happens when mincresample is used with minc1 file on MacOSX, with libminc compiled as shared library.
While resampling a standard 3D volume with X,Y,Z dimension, mincresample tries to iterate over all possible dimensions and exclude their information from copying headers ( see https://github.com/BIC-MNI/minc-tools/blob/develop/progs/mincresample/mincresample.c#L1365 ).
By setting ncopts=0, it is supposed to prevent libminc from bailing, however on MacOSX the global variable ncopts inside mincresample points to a different location then from within libminc, which leads to failure when vector dimension is queried ( https://github.com/BIC-MNI/minc-tools/blob/develop/progs/mincresample/mincresample.c#L1393 ) and netcdf fails, causing mincresample to exit.

Looking with a debugger:
in the context of mincresample:
(lldb) p &ncopts
(int *) $2 = 0x00000001000cdf44

and in the context of libminc:
(lldb) p &ncopts
(int *) $4 = 0x00000001008c7be4

@vfonov vfonov assigned andrewjanke and rdvincent and unassigned andrewjanke Nov 5, 2015
@vfonov
Copy link
Member Author

vfonov commented Nov 5, 2015

So, this happens when libminc is build as shared library, and netcdf is build as static library.

@vfonov vfonov closed this as completed Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants