Inkscape in wine in valgrind

Bug #989201 reported by David Mathog
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

This isn't exactly a bug, more like a bug in debugging. I'm trying to run inkscape in wine in valgrind, in order to find memory problems with the Windows version. To do so:

1. Boot a Ubuntu 10.04.4 LTS system

2. apt-get update
     apt-get upgrade
     apt-get install valgrind
     reboot
     (login again)
     valgrind --version #valgrind-3.6.0.SVN-Debian
     wine --version #wine-1.2.2

3. Transfer via scp directories to /usr/local/src
      inkscape3 (holds src, inkscape,build etc.)
      mingw
      devlibs2 (ignore the 2)

4. On the ubuntu system (via SSH tunnel back to a Cygwin X11 server)
      xfterm4
      cd /usr/local/src/inkscape3/inkscape
      export Path="Z:\\usr\\local\src\\mingw\bin;Z:\\usr\\local\\src\\devlibs2\bin;Z:\\usr\\locl\\src\\devlibs2\python"
      #note the case of Path in the preceding, it is for use within wine

5. Test that this version of inkscape.exe will run in wine
      wine inkscape.exe

It runs, albeit SLOWLY with a zillion of these:

     Xlib: extension "MIT-SHM" missing on display "localhost:10.0".

and some pango messages like:

(inkscape.exe:8): Pango-WARNING **: couldn't load font "MS Shell Dlg Not-Rotated 6.666015625", falling back to "Sans Not-Rotated 6.666015625", expect ugly output.

I did not test it beyond starting it, waiting for the window to open up all the way, and then exiting with ^Q.

6. Test that a simple windows command line program can run in wine in valgrind (used one of my one called extract.exe)

    valgrind --trace-children=yes --vex-iropt-precise-memory-exns=yes \
   --workaround-gcc296-bugs=yes --leak-check=full \
   wine extract -i >/tmp/extract.log 2>&1

  (strange command line args for valgrind from here: http://winezeug.googlecode.com/svn/trunk/valgrind/doc/win32.html)

That actually ran with the expected output, and buried deep in the resulting 204K log file was the tiny section corresponding to the actual run of extract.exe. So that looked good.

7. Try to run inkscape.exe in wine in valgrind:

    valgrind --trace-children=yes --vex-iropt-precise-memory-exns=yes \
   --workaround-gcc296-bugs=yes --leak-check=full \
   wine inkscape.exe >/tmp/inkfull.log 2>&1

Here is, naturally, where everything fell apart. Comparing the two log files, at the place where the child process emitted the expected output for extract, there was for inkscape instead a very large number of these (varying at the first address)

==3149== Invalid write of size 4
==3149== at 0x7BC71B3A: ??? (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x7BC73409: ??? (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x418D36F: ??? (in /lib/tls/i686/cmov/libpthread-2.11.1.so)
==3149== Address 0x7f31f420 is not stack'd, malloc'd or (recently) free'd

followed by a large number of these (also varying at the first address)

==3149== Invalid read of size 4
==3149== at 0x7BC72BE8: set_cpu_context (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x7BC72C81: NtRaiseException (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x7BC72EA3: ??? (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0xDEADBABD: ???
==3149== by 0x4A91942: ??? (in /usr/lib/wine/user32.dll.so)
==3149== by 0x4A91EDB: ??? (in /usr/lib/wine/user32.dll.so)
==3149== by 0x4A92164: CreateIconFromResourceEx (in /usr/lib/wine/user32.dll.so)
==3149== by 0x4A92B8E: ??? (in /usr/lib/wine/user32.dll.so)
==3149== by 0x4A92FBF: LoadImageW (in /usr/lib/wine/user32.dll.so)
==3149== by 0x4A93F7D: LoadImageA (in /usr/lib/wine/user32.dll.so)
==3149== by 0x4CC8A25: SIC_Initialize (in /usr/lib/wine/shell32.dll.so)
==3149== by 0x4CD2221: ??? (in /usr/lib/wine/shell32.dll.so)
==3149== Address 0x7f31f4f8 is on thread 1's stack

then some more that looked a lot like the preceding, then it went completely off the rails at:

==3149== Jump to the invalid address stated on the next line
==3149== at 0x1CAA0000: ???
==3149== by 0x7FE6125D: ???
==3149== by 0x7FE610E0: ???
==3149== by 0x7BC49D14: ??? (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x7BC4CE32: ??? (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x7BC4D75F: ??? (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x7BC4D731: ??? (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x7BC4D962: ??? (in /usr/lib/wine/ntdll.dll.so)
==3149== by 0x4031CFC: ??? (in /usr/lib/libwine.so.1.0)
==3149== Address 0x1caa0000 is not stack'd, malloc'd or (recently) free'd
==3149==
err:seh:segv_handler Got unexpected trap 0

then a bunch more error messages until finally something recognizable:

==3149==
err:module:attach_process_dlls "libpopt-0.dll" failed to initialize, aborting
==3149== Warning: client switching stacks? SP change: 0x7f31fff0 --> 0xbecbadb4
==3149== to suppress, use: --max-stackframe=1067036100 or greater
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\usr\\local\\src\\inkscape3\\inkscape\\inkscape.exe" failed, status c000001d
==3149==

We know that when running outside of valgrind "wine inkscape.exe" starts, so the path to find libpopt is OK, and no similar message appears when it is run that way.

At this point I am opening the floor for suggestions about how to go forward from here. One could ignore the stupendous number of valgrind error messages that are from wine itself, but not being able to start the target test program in that doubly nested environment is a deal breaker.

Tags: build win32
Revision history for this message
David Mathog (mathog) wrote :

Looks like wine must be built specifically with valgrind suport in mind:

http://wiki.winehq.org/Wine_and_Valgrind?action=show&redirect=Valgrind

Revision history for this message
David Mathog (mathog) wrote :

Found a version 1.4 wine for this Ubuntu

add-apt-repository ppa:ubuntu-wine/ppa
apt-get update
apt-get install wine
wine --version #wine-1.4
wine inkscape.exe

popup [Inkscape encountered an internal error and will close now]

command line shows:

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can fix it.

my little command line program still runs OK, also in the debugger.

(inkscape.exe:8): Pango-WARNING **: couldn't load font "MS Shell Dlg Not-Rotated 8", falling back to "Sans Not-Rotated 8", expect ugly output.

Revision history for this message
David Mathog (mathog) wrote :

Make that "also in valgrind", not "also in the debugger".

Revision history for this message
su_v (suv-lp) wrote :
tags: added: build win32
Revision history for this message
Kris (kris-degussem) wrote :

Marking as invalid for the reason given in <https://bugs.launchpad.net/inkscape/+bug/989972/comments/1>
If necessary, the right place is the developers mailing list. However, running Inkscape under wine under valgrind on linux under a VM in windows is a quite a few steps too much to be able to actually trust the results.

Changed in inkscape:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.