https://bugs.kde.org/show_bug.cgi?id=463514

--- Comment #5 from Paul Floyd <pjfl...@wanadoo.fr> ---
(In reply to Raju Ponnagani from comment #4)
> Verified with the changes as you mention, leaks get detected under
> definitely lost of Leak Summary. But not shows the exact function name
> (leak_func ) where the leak happened in the application.

I can't comment on the callstack as I don't use ARM or Android.

As I said earlier, the compiler is probably be optimizing away the call to
calloc.

When you do this

ptr = "Hello World\n";

it doesn't copy the string into the memory pointed to by 'ptr'. Instead is puts
the address of the read-only string "Hello World\n" into ptr. It also sees that
the memory allocated by calloc is never used and can optimize it away.

On FreeBSD 13.1 amd64 with clang 13 I also get no leak.

objdump shows no call to calloc

paulf> objdump --disassemble=leak_func ./463514

./463514:     file format elf64-x86-64-freebsd

Disassembly of section .text:

0000000000201920 <leak_func>:
  201920:       55                      push   %rbp
  201921:       48 89 e5                mov    %rsp,%rbp
  201924:       bf 80 05 20 00          mov    $0x200580,%edi
  201929:       be 85 05 20 00          mov    $0x200585,%esi
  20192e:       31 c0                   xor    %eax,%eax
  201930:       e8 eb 00 00 00          call   201a20 <printf@plt>
  201935:       31 c0                   xor    %eax,%eax
  201937:       5d                      pop    %rbp
  201938:       c3                      ret

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to