OpenImageIO
OpenImageIO copied to clipboard
building on Mac with Address Sanitizer. OpenImageIO_v_2_3::pvt::append_error gets null message and crashes
when OIIO compiled on macOS Xcode 13 with sanitizer options. the pvt::append_error() function doesn't get the message variable passed as expected. becomes null
this doesn't happen when not building sanitized build
-fsanitize=address -fsanitize-recover=address -fsanitize=undefined,bounds,float-divide-by-zero,unsigned-integer-overflow,implicit-conversion -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-sanitize=alignment,vptr,function
in this the .mov file is not recognized - not configured. the error message should be output
frame #4: 0x000000014d84911f libOpenImageIOMaya.2.3.10.dylib`OpenImageIOMaya_v2_3::ImageInput::create(filename=(m_chars = "/Users/mayadev/branch/maya/worktrees/main/Maya/data/Proprietary/images/testImagePlane.mov", m_len = 89), do_open=
but instead we then crash on null object access. message has become null
frame #2: 0x000000014d7f925e libOpenImageIOMaya.2.3.10.dylib`OpenImageIOMaya_v2_3::pvt::append_error(message=(m_chars = 0x0000000000000000, m_len = 0)) at imageio.cpp:235:18 [opt] 232 // a single newline. 233 if (error_msg.size() && error_msg.back() != '\n') 234 error_msg += '\n'; -> 235 if (message.size() > 0) 236 error_msg += message; 237 238 // Remove a single trailing newline
Hi, Wayne. I'm a little confused about how to reproduce this. The idea here is... you're trying to open a .mov file, but the ffmpeg reader is not enabled at all? Is that the circumstance in which the error happens?
Do you have a reliable way to reproduce it with any of the bundled programs like oiiotool?
Correct, ffmpeg not configured in this case. I have a number of workflows. if there is no extension on the filename provide to ::open() then will attempt to output an error message. this is just on the sanitizer build on Mac. not sure what triggered this. may be compiler update I'll try with oiiotool
Also, can you try a build with the current master? The code in that region has changed between 2.3 and 2.4, and we're very close to a 2.4 release, which will then be the main supported branch moving forward. So if it's something that's already fixed and 2.3 is about to be obsolete, we may not want to bother chasing this down.
will give it a try
on our build using 2.3.10 - can reproduce when using oiitool from our build we don't include .mov support, or just use a file extension that isn't supported. ie aa.ffff running: oiiotool -I aaa.mov results in ASAN abort. this is on a Mac, Monterey 12.4. Xcode 13.4.1
still need to setup for the master build. is there a timeline for when 2.4.x is expected ?
our normal sanitizer options are: -fsanitize=address -fsanitize-recover=address -fsanitize=undefined,bounds,float-divide-by-zero,unsigned-integer-overflow,implicit-conversion -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-sanitize=alignment,vptr,function
for the time being I've disabled building OpenImageIO with sanitizer flags. overriding our normal build settings by adding: "-flat_namespace -fno-sanitize=all -fomit-frame-pointer -Wl,-undefined,suppress"