https://bugs.kde.org/show_bug.cgi?id=353192
--- Comment #8 from Fredrik Tolf <fred...@dolda2000.com> ---
This is my reproducible testcase:

#include <stdlib.h>

asm(".pushsection .foo,\"awx\",@progbits;"
    ".type writeablefunction, @function;"
    "writeablefunction:"
    "ret;"
    ".popsection;");

int main(int argc, char **argv)
{
    malloc(128);
    return(0);
}

I compiled with "gcc -g -Wall -o vgtest vgtest.c", but I reckon it should be
fairly tolerant with compiler flags. Valgrind output is:

$ valgrind --tool=memcheck --leak-check=full ./vgtest
==27841== Memcheck, a memory error detector
==27841== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==27841== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright
info
==27841== Command: ./vgtest
==27841== 
==27841== 
==27841== HEAP SUMMARY:
==27841==     in use at exit: 128 bytes in 1 blocks
==27841==   total heap usage: 1 allocs, 0 frees, 128 bytes allocated
==27841== 
==27841== 128 bytes in 1 blocks are definitely lost in loss record 1 of 1
==27841==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==27841==    by 0x1086C8: ??? (in /tmp/vgtest)
==27841==    by 0x4E582B0: (below main) (libc-start.c:291)
==27841== 
==27841== LEAK SUMMARY:
==27841==    definitely lost: 128 bytes in 1 blocks
==27841==    indirectly lost: 0 bytes in 0 blocks
==27841==      possibly lost: 0 bytes in 0 blocks
==27841==    still reachable: 0 bytes in 0 blocks
==27841==         suppressed: 0 bytes in 0 blocks
==27841== 
==27841== For counts of detected and suppressed errors, rerun with: -v
==27841== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

To point in this case being the missing symbol for "main" in the loss record.

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

Reply via email to