Skip to content
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

crash when using TDLib with WXPython. #3202

Closed
jawhien opened this issue Dec 28, 2024 · 5 comments
Closed

crash when using TDLib with WXPython. #3202

jawhien opened this issue Dec 28, 2024 · 5 comments

Comments

@jawhien
Copy link

jawhien commented Dec 28, 2024

When I try to use TDLib with the WXPython library, I get the following exception after the first call to td_execute, td_send or td_receieve:

OSError: exception: access violation reading 0x00000000

The problem only occurs when the WXPython library is imported. The libraries work fine separately from each other.

Also if TDLib is compiled in visual studio 2019 there is no problem.

I think the problem appeared when visual studio 2022 was updated to version 17.10 or 17.11
Because before that I compiled tdLib in vs 2022 and there were no conflicts with WXPython.

@levlam
Copy link
Contributor

levlam commented Dec 28, 2024

Could you try to rebuild TDLib with the workaround described at #2912 (comment)?

@jawhien
Copy link
Author

jawhien commented Dec 28, 2024

@levlam
Yes, thank you. It work!

Now only one question remains, can this be fixed in tdLib itself, or is it necessary to use this workaround for compilation every time?

Or would it be much more correct to use vs 2019 for the build, since this workaround may cause other unforeseen problems?
I'm interested in your opinion on this issue. Thank you very much!

@levlam
Copy link
Contributor

levlam commented Dec 28, 2024

The MSVC changelog says

Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in mutex machinery. You must follow this rule: When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component.

Are you sure that you have Redistributable of the new enough version?

@jawhien
Copy link
Author

jawhien commented Dec 29, 2024

@levlam
Oh, that's the thing!
Thanks, now I have figured out this problem.

I mistakenly thought that Visual studio installed the C++ redistributables on the system, but this actually does not happen. In addition, some WXPython wheels contain an old version of the msvcp140.dll library, which also leads to the problem.

@jawhien jawhien closed this as completed Dec 29, 2024
@levlam
Copy link
Contributor

levlam commented Dec 29, 2024

an old version of the msvcp140.dll library, which also leads to the problem.

Yes, this is the cause of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants