tanakamura / waifu2x-converter-cpp

waifu2x(original : https://github.com/nagadomi/waifu2x) re-implementation in C++ using OpenCV
Other
318 stars 37 forks source link

w2xconv_apply_filter_y crashes #21

Closed HolyWu closed 8 years ago

HolyWu commented 8 years ago

Hi tanakamura,

When I use the prebuilt binary of both 1101 and 1130, my program crashes when invoking w2xconv_apply_filter_y. When I use the 1019 binary, the crash doesn't occur. Could you please provide a debug built with pdb file if you use MSVC to compile it? Thanks.

Best regards, HolyWu

tanakamura commented 8 years ago

Hi HolyWu,

http://int.main.jp/files/w2xc-20151223-debug.zip This file includes w2xc.dll(32bit) and associated w2xc.pdb. (A 64bit binary is built by GCC, therefore, I have only 32bit dll)

The source code revision is 9c92c64485fca0.

If you can get backtrace, please notice me. Thanks,

HolyWu commented 8 years ago

Hi tanakamura, Did you compile the dll with optimization disabled (/Od) ? Because what I could get in call stack is only

w2xc.dll!memcpy(unsigned char * dst, unsigned char * src, unsigned long count) Line 188 Unknown

, which didn't really point to the exact code in cpp. Thanks.

tanakamura commented 8 years ago

OK, try this binary: http://int.main.jp/files/w2xc-20151224-debug.zip

This w2xc is linked with dynamic MSVCR120.dll. You can get MSVCRT's symbol information from Microsoft Symbol Server.

Still if it's useless, could you send a crash dump to me?

HolyWu commented 8 years ago

Hi tanakamura,

Although your new binary still didn't work, I managed to compile the dll by MSVC2015 successfully.

The source of the crash comes from https://github.com/tanakamura/waifu2x-converter-cpp/blob/master/src/w2xconv.cpp#L1577 (and the next line). The src_w and src_h are passed in the wrong order, src_w should be the first and src_h should be the second.

I also find another problem at https://github.com/tanakamura/waifu2x-converter-cpp/blob/master/src/w2xconv.cpp#L1606. It should be result.ptr<char>(yi) instead of srci.ptr<char>(yi), otherwise the result isn't copied to the output.

tanakamura commented 8 years ago

Thanks for your detailed report. I fixed it at cb491951.

HolyWu commented 8 years ago

By the way, one or two months ago the original repo has updated anime_style_art_rgb model and added new photo model for real life material. Won't you update them in your repo as well?