dbus/test test-segfault.c,1.4,1.5

Ralf Habacker ralf.habacker at freenet.de
Thu Mar 8 00:11:21 PST 2007


Havoc Pennington schrieb:
> Hi,
>
> Please, send changes to cross-platform files to the list or
> bugzilla... comments below
>
> Ralf Habacker wrote:
>> --- test-segfault.c    30 Nov 2005 19:32:26 -0000    1.4
>> +++ test-segfault.c    7 Mar 2007 18:34:01 -0000    1.5
>> @@ -1,15 +1,14 @@
>>  /* This is simply a process that segfaults */
>> +#include <config.h>
>
> Good
>
>>  #include <stdlib.h>
>>  #include <signal.h>
>>  
>> -#include <sys/time.h>
>> -#include <sys/resource.h>
>> -
>
> These are required on Linux according to "man setrlimit" so they can't
> be unconditionally removed. 
Sorry, I removed this by accident. I fixed this issue in the immediatly
followed next commit.

BTW: for which is #include <sys/time.h>  used. test-segfault compiles
without this header ?


> Should probably be inside HAVE_SETRLIMIT or something.
I will add such wrapper to automake and cmake build systems

>> +#if !defined(DBUS_WIN) && !defined(DBUS_WINCE)
>
> I don't think we want to check both WIN and WINCE all over the code, I
> would think DBUS_WIN means "either windows or wince" and perhaps
> DBUS_WINCE and DBUS_WIN32/DBUS_WINDESKTOP/something are used in the
> few places that are different between Windows flavors.
Thanks for this pointer. I have redirected this hint to the wince
developers.
>
> In this particular case, #ifdef HAVE_SETRLIMIT would be even better,
> though.
see above
>
>>    struct rlimit r = { 0, };
>>       getrlimit (RLIMIT_CORE, &r);
>> @@ -17,7 +16,7 @@
>>    setrlimit (RLIMIT_CORE, &r);
>>       raise (SIGSEGV);
>> -
>> +#endif
>>    p = NULL;
>>    *p = 'a';
>
> By default, I'm not sure dereferencing null crashes a Windows app ... 
it does.
> in fact this whole test is probably nonsense on Windows, since the
> point of this test is to be sure the activation code properly handles
> a segfaulting service. 
this also makes sense on win32.
> So it may be more appropriate to simply remove test-segfault from the
> Windows build, and put "#ifndef DBUS_WIN" around the test code that
> tries to activate the segfault service. I believe that's in dispatch.c
This is already done in one of the non applied part of the
dbus-win.patch file. So I will fix test/test-segfault.c  and disable the
test for now.  We have already a DBUS_WIN_FIXME symbol for those cases.

Ralf






More information about the dbus mailing list