Bug 68855 - dbus-daemon crashes under wine 1.4: segfault in RtlReAllocateHeap()
Summary: dbus-daemon crashes under wine 1.4: segfault in RtlReAllocateHeap()
Status: RESOLVED NOTOURBUG
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other Windows (All)
: low minor
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 68506
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-02 17:00 UTC by Simon McVittie
Modified: 2013-10-10 07:55 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Use TEST_LISTEN in incoming-listen.conf.in (2.29 KB, patch)
2013-10-09 22:49 UTC, Ralf Habacker
Details | Splinter Review

Description Simon McVittie 2013-09-02 17:00:40 UTC
Here's the best I can get from winedbg (I am really not a Windows or Wine expert). Any ideas? This is with my patches from Bug #68852 and Bug #68610.

Next step: see whether this executable works in Windows...

% winedbg --gdb /opt/i686-w64-mingw32/bin/dbus-daemon.exe --nofork --print-address=1 --config-file=$HOME/build/dbus/mingw/test/data/valid-config-files/session.conf
0029:002a: create process 'Z:\opt\i686-w64-mingw32\bin\dbus-daemon.exe'/0x1108b8 @0x4014c0 (2035200<7748>)
0029:002a: create thread I @0x4014c0
GNU gdb (GDB) 7.6 (Debian 7.6-5)
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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
0029:002a: loads DLL C:\windows\system32\KERNEL32.dll @0x7b810000 (0<0>)
0029:002a: loads DLL C:\windows\system32\ntdll.dll @0x7bc10000 (0<0>)
0029:002a: loads DLL C:\windows\system32\msvcrt.dll @0x7ed50000 (0<0>)
0029:002a: loads DLL C:\windows\system32\advapi32.dll @0x7eac0000 (0<0>)
0029:002a: loads DLL C:\windows\system32\gdi32.dll @0x7eb30000 (0<0>)
0029:002a: loads DLL C:\windows\system32\version.dll @0x7eff0000 (0<0>)
0029:002a: loads DLL C:\windows\system32\user32.dll @0x7ec00000 (0<0>)
0029:002a: loads DLL Z:\opt\i686-w64-mingw32\bin\libexpat-1.dll @0x68f40000 (427520<1582>)
0029:002a: loads DLL C:\windows\system32\iphlpapi.dll @0x7ea90000 (0<0>)
0029:002a: loads DLL C:\windows\system32\ws2_32.dll @0x7ea20000 (0<0>)
0029:002a: loads DLL C:\windows\system32\imm32.dll @0x7e730000 (0<0>)
0029:002a: loads DLL C:\windows\system32\winex11.drv @0x7e8d0000 (0<0>)
00000029:0000002a: exception code=0x80000003
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
0x7b85c703 in ExitProcess () from /usr/lib/i386-linux-gnu/wine/kernel32.dll.so
trace: 98 => 80
Wine-gdb> continue
Continuing.
fixme:iphlpapi:GetExtendedTcpTable ulAf = 2, TableClass = 5 not supportted
fixme:iphlpapi:GetExtendedTcpTable ulAf = 2, TableClass = 5 not supportted

Program received signal SIGSEGV, Segmentation fault.
0x7bc4b2c5 in RtlReAllocateHeap ()
   from /usr/lib/i386-linux-gnu/wine/ntdll.dll.so
Wine-gdb> bt
#0  0x7bc4b2c5 in RtlReAllocateHeap ()
   from /usr/lib/i386-linux-gnu/wine/ntdll.dll.so
#1  0x7ed7a912 in MSVCRT_realloc ()
   from /usr/lib/i386-linux-gnu/wine/msvcrt.dll.so
#2  0x0044f18c in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Comment 1 Simon McVittie 2013-09-02 17:01:45 UTC
If I patch get_pid_from_tcp_ex_table() so it's just "return 0" and recompile, I get this instead:

Program received signal SIGSEGV, Segmentation fault.
0x7ead1ba1 in CryptAcquireContextW ()
   from /usr/lib/i386-linux-gnu/wine/advapi32.dll.so
Wine-gdb> bt
#0  0x7ead1ba1 in CryptAcquireContextW ()
   from /usr/lib/i386-linux-gnu/wine/advapi32.dll.so
#1  0x7ead1f4d in CryptAcquireContextA ()
   from /usr/lib/i386-linux-gnu/wine/advapi32.dll.so
#2  0x0042ffdf in ?? ()
Comment 2 Ralf Habacker 2013-09-02 22:43:38 UTC
(In reply to comment #0)
> Here's the best I can get from winedbg (I am really not a Windows or Wine
> expert). Any ideas? This is with my patches from Bug #68852 and Bug #68610.
> 
> Next step: see whether this executable works in Windows...
...
> fixme:iphlpapi:GetExtendedTcpTable ulAf = 2, TableClass = 5 not supportted
> fixme:iphlpapi:GetExtendedTcpTable ulAf = 2, TableClass = 5 not supportted
...
>Program received signal SIGSEGV, Segmentation fault.
>0x7bc4b2c5 in RtlReAllocateHeap ()

no problems here, checked on opensuse 12.2 and wine (32bit) 1.5.6, 1.6.0 and 1.7.1

did run 

%winedbg --gdb   bus/dbus-daemon.exe --nofork --print-address=1 --config-file=test/data/valid-config-files/session.conf 

got 

tcp:host=localhost,port=12765,family=ipv4,guid=b24bbb5bc3940fd6b868a9df52251284
Comment 3 Simon McVittie 2013-09-03 13:53:29 UTC
(In reply to comment #2)
> did run 
> 
> %winedbg --gdb   bus/dbus-daemon.exe --nofork --print-address=1
> --config-file=test/data/valid-config-files/session.conf 

Sorry, I should have said: the other part of this test was to run the test-dbus-daemon test, pointing it to that dbus-daemon:

DBUS_TEST_DAEMON_ADDRESS=tcp:host=localhost,port=22960 wine ~/build/dbus/mingw/test/test-dbus-daemon.exe

(adjust paths, port as needed).

If that works OK on "real Windows" (and preferably also on newer Wine), then we can consider this to be NOTOURBUG.
Comment 4 Simon McVittie 2013-09-03 13:54:35 UTC
(In reply to comment #3)
> the other part of this test was to run the
> test-dbus-daemon test, pointing it to that dbus-daemon

... which requires Attachment #85077 [details].
Comment 5 Ralf Habacker 2013-09-03 16:42:59 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > the other part of this test was to run the
> > test-dbus-daemon test, pointing it to that dbus-daemon
> 
> ... which requires Attachment #85077 [details].

..:~/src/dbus-cross-cmake-build> DBUS_TEST_DAEMON=bin/dbus-daemon.exe DBUS_TEST_DATA=z:$PWD/test/data wine bin/test-dbus-daemon.exe 
/creds: ** Message: bin/dbus-daemon.exe --config-file=z:/home/ralf/src/dbus-cross-cmake-build/test/data/valid-config-files/session.conf

** Message: ProcessID of this process is 8
OK
/echo/session: ** Message: bin/dbus-daemon.exe --config-file=z:/home/ralf/src/dbus-cross-cmake-build/test/data/valid-config-files/session.conf

OK
/echo/limited: ** Message: bin/dbus-daemon.exe --config-file=z:/home/ralf/src/dbus-cross-cmake-build/test/data/valid-config-files/incoming-limit.conf

Failed to start message bus: Unknown address type 'unix'



Changing listen statement in incoming-limit.conf to 'autolaunch:' let the last test run successfully: 


/echo/limited: ** Message: bin/dbus-daemon.exe --config-file=z:/home/ralf/src/dbus-cross-cmake-build/test/data/valid-config-files/incoming-limit.conf

OK

I tested this with wine-1.5.6
Comment 6 Simon McVittie 2013-09-03 17:12:16 UTC
(In reply to comment #5)
> Failed to start message bus: Unknown address type 'unix'

Yeah, I should make that #ifdef DBUS_UNIX.

It looks as though testing autolaunch would interfere with a "real" autolaunched bus, so we should avoid that?
Comment 7 Simon McVittie 2013-09-03 17:12:54 UTC
dropping severity since it isn't really our bug
Comment 8 Ralf Habacker 2013-10-09 22:48:19 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Failed to start message bus: Unknown address type 'unix'
> 
> Yeah, I should make that #ifdef DBUS_UNIX.
> 
> It looks as though testing autolaunch would interfere with a "real"
> autolaunched bus, so we should avoid that?

The problem is a <listen>unix:tmpdir=/tmp</listen> in the related bus daemon config file. 

/echo/limited: ** Message: starting dbus daemon: bin/dbus-daemon.exe --config-file=z:/home/ralf/src/dbus-cross-cmake-build/test/data/valid-config-files/incoming-limit.conf

It is required to use a variable for the listen statement in this config file, which is filled out by the configure process.
Comment 9 Ralf Habacker 2013-10-09 22:49:38 UTC
Created attachment 87363 [details] [review]
Use TEST_LISTEN in incoming-listen.conf.in
Comment 10 Ralf Habacker 2013-10-09 22:55:05 UTC
(In reply to comment #9)
> Created attachment 87363 [details] [review] [review]
> Use TEST_LISTEN in incoming-listen.conf.in

works now with this patch 

xxxx@yyyy:~/src/dbus-cross-cmake-build> DBUS_SESSION_BUS_ADDRESS= DBUS_TEST_DAEMON=bin/dbus-daemon.exe DBUS_TEST_DATA=z:$PWD/test/data wine bin/test-dbus-daemon.exe 
/creds: ** Message: starting dbus daemon: bin/dbus-daemon.exe --config-file=z:/home/ralf/src/dbus-cross-cmake-build/test/data/valid-config-files/session.conf

** Message: ProcessID of this process is 8
OK
/echo/session: ** Message: starting dbus daemon: bin/dbus-daemon.exe --config-file=z:/home/ralf/src/dbus-cross-cmake-build/test/data/valid-config-files/session.conf

OK
/echo/limited: ** Message: starting dbus daemon: bin/dbus-daemon.exe --config-file=z:/home/ralf/src/dbus-cross-cmake-build/test/data/valid-config-files/incoming-limit.conf

OK
Comment 11 Ralf Habacker 2013-10-10 07:46:13 UTC
Comment on attachment 87363 [details] [review]
Use TEST_LISTEN in incoming-listen.conf.in

moved patch to bug 68506
Comment 12 Ralf Habacker 2013-10-10 07:55:13 UTC
stable wine version is 1.6 and dbus-daemon is known to work with at least wine 1.5.6.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.