Closed alvinhochun closed 8 years ago
Video card driver seems like a good place to start.
Maybe also try English Locale.
I am not keeping open bugs on general launch failures and system incompatibilities. It works for me and many others. I know it does not work for everybody. Either it works for you, or it doesn't, and maybe you will debug it or not.
Well, I guess I might be doing that too. If the latest display driver doesn't fix it, I'd better just try git HEAD, right? Guess I would be downloading the latest Qt later and freaking run out of disk space...
Is there a release with debugging symbols though?
There is no release with debugging symbols, and it is not trivial to setup a development environment for Shotcut especially on Windows: http://www.shotcut.org/bin/view/Shotcut/SetupWindowsDev
You do not need to use a specific version of Qt Creator (or that IDE), but you will need to configure a "build kit" to point to a specific compiler version and Qt SDK - not just any will do. The Shotcut SDK alone (not including Qt, MinGW, and Qt Creator) is 761 MB.
If you want to proceed, e-mail me for the Shotcut SDK download link. I will not post it here because I do not want to make it easy for just anyone to try, bug me with questions, make malware-infested knock-offs, etc. You can easily find my e-mail address in the comment headers of the source code.
And well... looks like I found the cause... it is the locale, duh... It's even hinted on the stack trace, that iconv_close
is related to the crash.
Having the locale (formatting, not display language or non-unicode program codepage) set to zh-HK (or also zh-MO, but I am not in Macau) makes Shotcut crash, but zh-TW doesn't. Which is weird since all three usually use Big-5 (codepage 950). (Well... arguably Big5-HKSCS is also a possibility, but Windows doesn't use it by default I believe.)
I have never used iconv though, so it probably will take me some time to look into this. Perhaps I should find where iconv is used. The stack trace points to libmlt
, so I guess I should start there?
See here: https://github.com/mltframework/mlt/blob/master/src/win32/win32.c#L69
Probably cd is invalid pointer because encoding was not accepted, and iconv_close() does not handle invalid iconv_t. This function is only used by the function directly below it; so you can see what/how encoding is being passed. Certainly, I can add a check if "cd" is valid before iconv_close(). Then, I can give you a new build to test tomorrow. Look over mlt_properties_from_utf8() and let me know if you see something else suspicious for your locale and codepage.
Ok, I think I found the code.
https://github.com/mltframework/mlt/blob/master/src/win32/win32.c#L74 which is called by https://github.com/mltframework/mlt/blob/master/src/win32/win32.c#L95
It seems that it is calling iconv_open
with A.R..950
(those are actual dots with char code 2e
) as the first argument (encoding
).
A.R.
seems to be a substring of Hong Kong S.A.R
, which makes a lot of sense, since in mlt_properties_from_utf8
it attempts to take the substring after the first dot.
Here's what I think... if you want to get the system ANSI codepage (non-unicode program codepage), you should better just use GetACP
. Also, the user locale does not necessarily match the ANSI codepage since it can be configured differently.
I guess there might also be some bugs in libiconv too which made it failed to reject the erroneous encoding.
I will change to use GetACP() and test "cd" before iconv_close() and give you a overnight build to test tomorrow. Re-opening since you are helping and this might be resolvable. Thanks
Actually, when I think about it more carefully, using setlocale
to get the codepage could be correct in some cases. It seems that the setlocale
locale affects C library string functions while GetACP
gets the codepage which affects Windows API calls. Depending on the usage, one might be better than the other. Also, user locale, default user locale and system locale in Windows are really confusing.
Can you tell what mlt_properties_from_utf8
is used for? Is it for data in a file with ANSI encoding or something else?
Though I guess you can go on with the GetACP
build and I will test it after work.
Edit: _getmbcp
also seems to be a possibility.
The purpose of this function is to convert UTF-8 strings as standardized by MLT to a filename that can be used by other libraries such as libavformat and libxml2 that expect file names to be in an encoding compatible with the Windows file system. setlocale() as used here is only used to lookup the system locale - not to set it for the C lib functions.
According to MSDN docs for fopen
By default, a narrow filename string is interpreted using the ANSI codepage (CP_ACP).
In this case, GetACP
seems to be the way to go.
Here is the MLT commit: https://github.com/mltframework/mlt/commit/a26deb7e15294ca40b17e5dab780da9d0f065ba9
A new build will be available in about 12 hours.
Thanks, it started without crashing.
OS: Windows 7 x64 (SP1), locale: zh-HK Display: Intel HD 4000 / NVIDIA NVS 5400M (NVIDIA Optimus) Shotcut version: 15.11.03
Well, it just crashes pretty quickly after showing the splash screen. StackHash it says. The exception code is 0xc0000374 (heap corruption)
Running it with WinDbg attached detects the exception. But Shotcut managed to get to the main window if I instruct it to continue running. Don't know if it would properly though. Here is some log with stacktrace:
I will try updating display drivers tomorrow if necessary.
Any idea if anything else could be wrong?
shotcut-log.txt
on crash: