Closed s-trinh closed 4 years ago
I have a segmentation fault with the following code:
const int width = 64, height = 48; std::vector<unsigned char> buffer_src(width*height); std::fill(buffer_src.begin(), buffer_src.end(), 0); typedef Simd::View<Simd::Allocator> View; View src(width, height, width, View::Gray8, buffer_src.data()); const int width_resize = 11, height_resize = 17; std::vector<unsigned char> buffer_dst(width_resize*height_resize); View dst(width_resize, height_resize, width_resize, View::Gray8, buffer_dst.data()); Simd::Resize(src, dst, SimdResizeMethodBilinear);
The stack trace:
Program received signal SIGSEGV, Segmentation fault. Simd::Sse2::ResizerByteBilinearInterpolateY<false>(unsigned char const*, unsigned char const*, long long __vector(2)*, unsigned char*) ( dst=0x800000000061994b <error: Cannot access memory at address 0x800000000061994b>, alpha=<synthetic pointer>, bx1=0x61a0f6 "", bx0=0x619ff6 "") at Simd/SimdSse2Resizer.cpp:114 114 Store<false>((__m128i*)dst, _mm_packus_epi16(lo, hi)); (gdb) bt #0 Simd::Sse2::ResizerByteBilinearInterpolateY<false>(unsigned char const*, unsigned char const*, long long __vector(2)*, unsigned char*) ( dst=0x800000000061994b <error: Cannot access memory at address 0x800000000061994b>, alpha=<synthetic pointer>, bx1=0x61a0f6 "", bx0=0x619ff6 "") at Simd/SimdSse2Resizer.cpp:114 #1 Simd::Sse2::ResizerByteBilinear::Run<1ul> (this=0x619a20, src=<optimized out>, srcStride=64, dst=0x619950 "", dstStride=<optimized out>) at Simd/SimdSse2Resizer.cpp:166 #2 0x0000000000400b0e in Simd::Resize<Simd::Allocator> (method=SimdResizeMethodBilinear, dst=<synthetic pointer>..., src=<error reading variable: access outside bounds of object referenced via synthetic pointer>) at Simd/SimdLib.hpp:2842 #3 main (argc=<optimized out>, argv=<optimized out>)
Thank you for bug report. I will try to reproduce this error tomorrow.
The error was reproduced and fixed.
I have a segmentation fault with the following code:
The stack trace: