Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-11

Understanding valgrind logs

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello all,
I'm trying to figure out valgrind's log about a program I wrote in Pascal using FPC.

I have a lot of the following messages:\
==30348== Mismatched free() / delete / delete []
==30348== at 0x4C21A18: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==30348== by 0x6F6F8E3: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F539FE: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x774344B: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F505A9: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F98707: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F79020: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F790BE: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== Address 0xd2892b0 is 0 bytes inside a block of size 32 alloc'd ==30348== at 0x4C2261C: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==30348== by 0x6F4EB72: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x7742831: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F505A9: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F98707: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F79020: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F790BE: ??? (in /usr/lib/libQtWebKit.so.4.5.3) ==30348== by 0x6F7B0ED: ??? (in /usr/lib/libQtWebKit.so.4.5.3)

...
--30348-- memcheck GC: 16384 nodes, 15231 survivors ( 92.9%) --30348-- memcheck GC: increase table size to 32768 --30348-- REDIR: 0x7e62310 (operator new(unsigned long, std::nothrow_t const&)) redirected to 0x4c21cd0 (operator new(unsigned long, std::nothrow_t const&))
--30348-- REDIR: 0x7e60410 (operator delete(void*, std::nothrow_t const&)) redirected to 0x4c21577 (operator delete(void*, std::nothrow_t const&)) --30348-- memcheck GC: 32768 nodes, 30752 survivors ( 93.8%) --30348-- memcheck GC: increase table size to 65536 ....

Not even one report about my own code, buy all about shard libraries. Does anyone know what it means exactly ?

Thanks,
Ido

http://ik.homelinux.org/

Jonas Maebe
to ik

ik wrote on Sun, 08 Nov 2009:

Show quoted text 8 lines
Hello all, I'm trying to figure out valgrind's log about a program I wrote in Pascal using FPC. I have a lot of the following messages:\ ==30348== Mismatched free() / delete / delete [] ==30348== at 0x4C21A18: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)

[snip]

==30348== Address 0xd2892b0 is 0 bytes inside a block of size 32 alloc'd ==30348== at 0x4C2261C: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)

[snip]

Not even one report about my own code, buy all about shard libraries. Does anyone know what it means exactly ?

It says that this library is calling free() on a memory block that was allocated with new(). This is an error, because they should be calling delete() (it's sort of like calling freemem(x) on pointer to an object in Pascal, rather than dispose(x,done)).

There is probably nothing you can do about it in your code, since it's all inside the C++ library.

Jonas

---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.

ik
to Jonas Maebe

Thanks
Ido

http://ik.homelinux.org/

Jonas Maebe wrote 42 lines
ik wrote on Sun, 08 Nov 2009: Hello all, > I'm trying to figure out valgrind's log about a program I wrote in Pascal > using FPC. > > I have a lot of the following messages:\ > ==30348== Mismatched free() / delete / delete [] > ==30348== at 0x4C21A18: free (in > /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) > [snip] ==30348== Address 0xd2892b0 is 0 bytes inside a block of size 32 alloc'd > ==30348== at 0x4C2261C: operator new(unsigned long) (in > /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) > [snip] Not even one report about my own code, buy all about shard libraries. > Does anyone know what it means exactly ? > It says that this library is calling free() on a memory block that was allocated with new(). This is an error, because they should be calling delete() (it's sort of like calling freemem(x) on pointer to an object in Pascal, rather than dispose(x,done)). There is probably nothing you can do about it in your code, since it's all inside the C++ library. Jonas ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal