patch for command line arguments in activation

Rodrigo Moya rodrigo at gnome-db.org
Tue Jul 5 04:34:49 PDT 2005


On Sat, 2005-07-02 at 17:52 -0400, John (J5) Palmieri wrote:
> On Sat, 2005-07-02 at 22:49 +0200, Rodrigo Moya wrote:
> > On Sat, 2005-07-02 at 15:05 -0400, John (J5) Palmieri wrote:
> > 
> > > > weird, this indeed happens, on the same command line, after 70 or so
> > > > runs:
> > > > 
> > > > Running /opt/extra/src/dbus/test/test-segfault ...
> > > > Running /opt/extra/src/dbus/test/test-segfault ...
> > > > Running /opt/extra/src/dbus/test/test-segfault ...
> > > > ...
> > > > Running /opt/extra/src/dbus/test/test-segfault ...
> > > > Running /opt/extra/src/dbus/test/test-segfault ...
> > > > Running /opt/extra/src/dbus/test/test-segfaul ...
> > > > 
> > > > > You have an off by one error or memory corruption in your parsing code.
> > > > > 
> > > > seems from my debugging, that the program might be running out of
> > > > memory? Running through valgrind shows some of these:
> > > 
> > > The tests run through a series of out of memory check where it sets dbus
> > > malloc functions to return OOM to see if dbus can recover from these
> > > situations.  You are going to get OOM in your test, your code just need
> > > to handle and propagate the error correctly.  This means that anytime
> > > you do an operation that may run out of memory (appending to string or
> > > list) you need to check the return value and handle the OOM which
> > > usually means just returning OOM from your function.
> > > 
> > hmm, why doesn't dbus' memory functions deal with it, like glib does?
> 
> The point is to make sure all the code is propagating OOM errors.  The
> memory functions can't handle OOM because it has no context to do so.
> D-Bus will actually not die on OOM but wait until there is resources
> available (well it could die but it tries its hardest not to).
> It is fairly easy to support.  Just make sure any function that can fail
> because of OOM check for and then somehow propagates the error (either
> by returning FALSE or setting a DBusError).
> 
ok, did some changes, and previous error seems to have disappear. But
still some problems :( (in the test program, in gnome-session things
work smoothly still):

30331: assertion failed "(real)->len <= ((real)->allocated -
_DBUS_STRING_ALLOCATION_PADDING)" file "dbus-string.c" line 1276
function _dbus_string_append_byte
Aborted

Looking at the code, I can't find the reason why that would happen. The
caller for that is in _dbus_shell.c:277. Any idea?
-- 
Rodrigo Moya <rodrigo at gnome-db.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-new-files.patch
Type: text/x-patch
Size: 24404 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050705/ec8076c1/dbus-new-files-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus.patch
Type: text/x-patch
Size: 4360 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050705/ec8076c1/dbus-0001.bin


More information about the dbus mailing list