[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 Milian Wolff changed: What|Removed |Added Resolution|--- |FIXED Status|REOPENED|RESOLVED Latest Commit||https://invent.kde.org/sdk/ ||heaptrack/commit/5cc1577c44 ||b9e57840885f55a18b90dbfe3f8 ||a59 --- Comment #9 from Milian Wolff --- Git commit 5cc1577c44b9e57840885f55a18b90dbfe3f8a59 by Milian Wolff. Committed on 13/08/2021 at 09:59. Pushed by mwolff into branch 'master'. Don't try to runtime attach for /proc/sys/kernel/yama/ptrace_scope > 0 This won't work anyways, so let's error out early with a clear error message. M +4-0src/track/heaptrack.sh.cmake https://invent.kde.org/sdk/heaptrack/commit/5cc1577c44b9e57840885f55a18b90dbfe3f8a59 -- You are receiving this mail because: You are watching all bug changes.
[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 --- Comment #8 from Milian Wolff --- right - this is pretty confusing: ``` $ heaptrack -p $(pidof kontact) heaptrack output will be written to "/home/milian/projects/kdab/qitissue/build-asan/heaptrack.kontact.102573.zst" /home/milian/projects/compiled/other/lib/heaptrack/libheaptrack_preload.so injecting heaptrack into application via GDB, this might take some time... ptrace: Operation not permitted. No symbol table is loaded. Use the "file" command. No symbol table is loaded. Use the "file" command. The program is not being run. injection finished ^Cremoving heaptrack injection via GDB, this might take some time... ptrace: Operation not permitted. No symbol table is loaded. Use the "file" command. The program is not being run. Heaptrack finished! Now run the following to investigate the data: heaptrack --analyze "/home/milian/projects/kdab/qitissue/build-asan/heaptrack.kontact.102573.zst" ``` we should stop directly after the first ptrace error -- You are receiving this mail because: You are watching all bug changes.
[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 --- Comment #7 from Milian Wolff --- we should at least give the user a clear indication of what's going on - i.e. forward this error message if needed (apparently that doesn't happen currently?) -- You are receiving this mail because: You are watching all bug changes.
[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 karl-heinz reichel changed: What|Removed |Added CC||khreic...@gmail.com --- Comment #6 from karl-heinz reichel --- @Milian If this is more or less a configuration issue of the operating system (means setting the ptrace_scope to 0 to enable Heaptrack tracing) this issue could be closed. IMHO hhere is no reasonable reason for Heaptrack to handle this case. -- You are receiving this mail because: You are watching all bug changes.
[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 Milian Wolffchanged: What|Removed |Added Ever confirmed|0 |1 Status|RESOLVED|REOPENED Resolution|WORKSFORME |--- --- Comment #5 from Milian Wolff --- I think we should better handle this scenario though, reopening to track progress on this. -- You are receiving this mail because: You are watching all bug changes.
[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 Anthony Fieronichanged: What|Removed |Added Resolution|WAITINGFORINFO |WORKSFORME Status|NEEDSINFO |RESOLVED --- Comment #4 from Anthony Fieroni --- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope Now it's work. -- You are receiving this mail because: You are watching all bug changes.
[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 --- Comment #3 from Milian Wolff--- No, you shouldn't need to quit plasma, just Ctrl + C to quick heaptrack eventually. Also, try to elevate your ptrace rights and don't use sudo: https://stackoverflow.com/questions/19215177/how-to-solve-ptrace-operation-not-permitted-when-trying-to-attach-gdb-to-a-pro -- You are receiving this mail because: You are watching all bug changes.
[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 --- Comment #2 from Anthony Fieroni--- [toni@toni-pc ~]$ uname -r 4.15.7-1 I start it like this sudo ./heaptrack -p (ptrace wants more privileges) Plasmasheli is long-standing app, more than 11 days running, so created file is 0k, buti'm not quit plasmashell. Should i? -- You are receiving this mail because: You are watching all bug changes.
[Heaptrack] [Bug 394520] Attaching to running process generates empty file
https://bugs.kde.org/show_bug.cgi?id=394520 Milian Wolffchanged: What|Removed |Added Status|UNCONFIRMED |NEEDSINFO Resolution|--- |WAITINGFORINFO --- Comment #1 from Milian Wolff --- I cannot reproduce this: $ heaptrack -p $(pidof kwrite) heaptrack output will be written to "/home/milian/projects/src/heaptrack/heaptrack.kwrite.15432.zst" injecting heaptrack into application via GDB, this might take some time... injection finished # ctrl + o in kwrite # then quit heaptrack stats: allocations:1417920 leaked allocations: 3378 temporary allocations: 295490 removing heaptrack injection via GDB, this might take some time... ptrace: No such process. No symbol table is loaded. Use the "file" command. The program is not being run. Heaptrack finished! Now run the following to investigate the data: heaptrack --analyze "/home/milian/projects/src/heaptrack/heaptrack.kwrite.15432.zst" please provide more information for me on how to reproduce this. what program are you tracing? what workload do you put on it? also, please try to run tests/auto/tst_inject on your system - does it pass? -- You are receiving this mail because: You are watching all bug changes.