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

X11 PRIME detection logic leaks memory according to Valgrind #29844

Closed
qarmin opened this issue Jun 17, 2019 · 8 comments
Closed

X11 PRIME detection logic leaks memory according to Valgrind #29844

qarmin opened this issue Jun 17, 2019 · 8 comments

Comments

@qarmin
Copy link
Contributor

qarmin commented Jun 17, 2019

Godot version:
3.2.dev.custom_build. 0d61fc2

OS/device including version:
Ubuntu 19.04, Gnome 3.32.1, GTX 970 Proprietary drivers 430.26

Issue description:
When I check Godot(now open only project manager, but same is with editor and game) with simple Valgrind 3.14 command then in log is shown a lot of leaked memory - valgrindDefinite.txt

valgrind --log-file="~/valgrind.txt" --leak-check=full --show-leak-kinds=definite godot

Also changing definite option to all increase number of possibly leaks - valgrindALL.txt

I'm not sure if that are Godot or hardware/Valgrind issue, so I tried to check Godot on my laptop with Intel HD 3000 and Mesa 19 but warnings are same as in issue #16214

@ibrahn
Copy link
Contributor

ibrahn commented Jun 17, 2019

The majority of the leaks logged are from a sub-process. (I think in this case, the one forked for PRIME gpu detection.)
This happens because we exit in the worker process and so the cleanup of allocations made before the fork doesn't happen on that side. Probably sensible, because it helps avoid triggering a copy-on-write of pages that are otherwise shared with the parent process.
To ignore child processes, you can add --child-silent-after-fork=yes when running valgrind. Although this isn't much use if you're looking for a way of getting useful information on the child itself obviously.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 25, 2020

@qarmin Is this still valid in current master?

@qarmin
Copy link
Contributor Author

qarmin commented Jul 26, 2020

For now no.
Godot 4.0 from which I know, doesn't have now PRIME detection, but adding that feature probably still will have leaks.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 26, 2020

For now no.

So no point in keeping this open for now.

@KoBeWi KoBeWi closed this as completed Jul 26, 2020
@KoBeWi KoBeWi added this to the 4.0 milestone Jul 26, 2020
@akien-mga
Copy link
Member

Well I'd keep this open for 3.2, as it's valid there. And whatever fix is done for 3.2 should be applicable for master too, unless we drop platform/linuxbsd/detect_prime_x11.cpp.

@akien-mga akien-mga reopened this Jul 26, 2020
@akien-mga akien-mga modified the milestones: 4.0, 3.2 Jul 26, 2020
@akien-mga akien-mga changed the title A lot of messages about leaking memory from Valgrind X11 PRIME detection logic leaks memory according to Valgrind Jul 26, 2020
@akien-mga akien-mga modified the milestones: 3.2, 3.3 Mar 17, 2021
@akien-mga akien-mga modified the milestones: 3.3, 3.5 Oct 26, 2021
@Rubonnek Rubonnek self-assigned this Dec 21, 2021
@akien-mga
Copy link
Member

Fixed by #56036.

@madmiraal
Copy link
Contributor

This should be reopened, because #56036 was reverted.

@akien-mga akien-mga reopened this Mar 15, 2022
@Rubonnek
Copy link
Member

Rubonnek commented Feb 12, 2023

Fixed in 3.x in #69400 with commit 5ada214.
Also fixed in master in #68345.

@akien-mga akien-mga removed this from the 3.5 milestone Feb 12, 2023
@akien-mga akien-mga added this to the 3.6 milestone Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants