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

Fix: AbstractMetaBuilder::classesTopologicalSorted #148

Merged
merged 2 commits into from
Nov 10, 2023
Merged

Fix: AbstractMetaBuilder::classesTopologicalSorted #148

merged 2 commits into from
Nov 10, 2023

Conversation

jbowler
Copy link
Contributor

@jbowler jbowler commented Nov 9, 2023

This fixes explicit new/delete, storage leaks (missing delete) and iteration over a QHash while modifying it (deleting specific keys in an iterator).

Tested against the current make_generator_work_for_5.15 branch; it generates identical output and crashes in the same places (6.5.3).

@mrbean-bremen mrbean-bremen force-pushed the make_generator_work_for_5.15 branch from 7be0dd9 to d476532 Compare November 9, 2023 18:29
This explicit new/delete, storage leaks (missing delete) and iteration
over a QHash while modifying it (deleting specific keys in an iterator).

Signed-off-by: John Bowler <[email protected]>
Copy link
Contributor

@mrbean-bremen mrbean-bremen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much cleaner than before, especially as it avoids the new / delete stuff. I'm not sure about the performance - the numbers seen in the CI are not really conclusive - but I don't really care as much about performance here as about correctness and stability.

generator/abstractmetabuilder.cpp Outdated Show resolved Hide resolved
generator/abstractmetabuilder.cpp Outdated Show resolved Hide resolved
generator/abstractmetabuilder.cpp Show resolved Hide resolved
@jbowler
Copy link
Contributor Author

jbowler commented Nov 10, 2023

I'm not sure about the performance.

That's why I started looking at it; the GCC with -pg showed this one function (including the things it calls) as accounting for a very large percentage of the run time (I can't remember the number but it was around half). After I'd done the changes the % dropped by a factor of 5. However gprof lies; the actual run-time of the generator was not changed significantly!

I still don't understand where the perf is going but "-p" profiling seems to have been dropped from the GCC (or maybe I don't know where it is) and I don't have anything on my Gentoo system to do sampled profiling (where the PC is sampled regularly then mapped back to the function based on the debug information). I always found that much better and VS supported it really well (this was 20 years ago). You could try profiling a run under VS but I don't know which version you are using; good support probably requires Pro and the best support needed the Enterprise version :-(

@jbowler jbowler closed this Nov 10, 2023
@mrbean-bremen
Copy link
Contributor

As I wrote, I don't really care much about the performance, as the generator will usually be run only once for a version to generate the code (except in the CI, of course), which is then used. Or if the checked in generated code is used, it need not to be run at all.

Having a version that creates correct code and is stable is much more important from my point of view. As I wrote elsewhere, if we can get it to a stage where 5.15 sources are generated reliably, we can newly check in the newly generated code and call it a release.

What bugs me a bit are the crashes you get on your system with Qt6, but that may not be relevant for the Qt 5.15 generator.

@jbowler
Copy link
Contributor Author

jbowler commented Nov 10, 2023

Github has a weird interface. I think I double clicked something.

@jbowler jbowler reopened this Nov 10, 2023
@jbowler
Copy link
Contributor Author

jbowler commented Nov 10, 2023

What bugs me a bit are the crashes you get on your system with Qt6, but that may not be relevant for the Qt 5.15 generator.

If it crashes, even if it crashes with invalid input, it's a problem.

@jbowler
Copy link
Contributor Author

jbowler commented Nov 10, 2023

I must have mis-tested this before; this change does make the two crashes I was seeing go away. I can't be sure if it fixes them of course; they may be intermittent, but with the current make_generator* branch I get crashes but with this change I didn't see them. Since I can repro the crashes I can probably find out where they are but that may not help if it's heap corruption. Anyway I can apparently repro with commit 94c8ee2 reliably so it's safe to merge this if the CI checks pass now.

EDIT: I had accidentally rebased the PR against master, so I was testing master with my change.

@mrbean-bremen mrbean-bremen merged commit bd4fe2c into MeVisLab:make_generator_work_for_5.15 Nov 10, 2023
11 checks passed
usiems pushed a commit that referenced this pull request Nov 17, 2023
This explicit new/delete, storage leaks (missing delete) and iteration
over a QHash while modifying it (deleting specific keys in an iterator).
mrbean-bremen pushed a commit that referenced this pull request Nov 17, 2023
This explicit new/delete, storage leaks (missing delete) and iteration
over a QHash while modifying it (deleting specific keys in an iterator).
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

Successfully merging this pull request may close these issues.

2 participants