Bug 500051 - stack memory leak when right click page number input
Summary: stack memory leak when right click page number input
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 24.12.2
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-14 10:17 UTC by alanas.00
Modified: 2025-04-09 13:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screenshot (458.67 KB, image/png)
2025-02-14 10:17 UTC, alanas.00
Details
run okular in gdb in konsole, focus konsole window (okular was focused), press ctrl+c, type "bt", press enter (1.35 KB, text/plain)
2025-03-02 08:27 UTC, alanas.00
Details
…, type "c", press enter, focus okular window (konsole was focused), right click page number input twice, focus konsole window (okular was focused), press ctrl+c, type "bt", press enter (5.37 KB, text/plain)
2025-03-02 08:31 UTC, alanas.00
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alanas.00 2025-02-14 10:17:33 UTC
Created attachment 178351 [details]
screenshot

SUMMARY
okular uses more call stack every time I right click page number input (see attachment image)

STEPS TO REPRODUCE
1. open okular
2. spam right click page number input

OBSERVED RESULT
stack usage increases with number of right clicks

EXPECTED RESULT
stack usage doesn't increase with number of right clicks

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Comment 1 Albert Astals Cid 2025-03-01 14:45:48 UTC
And what's the problem exactly?
Comment 2 alanas.00 2025-03-02 08:27:16 UTC
Created attachment 179033 [details]
run okular in gdb in konsole, focus konsole window (okular was focused), press ctrl+c, type "bt", press enter

(In reply to Albert Astals Cid from comment #1)
> And what's the problem exactly?

I compiled qtbase, kxmlgui, okular with -O0 -ggdb3.

I am using kde neon unstable edition with kde x11 session for gdb backtraces.
Comment 3 alanas.00 2025-03-02 08:31:50 UTC
Created attachment 179034 [details]
…, type "c", press enter, focus okular window (konsole was focused), right click page number input twice, focus konsole window (okular was focused), press ctrl+c, type "bt", press enter

see how there is more stuff in backtrace after 2 right clicks

that's the memory leak!
Comment 5 Albert Astals Cid 2025-03-02 10:25:00 UTC
> that's the memory leak!

No, there is no memory leak there.

If you want to prove a memory leak, the tools you have to use are valgrind or heaptrack, not gdb or cat
Comment 6 alanas.00 2025-03-02 11:01:24 UTC
(In reply to Albert Astals Cid from comment #5)
> or heaptrack, not gdb or cat

memory leak is not in heap

memory leak is in stack (functions are called when open context menu on page number input but not return when close context menu)
Comment 7 Albert Astals Cid 2025-03-02 11:25:04 UTC
There can not be a memory leak on the stack unless the stack grows infinitely which is not the case here, I am unconvinced there's a leak.
Comment 8 alanas.00 2025-03-02 12:45:29 UTC
(In reply to Albert Astals Cid from comment #7)
> the stack grows infinitely

that will happen if you right click page number input infinity times

> I am unconvinced there's a leak.

you haven't right clicked page number input enough times (in single session without open file)
Comment 9 Bug Janitor Service 2025-03-17 03:47:08 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 10 alanas.00 2025-03-17 06:08:30 UTC
(In reply to Bug Janitor Service from comment #9)
> Please provide the requested information, then set the bug status to
> REPORTED.
no information asked, setting bug status to REPORTED
Comment 11 alanas.00 2025-04-09 13:02:38 UTC
fixed in qt 6.9.0