New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyQt's qwindows.dll is corrupted by UPX #107
Comments
Does it work with upx 3.91 ? |
No, UPX 3.91 does not work as well. I have some new findings recently, when run pyinstaller in single-folder mode, with replacing the folder 3.91 does not works, too. |
I have just tried to replace only |
I just dug into this, I think it's because UPX compresses some sections it shouldn't, such as
I'm not sure if just preserving this section is sufficient or not, though. |
@tycho is correct, this is caused by the removal of the .qtmetad section. Since this section only provides metadata and no code, and also does not need relocations, it is even possible to fix Okay... if that sounds like a tedious waste of time, that's because it is, so I don't recommend it. But it should help clarify the cause. I'm not sure why the Qt developers didn't simply use the existing resource directory for this, as it's already perfectly suitable for it and would probably even save a few bytes due to alignment. But then again, there's no law against making up weird PE sections for no good reason, so I won't judge... Edit: That's all for today's lesson on 'how not to find 200 bytes in your own DLL'... |
UPX 3.94, same problem. |
Just to report that UPX 3.95, same problem. |
So, all you smart MSWindows hackers, where's the pull request for UPX to "ignore" PE section .qtmetad, probably by appending its contents (upon first encounter) to the end of the previous PE section, then splitting that PE section when writing the compressed result? |
UPX seems to break a lot of DLLs: upx/upx#107
UPX is known to "corrupt" Qt plugins (it removes the .qtmetadata section and QTMETADATA magic string - see upx/upx#107). Instead of requiring users to manually exclude Qt plugins from UPX processing, do it automatically based on the file analysis, i.e., full back-to-front scan for the QTMETADATA magic string. Fixes pyinstaller#4178.
UPX is known to "corrupt" Qt plugins (it removes the .qtmetad section and QTMETADATA magic string - see upx/upx#107). Instead of requiring users to manually exclude Qt plugins from UPX processing, do it automatically based on the file analysis, i.e., full back-to-front scan for the QTMETADATA magic string. Fixes pyinstaller#4178.
UPX is known to "corrupt" Qt plugins (it removes the .qtmetad section and QTMETADATA magic string - see upx/upx#107). Instead of requiring users to manually exclude Qt plugins from UPX processing, do it automatically based on the file analysis, i.e., full back-to-front scan for the QTMETADATA magic string. Fixes #4178.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please feel free to reopen. |
What's the problem (or question)?
I try use PyInstaller to make a bundle of my program, when pack my codes and dependencies without calling UPX, it works well (both in one-folder or one-file mode). But things go wrong when I perform UPX compression on them.
What should have happened?
When I try run my program, it raises:
When PyInstaller is packing my codes, the parameter it calls UPX with is like:
Do you have an idea for a solution?
I've check all related issue (no matter open & close) in this repo and pyinstaller's repo, and it brings me that may be there's something wrong with
qwindows.dll
. But I can find directoryqt5_plugins\platforms
which containsqwindows.dll
in the location of my program.I also try to add path (-p) to make it contain the dll file (path like
C:\ProgramData\Anaconda3\Library\plugins\platforms
) when use pyinstaller, but it not works as well.And setting the run-time environment variable
set QT_QPA_PLATFORM_PLUGIN_PATH="C:\ProgramData\Anaconda3\Library\plugins\platforms"
orset QT_QPA_PLATFORM_PLUGIN_PATH="C:\Users\USER\Desktop\Gao-s-SB\src\gaosb\dist\main\qt5_plugins\platforms"
not works, too, which just change the error message to something like this:Besides, I do use the latest PyInstaller in dev branch by
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
How can we reproduce the issue?
cmd
, change the directory to where themain.py
exists (Gao-s-SB/src/gaosb)dist/main
created just now and run themain.exe
file. The error will occur.Please tell us details about your environment.
upx --version
): Current latest version: 3.94The text was updated successfully, but these errors were encountered: