c# - Could there be an unexpected collision of MS VC runtimes? -
i have learned hard way, it's not share heap pointers between 2 dlls each depends on different ms vc runtime. fair enough. based on experience , current weird behavior of program chain being debugged ask a
question:
could lib1.dll
using 1 runtime (eg. msvcrt.dll
) possibly damage heap of lib2.dll
using different runtime (eg. vcruntime140d.dll
)? no pointers shared, pairs of malloc/free on same runtime.
background: (for ask it)
- i have standard zeranoe ffmpeg libraries dependent on
msvcrt.dll
. - i created small c dll covering required functionality based on ffmpeg libs, let's call
libvideo.dll
. it's dependent on vs2015 runtime. - i created
libvideosharp.dll
managed c# wrapper library (also vs2015)libvideo.dll
(marshalling). - i created c# test app using
libvideosharp.dll
(also vs2015). - debugging c# test app (and associated libraries in chain) experience following:
libvideo.dll
mallocs , inits data structure.libvideo.dll
calls ffmpeg init routines (av_register_all, avformat_network_init) might malloc on own runtime.libvideo.dll
's data structure corrupted (not passed ffmpeg libs in way, independent malloced block).
Comments
Post a Comment