My Struggle with Qwt

DerAlbi
Posts: 13
Joined: Sat Oct 10 2020 1:44 pm

Re: My Struggle with Qwt

Post by DerAlbi »

The build fails with memory leaks.. have a look: https://pastebin.com/iV7UA5Zz
..i just realized that this is output generated from uic? Ok, so 1) you build a tool, 2) that tool is used in the continued build process, but because it is built with libasan, some uncleanliness in the tool is prohibiting 3) the further build?
Thats a mess :-D

I wonder what is going on with my system. You you can build CS1.7 with asan enabled, then my system must be the cause. Hmmh.
gcc --version wrote:gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
I also have GCC10.2 installed. Shall i switch?

I'll do what i can. Your project in very good spirit.

CandL
Posts: 44
Joined: Mon Oct 14 2019 6:37 pm

Re: My Struggle with Qwt

Post by CandL »

I can't help on that working on putting Copperspice in Conan, but I to am a Qwt user.

I have already made a Conan build of Qwt for various versions of Qt

By the way I am mainly Windows based

marlowa
Posts: 115
Joined: Sun Oct 25 2015 10:52 am

Re: My Struggle with Qwt

Post by marlowa »

[ I am running Linux Mint.
Since you're running linux maybe you can try valgrind?

DerAlbi
Posts: 13
Joined: Sat Oct 10 2020 1:44 pm

Re: My Struggle with Qwt

Post by DerAlbi »

Well, to be totally honest, i have no mental capacity to look into yet another tool.

I, personally, find it strange that with C++, which is standardized, is behaving system dependent with memory leaks and errors. I could get my head behind it that file access or graphics-driver interface or whatever shows an incompatibility but never ever should code result in a system dependent out-of-bounds access, leak or double-free.

For now i think we should investigate if the build process with the address sanitizer actually works. So anyone who has the build process set up and can apply what ansel wrote:

Code: Select all

export CXXFLAGS="-fsanitize=address"

cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=<target directory> <source directory>
could give some feedback.

According to what i posted earlier (https://pastebin.com/iV7UA5Zz) the memory problems are associated with strdup in QMetaObject::getSignatures (line 703?) which uses a non-RAII-guarded new to allocate memory (as per cpp-reference). So yeah, the leak that is detected could be systematic and real, therefore i sincerely would like to ask Ansel if he ever actually tried the Address-Sanitizer?

@CandL: i am not sure what your post is supposed to convey? Do you plan to port Qwt to Copperspice? Do you have already a working solution? Do you also struggle with rotated text?

CandL
Posts: 44
Joined: Mon Oct 14 2019 6:37 pm

Re: My Struggle with Qwt

Post by CandL »

Yes porting Qwt to Copperspice is one of my objectives. Unfortunately it is not a high priority, but probably next in queue.

I work with a number of other developers using Conan, a C++ package manger. Conan is a high priority for us. So when I get time, building CS for Conan in Win 10, MSVS 19 is the priority.

After that I have a "HelloWorld" app that uses different Qt add on libs:
- qwt
- qxlsx
- qtcsv
- quazip

This is a fair bit of work to add into an already busy schedule. But it should give CS a good workout ;)

Right now I am stuck with Conan finding a library but Cmake/Copperspice not finding it. Not really a CS issue.

Let me say I have faith in these folks... it may take a while but I think the effort is worth it. Especially since Qt has announced a Qt 6 migration. Keeping a Qt 5 (Yes I know CS is a Qt 4.8 fork but a LOT of my 5 code looks like it should work)

So a long winded answer to say you are not alone, and that while qwt rotated text maybe a large pot hole, others may fix the same in other libs.

Fight the good Fight

Regards
Carl

DerAlbi
Posts: 13
Joined: Sat Oct 10 2020 1:44 pm

Re: My Struggle with Qwt

Post by DerAlbi »

here you go. Link expires in one week. Save it for later. So far i have nothing found wrong with the lib except the problems within CS.
https://filebin.net/e7fsvomby0wd7r9p
I (clearly) have no idea what i am doing with CMake, so excuse the crudity of my soulution. There is surely a lot missing, but I cant concentrate on that any further.

I am still hoping Ansel will confirm or deny problems when building with AddressSanitizer. Maybe there are false positives - i dont know.

barbara
Posts: 202
Joined: Sat Apr 04 2015 2:32 am

Re: My Struggle with Qwt

Post by barbara »

... i sincerely would like to ask Ansel if he ever actually tried the Address-Sanitizer?
We did say it was run, so the answer is yes. The leaks you are seeing are static and do not grow over time.

As the co-founders of the CopperSpice project I can assure you that CopperSpice and other libraries have been tested with Valgrind, address sanitizer, and pretty much every other sanitizer tool. We also build on CI with GCC and clang on many different versions and they do sometimes behave differently.
For now i think we should investigate if the build process with the address sanitizer actually works
Yes it does run. It sounds like you are experiencing an issue running address sanitizer and we will look at your error report. It may be that some additional configuration or environment setting is required.

Keep in mind, there is a good deal of platform dependent code in CopperSpice since we support countless Linux versions, OS X, MSVC, and MinGW on Windows. The number of different ways you can configure a linux desktop environment is mind boggling.

Right now we are working directly with Microsoft as we discovered an issue in 2017 and some builds of 2019. They do not properly support variadic template specializations. They do have a fix but only for the very latest version of MSVC 2019. This issue does not show up on any other platform or compiler.

Barbara

DerAlbi
Posts: 13
Joined: Sat Oct 10 2020 1:44 pm

Re: My Struggle with Qwt

Post by DerAlbi »

Ok, Barabra, I can understand the issue. Not every code path is testable, not every library version can be accounted for.

I would like to offer you guys support - i can have a look at the problem but i need a workable debug environment. My skillset with build system is "+epsilon"... But debugging i can do - i actually quite enjoy it on a non-embedded target that is able to have more than 4 breakpoints at once :-D.

Also if i am saying something stupid, please forgive me, I do in fact have a limited horizon and its not always easy to know what i dont know when one finds himself in a new environment.

If you guys can provide me with zip-file that includes a CMakeLists.txt that compiles my Error-Case with static linking to CS so i can enable address sanitizer and have source access during debug, i am in. Maybe there are easier options.
Ansel may check his PMs.

ansel
Posts: 99
Joined: Fri Apr 10 2015 8:23 am

Re: My Struggle with Qwt

Post by ansel »

I read your private message and we understand you expressed limited experience with CMake and debugging. I would like to mention that
debugging is a learned skill. It sounds like you have been able to make good progress in tracking down this issue. You also mentioned wanting to learn more about debugging C++ code. We provide educational training for groups and individuals. We also have other team members if this is something you or anyone else might be interested in.

CopperSpice is supported on over 15 platforms in our CI system and Linux Mint is not one of them, since it has limited usage. Your offer for us to log onto your system is appreciated but this is unnecessary.

Investigating Qwt and the text problems are now in our queue. There are other items the team is working on right now so it may be about two weeks until we have a chance to review everything. If you need this resolved sooner we can adjust the priority through our paid subscription policy. Just to be clear, every reported issue will be addressed, it is just a matter of timing.

As a side issue we wanted to mention that anyone who is actively contributing to the development of CopperSpice on a regular basis is welcome to join the team. We have a close knit group who are committed to seeing the project advance.
Ansel Sermersheim
CopperSpice Cofounder

barbara
Posts: 202
Joined: Sat Apr 04 2015 2:32 am

Re: My Struggle with Qwt

Post by barbara »

Not every code path is testable, not every library version can be accounted for.
This is an interesting comment even though I disagree. We test CopperSpice on every supported platform and document which versions of the build tools we support. Every code path is tested and when issues arise they are resolved. Sort of like any other software project. A project like CopperSpice should and will be a moving target as we add new features and refactor for new versions of C++.

A while back someone started building CopperSpice on Arch and then submitted a few patches so now it is a supported platform. As more users migrate to CopperSpice the project matures. As one of the co-founders it is stunning to see threads like this show up and the momentum build.

When Qwt is working with CopperSpice we look forward to a code clean up and review so we can add this as a supported library. It sounds like you might be interested in being the maintainer. Something to think about.

Barbara

Post Reply