W32 testsuite results - should i be worried?

Yang Chengwei chengwei.yang at intel.com
Wed Mar 5 17:33:59 PST 2014


Hi,

From the test.log, I see the test doesn't skip "test only for *nix", so
I guess you build your windows binaries with mingw. This isn't the
supported way, please use CMake.

If any failure still there, please file a bug at
https://bugs.freedesktop.org/enter_bug.cgi?product=dbus
for "core" component.

Bugs/enhancement all are tracked by bugzilla, prefer to mailing list.

Thank you for your time!

--
Thanks,
Chengwei

On Thu, Mar 06, 2014 at 12:43:43AM +0400, LRN wrote:
> Here are testsuite results for dbus-1.8.0 on W32:
> 
> FAIL: ../bus/test-bus.exe
> PASS: ../bus/test-bus-system.exe
> FAIL: ../dbus/test-dbus.exe
> PASS: test-shell.exe
> PASS: test-printf.exe
> PASS: test-corrupt.exe
> FAIL: test-dbus-daemon.exe
> FAIL: test-dbus-daemon-eavesdrop.exe
> PASS: test-loopback.exe
> PASS: test-marshal.exe
> PASS: test-refs.exe
> PASS: test-relay.exe
> PASS: test-syntax.exe
> PASS: test-syslog.exe
> 
> test-dbus-daemon.exe hanged up (did nothing until i killed it), same
> with test-dbus-daemon-eavesdrop.exe
> 
> Upon closer inspection i saw some problems with running the tests
> uninstalled, so i've installed dbus and copied failing tests into
> /mingw/bin.
> 
> After that test-dbus-daemon.exe and test-dbus-daemon-eavesdrop.exe passed.
> 
> run-test.sh and run-test-systemserver.sh fail, but they also rely on
> binaries that are UNIX-only, so i didn't probe any further in that
> direction.
> 
> Logs for ../bus/test-bus.exe and ../dbus/test-dbus.exe are attached.
> 
> Patches used to build dbus are attached (of particular interest is
> syslog patch that fixes some gross printf misuse).
> 
> Should i be worried about these failures in test-bus and test-dbus?
> What is this "spawn_exit" that it tries to run?
> 
> 
> -- 
> O< ascii ribbon - stop html email! - www.asciiribbon.org

> $ gdb --args test-dbus.exe f:/e21/src/mingw/dbus-1-1.8.0-1/bld/test/data
> GNU gdb (GDB) 7.6.2
> Copyright (C) 2013 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i686-w64-mingw32".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from F:\e21\mingw\bin\test-dbus.exe...done.
> (gdb) r
> Starting program: F:\e21\mingw\bin/test-dbus.exe f:/e21/src/mingw/dbus-1-1.8.0-1/bld/test/data
> [New Thread 6852.0x2aac]
> Test data in f:/e21/src/mingw/dbus-1-1.8.0-1/bld/test/data
> test-dbus: running string tests
> test-dbus: checking for memleaks
> test-dbus: running sysdeps tests
> test-dbus: checking for memleaks
> test-dbus: running data-slot tests
> test-dbus: checking for memleaks
> test-dbus: running misc tests
> test-dbus: checking for memleaks
> test-dbus: running address tests
> test-dbus: checking for memleaks
> test-dbus: running server tests
> [New Thread 6852.0x1dac]
> test-dbus: checking for memleaks
> test-dbus: running object-tree tests
> test-dbus: checking for memleaks
> test-dbus: running signature tests
> test-dbus: checking for memleaks
> test-dbus: running marshalling tests
> test-dbus: checking for memleaks
> test-dbus: running marshal-recursive tests
> >>> >>> Each value by itself 120 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 120 this test (120 cumulative)
> >>> >>> Each value by itself with arrays as blocks 120 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 120 this test (240 cumulative)
> >>> >>> All values in one big toplevel 1 iteration
>  100% 1 this test (241 cumulative)
> >>> >>> Each value,value pair combination as toplevel, in both orders 14400 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 14400 this test (14641 cumulative)
> >>> >>> Each container containing each value 840 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 840 this test (15481 cumulative)
> >>> >>> Each container containing each value with arrays as blocks 840 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 840 this test (16321 cumulative)
> >>> >>> Each container of same container of each value 840 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 840 this test (17161 cumulative)
> >>> >>> Each container of same container of same container of each value 840 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 840 this test (18001 cumulative)
> >>> >>> Each value,value pair inside a struct 14400 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 14400 this test (32401 cumulative)
> >>> >>> All values in one big struct 1 iteration
>  100% 1 this test (32402 cumulative)
> >>> >>> Each value in a large array 120 iterations
>  0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 120 this test (32522 cumulative)
> skipping remaining marshal-recursive tests, run with DBUS_TEST_SLOW=1 (or more) to enable
> 32522 total iterations of recursive marshaling tests
> each iteration ran at initial offsets 0 through 9 in both big and little endian
> out of memory handling was not tested
> test-dbus: checking for memleaks
> test-dbus: running byteswap tests
>   120 blocks swapped from order 'l' to 'B'
>   120 blocks swapped from order 'B' to 'l'
> test-dbus: checking for memleaks
> test-dbus: running memory tests
> test-dbus: checking for memleaks
> test-dbus: running mem-pool tests
> [New Thread 6852.0x29cc]
> [New Thread 6852.0x25e4]
> [New Thread 6852.0x1ed0]
> test-dbus: checking for memleaks
> test-dbus: running list tests
> test-dbus: checking for memleaks
> test-dbus: running marshal-validate tests
> test-dbus: checking for memleaks
> test-dbus: running message tests
>  testing message loading: trivial example of each message type 4 test loads cumulative
>  testing message loading: assorted arguments 124 test loads cumulative
>  testing message loading: assorted special cases 146 test loads cumulative
>  testing message loading: each uint32 modified 35368 test loads cumulative
>  testing message loading: wrong body lengths 38368 test loads cumulative
>  testing message loading: each byte modified 51547 test loads cumulative
> 51547 sample messages tested
> validity   0 seen 381 times
> validity   1 seen 3471 times
> validity   2 seen 177 times
> validity   4 seen 3 times
> validity   5 seen 3 times
> validity   6 seen 3 times
> validity   7 seen 273 times
> validity   8 seen 3 times
> validity   9 seen 15780 times
> validity  10 seen 189 times
> validity  11 seen 2727 times
> validity  12 seen 5718 times
> validity  13 seen 3960 times
> validity  14 seen 360 times
> validity  15 seen 3 times
> validity  16 seen 1080 times
> validity  17 seen 1440 times
> validity  18 seen 1107 times
> validity  19 seen 3 times
> validity  20 seen 1080 times
> validity  21 seen 7200 times
> validity  22 seen 3 times
> validity  23 seen 3 times
> validity  24 seen 720 times
> validity  25 seen 360 times
> validity  26 seen 1440 times
> validity  27 seen 720 times
> validity  28 seen 360 times
> validity  29 seen 3 times
> validity  30 seen 720 times
> validity  31 seen 3 times
> validity  32 seen 360 times
> validity  33 seen 3 times
> validity  34 seen 3 times
> validity  35 seen 14625 times
> validity  37 seen 6666 times
> validity  38 seen 2013 times
> validity  39 seen 15447 times
> validity  40 seen 1788 times
> validity  41 seen 8325 times
> validity  42 seen 3408 times
> validity  43 seen 4875 times
> validity  45 seen 3327 times
> validity  46 seen 7485 times
> validity  47 seen 1125 times
> validity  48 seen 3 times
> validity  49 seen 3 times
> validity  50 seen 144 times
> validity  51 seen 3 times
> validity  54 seen 12 times
> validity  57 seen 3 times
> validity  -4 seen 0 times
> validity  -2 seen 0 times
> validity   3 seen 0 times
> validity  36 seen 0 times
> validity  44 seen 0 times
> validity  52 seen 0 times
> validity  53 seen 0 times
> validity  55 seen 0 times
> validity  56 seen 0 times
> Testing valid-messages:
> SKIP: Could not load array-of-array-of-uint32.message, message builder language no longer supported
> SKIP: Could not load dict-simple.message, message builder language no longer supported
> SKIP: Could not load dict.message, message builder language no longer supported
> SKIP: Could not load emptiness.message, message builder language no longer supported
> SKIP: Could not load lots-of-arguments.message, message builder language no longer supported
> SKIP: Could not load no-padding.message, message builder language no longer supported
> SKIP: Could not load opposite-endian.message, message builder language no longer supported
> SKIP: Could not load recursive-types.message, message builder language no longer supported
> SKIP: Could not load simplest-manual.message, message builder language no longer supported
> SKIP: Could not load simplest.message, message builder language no longer supported
> SKIP: Could not load standard-acquire-service.message, message builder language no longer supported
> SKIP: Could not load standard-hello.message, message builder language no longer supported
> SKIP: Could not load standard-list-services.message, message builder language no longer supported
> SKIP: Could not load standard-service-exists.message, message builder language no longer supported
> SKIP: Could not load unknown-header-field.message, message builder language no longer supported
> Testing invalid-messages:
> SKIP: Could not load array-of-nil.message, message builder language no longer supported
> SKIP: Could not load array-with-mixed-types.message, message builder language no longer supported
> SKIP: Could not load bad-boolean-array.message, message builder language no longer supported
> SKIP: Could not load bad-boolean.message, message builder language no longer supported
> SKIP: Could not load bad-endian.message, message builder language no longer supported
> SKIP: Could not load bad-header-field-alignment.message, message builder language no longer supported
>     boolean-has-no-value.message-raw
> SKIP: Could not load local-namespace.message, message builder language no longer supported
> SKIP: Could not load no-dot-in-name.message, message builder language no longer supported
> SKIP: Could not load not-nul-header-padding.message, message builder language no longer supported
> SKIP: Could not load overlong-name.message, message builder language no longer supported
> SKIP: Could not load too-little-header-padding.message, message builder language no longer supported
> SKIP: Could not load too-much-header-padding-by-far.message, message builder language no longer supported
> SKIP: Could not load too-much-header-padding.message, message builder language no longer supported
> SKIP: Could not load too-short-dict.message, message builder language no longer supported
> Testing incomplete-messages:
> SKIP: Could not load missing-body.message, message builder language no longer supported
> test-dbus: checking for memleaks
> test-dbus: running hash tests
> Computing test hash keys...
> ... done.
> test-dbus: checking for memleaks
> test-dbus: running spawn tests
> [New Thread 6852.0xf08]
> [New Thread 6852.0x1ab0]
> [New Thread 6852.0x136c]
> [New Thread 6852.0x1a54]
> [New Thread 6852.0x4760]
> [New Thread 6852.0x30e4]
> [New Thread 6852.0x2380]
> [New Thread 6852.0x33c0]
> [New Thread 6852.0x3f50]
> [New Thread 6852.0x3b54]
> [New Thread 6852.0x3e0c]
> [New Thread 6852.0xf84]
> [New Thread 6852.0x2b18]
> [New Thread 6852.0x210c]
> [New Thread 6852.0x2190]
> [New Thread 6852.0x32c8]
> [New Thread 6852.0x181c]
> [New Thread 6852.0x139c]
> [New Thread 6852.0xe68]
> [New Thread 6852.0x10d0]
> [New Thread 6852.0x510]
> [New Thread 6852.0x27b0]
> [New Thread 6852.0x23f4]
> [New Thread 6852.0x1034]
> [New Thread 6852.0x2678]
> [New Thread 6852.0x20e4]
> [New Thread 6852.0x1764]
> [New Thread 6852.0x2b6c]
> [New Thread 6852.0x2a38]
> [New Thread 6852.0x424c]
> [New Thread 6852.0x664]
> [New Thread 6852.0x460c]
> [New Thread 6852.0x2510]
> [New Thread 6852.0x234c]
> [New Thread 6852.0xf5c]
> [New Thread 6852.0x4788]
> [New Thread 6852.0x1388]
> [New Thread 6852.0x43f0]
> [New Thread 6852.0xff4]
> [New Thread 6852.0x26c0]
> [New Thread 6852.0x2034]
> [New Thread 6852.0x104c]
> [New Thread 6852.0x3668]
> [New Thread 6852.0x405c]
> [New Thread 6852.0x4154]
> [New Thread 6852.0x1244]
> [New Thread 6852.0x33d0]
> [New Thread 6852.0x144c]
> [New Thread 6852.0x36cc]
> [New Thread 6852.0x186c]
> Not expecting error when launching exiting executable: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program spawn_exit: The system cannot find the file specified.
> Unit test failed: spawn
> [Inferior 1 (process 6852) exited with code 01]

> Starting program: F:\e21\mingw\bin/test-bus.exe f:/e21/src/mingw/dbus-1-1.8.0-1/bld/test/data
> [New Thread 7232.0x437c]
> F:\e21\mingw\bin/test-bus.exe: Running expire list test
> F:\e21\mingw\bin/test-bus.exe: checking for memleaks
> F:\e21\mingw\bin/test-bus.exe: Running config file parser test
> Testing retrieving the default session service directories
>     default service dir: F:/e21/mingw/share/dbus-1/services
>     default service dir: C:\Program Files (x86)\Common Files/dbus-1/services
>     test service dir: F:/e21/mingw/share/dbus-1/services
>     test service dir: C:\Program Files (x86)\Common Files/dbus-1/services
> default system service dir skipped
> Testing valid files:
>     basic.conf
>     debug-allow-all-sha1.conf
>     debug-allow-all.conf
>     entities.conf
>     incoming-limit.conf
>     many-rules.conf
> Unknown username "root" on element <deny>
> Unknown group "bin" on element <deny>
> Unknown username "root" on element <deny>
> Unknown group "bin" on element <deny>
>     session.conf
>     system.conf
> Unknown username "root" in message bus configuration file
> Testing invalid files:
>     badselinux-1.conf
>     badselinux-2.conf
>     circular-1.conf
>     circular-2.conf
>     circular-3.conf
>     not-well-formed.conf
>     truncated-file.conf
> Comparing equivalent files:
>     basic-1.conf
>     basic-2.conf
> Comparing equivalent files:
>     entities-1.conf
>     entities-2.conf
> F:\e21\mingw\bin/test-bus.exe: checking for memleaks
> F:\e21\mingw\bin/test-bus.exe: Running signals test
> F:\e21\mingw\bin/test-bus.exe: checking for memleaks
> F:\e21\mingw\bin/test-bus.exe: Running SHA1 connection test
> [New Thread 7232.0x3504]
> Using your real home directory for testing, set DBUS_TEST_HOMEDIR to avoid
> [New Thread 7232.0x960]
> [New Thread 7232.0x26a4]
> [New Thread 7232.0x3e74]
> F:\e21\mingw\bin/test-bus.exe: checking for memleaks
> F:\e21\mingw\bin/test-bus.exe: Running message dispatch test
> check_get_connection_unix_user:1164 received message interface "(unset)" member "(unset)" error name "org.freedesktop.DBus.Error.Failed" on 024a7498, expecting not this error
> File "../../dbus-1.8.0/bus/dispatch.c" line 4557 process 7232 should not have been reached: GetConnectionUnixUser message failed
> [New Thread 7232.0x3f80]
> Backtrace:
> 3       ZwWaitForSingleObject+0x15
> 3       WaitForSingleObjectEx+0x43
> 3       WaitForSingleObject+0x12
> 3       dbus_print_backtrace+0x9e
> 3       dbus_abort+0x8
> 3       dbus_list_clear+0x32
> 3       bus_dispatch_test+0x5ae
> 1       62642f2e
> 1       312d7375
> 1       302e382e
> 1       7375622f
> 1       7369642f
> 1       63746170
> 3       bus_no_memory_message+0x187f08
> 1       253a7325
> 1       2e340301
> 1       8204db03
> 1       ac7ba903
> 1       a1133002
> 1       02824903
> 1       77031628
> 1       03012402
> 1       032e00c0
> 1       28025851
> 1       022b0316
> 1       40030130
> 1       00c0033c
> 1       2e5e032e
> 1       03162402
> 1       012c021e
> 1       033c4003
> 1       032e00c0
> 1       1003906c
> 1       9e74039e
> 1       039e0c03
> 1       200804a8
> 1       033c0e03
> 1       3f4be477
> 1       f713f773
> 1       24947513
> 1       024e3c2a
> 1       843a1428
> 1       3d497585
> 1       c8799903
> 1       080b0374
> 1       3c750374
> 1       03f20b03
> 1       03ba080c
> 1       f774080d
> 3       bus_no_memory_message+0xad7d7
> 1       06030402
> 1       ad0306c8
> 1       01240201
> 1       9e7ebb03
> 1       03162402
> 1       240201c1
> 1       7edd0301
> 1       3402599e
> 1       4d39e717
> 1       00162502
> 1       bb010402
> 1       01040200
> 1       398588f1
> 1       02005531
> 1       c8060304
> 1       03040200
> 1       5beb0806
> 1       39853e08
> 1       02005531
> 1       c8060304
> 1       03040200
> 1       03eb0806
> 1       24025844
> 1       01b50316
> 1       00013002
> 1       03010402
> 1       039e7ed3
> 1       abbbe433
> 1       bc9e0c03
> 1       eb034c2c
> 1       98036605
> 1       0383ac7a
> 1       033c05e7
> 1       033c7a99
> 1       034a05e7
> 1       03587aaa
> 1       032e05d6
> 1       692e7aaa
> 1       73ae87c0
> 1       01040200
> 1       ae901403
> 1       14033b08
> 1       193402f2
> 1       2c08bc48
> 1       05970368
> 1       7af503c8
> 1       13310282
> 1       7b08ada1
> 1       03747903
> 1       7f587f93
> 1       01040200
> 1       02009006
> 1       009e0304
> 1       06030402
> 1       0200b208
> 1       6d030104
> 1       04020058
> 1       f2740301
> 1       02c83103
> 1       4d2b1524
> 1       6605db03
> 1       ac7aaa03
> 1       2e05d603
> 1       2e7aaa03
> 1       0223036b
> 1       2c020128
> 1       04020017
> 1       08620301
> 1       0402002e
> 1       73bcf101
> 1       ad900903
> 1       bc302f2d
> 1       71038583
> 1       7da4039e
> 1       6a38a258
> 1       02d3033b
> 1       e4390390
> 1       08059103
> 1       7aaa0358
> 1       05d60382
> 1       7aaa032e
> 1       05f0032e
> 1       5cca3fe4
> 1       235e4038
> 1       7f4d662b
> 1       1427024d
> 1       2fff08ad
> 1       040200f4
> 1       06820601
> 1       03f5d850
> 1       7a038209
> 1       83715e3c
> 1       2f3bae08
> 1       01000502
> 1       000c6401
> 1       a8000200
> 1       01000001
> 1       0d0efb01
> 1       01010100
> 
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> [Inferior 1 (process 7232) exited with code 03]
> 
> 
> $ gdb --args test-bus.exe f:/e21/src/mingw/dbus-1-1.8.0-1/bld/test/data activation-service-reload
> GNU gdb (GDB) 7.6.2
> Copyright (C) 2013 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i686-w64-mingw32".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from F:\e21\mingw\bin\test-bus.exe...done.
> (gdb) r
> Starting program: F:\e21\mingw\bin/test-bus.exe f:/e21/src/mingw/dbus-1-1.8.0-1/bld/test/data activation-service-reload
> [New Thread 6804.0x1f9c]
> F:\e21\mingw\bin/test-bus.exe: Running service files reloading test
> F:\e21\mingw\bin/test-bus.exe: checking for memleaks
> 1 dbus_malloc blocks were not freed
> Unit test failed: memleaks
> [Inferior 1 (process 6804) exited with code 01]

> --- dbus-1.8.0/bus/config-parser.c.orig	2014-01-14 11:04:14.000000000 +0000
> +++ dbus-1.8.0/bus/config-parser.c	2014-03-05 18:17:18.992133100 +0000
> @@ -3361,13 +3361,6 @@
>  #ifdef DBUS_WIN
>    const char *common_progs;
>    char buffer[1024];
> -
> -  if (_dbus_get_install_root(buffer, sizeof(buffer)))
> -    {
> -      strcat(buffer,DBUS_DATADIR);
> -      strcat(buffer,"/dbus-1/services");
> -      test_session_service_dir_matches[0] = buffer;
> -    }
>  #endif
>  
>    /* On Unix we don't actually use this variable, but it's easier to handle the
> @@ -3400,6 +3393,15 @@
>    if (!_dbus_get_standard_session_servicedirs (&dirs))
>      _dbus_assert_not_reached ("couldn't get stardard dirs");
>  
> +#ifdef DBUS_WIN
> +  if (_dbus_get_install_root(buffer, sizeof(buffer)))
> +    {
> +      strcat(buffer,DBUS_DATADIR);
> +      strcat(buffer,"/dbus-1/services");
> +      test_session_service_dir_matches[0] = dirs->data;
> +    }
> +#endif
> +
>    /* make sure our defaults end with share/dbus-1/service */
>    while ((link = _dbus_list_pop_first_link (&dirs)))
>      {

> --- dbus-1.8.0/dbus/dbus-sysdeps-util-win.c.orig	2013-10-08 17:40:40.000000000 +0000
> +++ dbus-1.8.0/dbus/dbus-sysdeps-util-win.c	2014-03-05 19:28:21.312379000 +0000
> @@ -302,6 +302,7 @@
>  {
>    char *s = "";
>    char buf[1024];
> +  int printed;
>    
>    switch(severity) 
>     {
> @@ -309,9 +310,9 @@
>       case DBUS_SYSTEM_LOG_SECURITY: s = "security"; break;
>       case DBUS_SYSTEM_LOG_FATAL: s = "fatal"; break;
>     }
> -   
> -  sprintf(buf,"%s%s",s,msg);
> -  vsprintf(buf,buf,args);
> +  printed = snprintf(buf, 1024, "%s ", s);
> +  if (printed >= 0)
> +    vsnprintf(&buf[printed], 1024 - printed, msg, args);
>    OutputDebugStringA(buf);
>    
>    if (severity == DBUS_SYSTEM_LOG_FATAL)

> --- dbus-1.8.0/dbus/dbus-sysdeps.h.orig	2013-10-08 17:40:40.000000000 +0000
> +++ dbus-1.8.0/dbus/dbus-sysdeps.h	2014-02-26 23:50:40.219653400 +0000
> @@ -226,11 +226,7 @@
>   */
>  struct DBusAtomic
>  {
> -#ifdef DBUS_WIN
> -  volatile long value; /**< Value of the atomic integer. */
> -#else
>    volatile dbus_int32_t value; /**< Value of the atomic integer. */
> -#endif
>  };
>  
>  /* The value we get from autofoo is in the form of a cpp expression;
> --- dbus-1.8.0/dbus/dbus-sysdeps-win.c.orig	2014-01-07 11:32:53.000000000 +0000
> +++ dbus-1.8.0/dbus/dbus-sysdeps-win.c	2014-02-27 00:02:18.490322500 +0000
> @@ -3191,9 +3191,7 @@
>  dbus_int32_t
>  _dbus_atomic_inc (DBusAtomic *atomic)
>  {
> -  // +/- 1 is needed here!
> -  // no volatile argument with mingw
> -  return InterlockedIncrement (&atomic->value) - 1;
> +  return __sync_add_and_fetch(&atomic->value, 1)-1;
>  }
>  
>  /**
> @@ -3206,9 +3204,7 @@
>  dbus_int32_t
>  _dbus_atomic_dec (DBusAtomic *atomic)
>  {
> -  // +/- 1 is needed here!
> -  // no volatile argument with mingw
> -  return InterlockedDecrement (&atomic->value) + 1;
> +  return __sync_sub_and_fetch(&atomic->value, 1)+1;
>  }
>  
>  /**
> @@ -3221,18 +3217,7 @@
>  dbus_int32_t
>  _dbus_atomic_get (DBusAtomic *atomic)
>  {
> -  /* In this situation, GLib issues a MemoryBarrier() and then returns
> -   * atomic->value. However, mingw from mingw.org (not to be confused with
> -   * mingw-w64 from mingw-w64.sf.net) does not have MemoryBarrier in its
> -   * headers, so we have to get a memory barrier some other way.
> -   *
> -   * InterlockedIncrement is older, and is documented on MSDN to be a full
> -   * memory barrier, so let's use that.
> -   */
> -  long dummy = 0;
> -
> -  InterlockedExchange (&dummy, 1);
> -
> +  __sync_synchronize ();
>    return atomic->value;
>  }
>  

> --- dbus-1.8.0/bus/main.c.orig	2013-11-01 12:05:37.000000000 +0000
> +++ dbus-1.8.0/bus/main.c	2014-02-27 00:25:06.683060900 +0000
> @@ -373,6 +373,10 @@
>    dbus_bool_t print_pid;
>    BusContextFlags flags;
>  
> +  _setmode (_fileno (stdin), _O_BINARY);
> +  _setmode (_fileno (stdout), _O_BINARY);
> +  _setmode (_fileno (stderr), _O_BINARY);
> +
>    if (!_dbus_string_init (&config_file))
>      return 1;
>  
> --- dbus-1.8.0/bus/main.c.orig	2014-02-27 00:29:06.249482000 +0000
> +++ dbus-1.8.0/bus/main.c	2014-02-27 00:31:08.244473400 +0000
> @@ -29,6 +29,7 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
> +#include <fcntl.h>
>  #ifdef HAVE_SIGNAL_H
>  #include <signal.h>
>  #endif

> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20140306/45402611/attachment.pgp>


More information about the dbus mailing list