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

App crash when linked with both Qxlnt and QWebWidget #19

Open
levente-levai opened this issue Oct 20, 2022 · 2 comments
Open

App crash when linked with both Qxlnt and QWebWidget #19

levente-levai opened this issue Oct 20, 2022 · 2 comments
Labels
bug 버그 Something isn't working help wanted 도움 필요 Extra attention is needed question 질문 Further information is requested

Comments

@levente-levai
Copy link

levente-levai commented Oct 20, 2022

fix_expat_c_code.sh.txt
Maybe someone else might find this useful.
I use Qxlnt (many thanks for the author) with QWebWidget in my Qt app (Qt 5.15.2, to be precise). My problem was the app crashing with sigsegv (I used Linux, but I think the problem pops up on other platforms, too) when linked against libQxlnt.a. The chrash happens in the QApplication constructor in a function called XML_ParseBuffer.
After some scratching of my head and consulting the linker map it turned out that the culprit is the C code in Expat xml parser. Probably the names of the functions (starting with XML_) conflict with some functions in the QWebWidget and the linker adds these functions from libQxlnt. The solution was that I renamed all the C functions in

  • xlnt/third-party/libstudxml/libstudxml/parser.cxx
  • xlnt//third-party/libstudxml/libstudxml/details/expat/xmlparse.c
  • xlnt/third-party/libstudxml/libstudxml/details/expat/expat.h

For convenience I attached the bash script I used to do this patching. Run it from the xlnt directory.

@j2doll j2doll added bug 버그 Something isn't working help wanted 도움 필요 Extra attention is needed question 질문 Further information is requested labels Feb 10, 2023
@j2doll
Copy link
Member

j2doll commented Feb 13, 2023

Dear @levente-levai
Can you please test with the following code.

@levente-levai
Copy link
Author

Dear @j2doll,
Nope, same problem persists. As I wrote the issue is not so much with your code (or with expat or with QWebView) but is a linking problem. There may be better solutions than my crude patch but those will be linker-specific. I suggest you mention this somewhere among the build instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 버그 Something isn't working help wanted 도움 필요 Extra attention is needed question 질문 Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants