You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "kevingurney (via GitHub)" <gi...@apache.org> on 2023/04/18 22:26:37 UTC

[GitHub] [arrow] kevingurney opened a new issue, #35224: [Docs][C++] Add warning to the "Building on Windows" documentation for the Arrow C++ libraries about potential MSVC Runtime compatibility issues with `Debug` builds

kevingurney opened a new issue, #35224:
URL: https://github.com/apache/arrow/issues/35224

   ### Describe the enhancement requested
   
   As discussed in [this comment thread](https://github.com/apache/arrow/pull/34563#discussion_r1167214786), when building the Arrow C++ libraries in `Debug` mode on Windows using Visual Studio, the resulting `arrow.dll` file will be linked against a [`MultiThreadedDebugDLL` (i.e. `/MDd`) version](https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html) of the [MSVC Runtime libraries](https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features) (e.g. `VCRUNTIME140D.dll` - note the **D** for **D**ebug in the DLL name).
   
   This can lead to unexpected behavior (e.g. crashes, memory corruptions, etc.) when linking `arrow.dll` against other code that is built against a different MSVC Runtime (e.g. a non-`Debug` version). We ran into this issue when [developing the MATLAB interface](https://github.com/apache/arrow/pull/34563#discussion_r1160962568) and linking a `Debug` build of `arrow.dll` against a [MATLAB MEX function](https://www.mathworks.com/help/matlab/call-mex-functions.html) (which is linked against a non-`Debug` MSVC Runtime by default). It was quite challenging to determine the root cause of the issue from the symptoms (memory corruption).
   
   The fact that [every DLL and EXE can be linked against a different MSVC Runtime](https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-170#what-problems-exist-if-an-application-uses-more-than-one-crt-version) may not be obvious to some C++ developers who primarily develop on platforms other than Windows. Therefore, it might be helpful to add a note to the ["Debug Builds" section of the "Building on Windows" documentation for the Arrow C++ libraries](https://arrow.apache.org/docs/developers/cpp/windows.html#debug-builds) to warn developers about potential MSVC Runtime compatibility issues when building in `Debug` mode. Hopefully, this will help prevent other community members from having to spend lots of effort debugging similar issues in the future.
   
   ### Component(s)
   
   C++, Documentation


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] westonpace commented on issue #35224: [Docs][C++] Add warning to the "Building on Windows" documentation for the Arrow C++ libraries about potential MSVC Runtime compatibility issues with `Debug` builds

Posted by "westonpace (via GitHub)" <gi...@apache.org>.
westonpace commented on issue #35224:
URL: https://github.com/apache/arrow/issues/35224#issuecomment-1515598472

   As someone that has been bitten by this in the past (and still doesn't fully understand it) I can appreciate the suggestion :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org