Array-Size

staneker at gris.uni-tuebingen.de staneker at gris.uni-tuebingen.de
Tue Apr 4 07:51:49 PDT 2006


On Tue, 4 Apr 2006, Thiago Macieira wrote:

> staneker at gris.uni-tuebingen.de wrote:
> >Hi,
> >
> >:-/ I tried to transfer more than 8MB from the client to the
> >
> >server, but I got immediately a timeout error. strace shows
> >the following output:
>
> I've just tried 16 MB and it is still working. It takes a long time do
> anything, as is expected, but in the end it works.

Ah, I missed that my test-array in this case is an
int-array, so the problem occures at about 32MB... :-/
Sorry.

I just made a test with valgrind. If the array is 30MB, the
transfer works, but valgrind shows 38 errors:

==7950== Syscall param writev(vector[...]) points to uninitialised byte(s)
==7950==    at 0x4203986: do_writev (in /lib/tls/libc-2.3.5.so)
==7950==    by 0x80627A9: _dbus_write_two (dbus-sysdeps.c:338)
....

and

==7950== Syscall param write(buf) points to uninitialised byte(s)
==7950==    at 0x41FC543: __write_nocancel (in /lib/tls/libc-2.3.5.so)
==7950==    by 0x805DB52: do_writing (dbus-transport-unix.c:585)
==7950==    by 0x805E0B6: unix_do_iteration (dbus-transport-unix.c:1054)

The memory leak summary looks like:

==7950== LEAK SUMMARY:
==7950==    definitely lost: 372 bytes in 18 blocks.
==7950==      possibly lost: 0 bytes in 0 blocks.
==7950==    still reachable: 7,913 bytes in 58 blocks.
==7950==         suppressed: 0 bytes in 0 blocks.


But if I use an array of 32MB, I got just one of the above
errors and the following leak summary:

==7961== LEAK SUMMARY:
==7961==    definitely lost: 302 bytes in 16 blocks.
==7961==      possibly lost: 130 bytes in 4 blocks.
==7961==    still reachable: 100,671,104 bytes in 59 blocks.
==7961==         suppressed: 0 bytes in 0 blocks.

Still reachable is about 100MB?!? Does dbus internally copy
the array twice?

Uhm... if I have enough time, I will cleanup my code and put
it on a website. It is a simple, plain C++ wrapper for dbus
with a small code generator.


Regards, Dirk


More information about the dbus mailing list