[tor-commits] [tor-browser-bundle/master] Install newer wine from Ubuntu PPA.

mikeperry at torproject.org mikeperry at torproject.org
Tue Jan 21 04:47:04 UTC 2014


commit e9ce6c530647849ea6205f5ed01f44f2ae32b7d1
Author: David Fifield <david at bamsoftware.com>
Date:   Sun Nov 24 02:55:10 2013 +0000

    Install newer wine from Ubuntu PPA.
    
    The main reason for a newer wine is to work around an issue in the
    Ubuntu's standard wine1.4 that often manifests when running Python code,
    leading to a page fault.
    
    "blender 2.61 crashes on start (python3.2)
    http://bugs.winehq.org/show_bug.cgi?id=29764
    "EVE Online crashes when viewing certain ship models (T3 ships)"
    http://bugs.winehq.org/show_bug.cgi?id=30515
    
    The crash is triggered by the _PyVerify_fd function, which peeks at a
    Windows-internal data structure, implicitly expecting it to have been
    allocated on the heap.
    http://hg.python.org/cpython/file/694e2708b4a8/Modules/posixmodule.c#l1078
    Wine 1.4 doesn't do this structure in the way Python expects, leading to
    the page fault. _PyVerify_fd is called by many Python functions that
    deal with file descriptor numbers, such as io.open and os.fstat. This is
    sufficient to crash Python run under Wine 1.4:
    	>>> import os
    	>>> os.fstat(4)
    (The crash is actually at RtlHeapSize, called by _msize, called by
    _PyVerify_fd.) I initially tried to patch around such problematic calls,
    but they are too pervasive.
    
    When running wineboot or any other Wine command, it is necessary to
    remove libfaketime from LD_PRELOAD.
    	"[Bug 31237] New: libfaketime: integrate with libfaketime to allow running a program with a fake time"
    	http://bugs.winehq.org/show_bug.cgi?id=31237
    My experience matches what appears in the bug report. With libfaketime
    in LD_PRELOAD, I got this error every time I ran a Wine command:
    	wine: created the configuration directory '/home/ubuntu/.wine'
    	wine: Unhandled page fault on read access to 0x00000000 at address (nil) (thread 000b),
    	err:seh:start_debugger Couldn't start debugger ("winedbg --auto 10 104") (2)
    	Read the Wine Developers Guide on how to set up winedbg or another debugger
    	wine: Unhandled page fault on read access to 0x00000000 at address (nil) (thread 0011),
    	err:seh:start_debugger Couldn't start debugger ("winedbg --auto 16 68") (2)
    	Read the Wine Developers Guide on how to set up winedbg or another debugger
---
 .../windows/gitian-pluggable-transports.yml          |   18 ++++++++++++++++++
 gitian/mkbundle-windows.sh                           |    1 +
 2 files changed, 19 insertions(+)

diff --git a/gitian/descriptors/windows/gitian-pluggable-transports.yml b/gitian/descriptors/windows/gitian-pluggable-transports.yml
index bc2e3f6..28f64ff 100644
--- a/gitian/descriptors/windows/gitian-pluggable-transports.yml
+++ b/gitian/descriptors/windows/gitian-pluggable-transports.yml
@@ -15,6 +15,7 @@ remotes:
 - "url": "https://github.com/nmathewson/openssl.git"
   "dir": "openssl"
 files:
+- "ubuntu-wine.gpg"
 - "dzip.sh"
 script: |
   INSTDIR="$HOME/install"
@@ -26,6 +27,8 @@ script: |
   export LC_ALL=C
   export CFLAGS="-mwindows"
   export LDFLAGS="-mwindows"
+  # This is correct only for kvm.
+  MIRROR_HOST=10.0.2.2
   # XXX: Hardening options cause the exe's to crash.. not sure why
   #export CFLAGS="-mwindows -fstack-protector-all -fPIE -Wstack-protector --param ssp-buffer-size=4 -fno-strict-overflow -Wno-missing-field-initializers -Wformat-security"
   #export LDFLAGS="-mwindows -Wl,--dynamicbase -Wl,--nxcompat -lssp -L/usr/lib/gcc/i686-w64-mingw32/4.6/"
@@ -36,6 +39,21 @@ script: |
   mkdir -p $INSTDIR/Data/Tor/
   mkdir -p $OUTDIR/
   #
+  # Install a Wine new enough to have a fix for http://bugs.winehq.org/show_bug.cgi?id=29764;
+  # otherwise Python run under Wine constantly crashes in _PyVerify_fd, which is
+  # called by such common operations as io.open and os.fstat (anything involving
+  # a file descriptor number). Ubuntu's main repository only has wine1.4, and
+  # the issue was fixed in 1.5.29.
+  sudo -s sh -c "echo deb http://$MIRROR_HOST:3142/ppa.launchpad.net/ubuntu-wine/ppa/ubuntu precise main >> /etc/apt/sources.list"
+  # This key is from https://launchpad.net/~ubuntu-wine/+archive/ppa and
+  # http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x5A9A06AEF9CB8DB0.
+  sudo apt-key add ubuntu-wine.gpg
+  sudo apt-get update
+  sudo apt-get --no-install-recommends -y install wine
+  # libfaketime causes all Wine commands to crash; remove it from LD_PRELOAD.
+  # http://bugs.winehq.org/show_bug.cgi?id=31237
+  LD_PRELOAD= wineboot -i
+  #
   cd openssl
   find -type f | xargs touch --date="$REFERENCE_DATETIME"
   ./Configure -shared --cross-compile-prefix=i686-w64-mingw32- mingw --prefix=$INSTDIR/openssl
diff --git a/gitian/mkbundle-windows.sh b/gitian/mkbundle-windows.sh
index 989c2a9..33e8a2b 100755
--- a/gitian/mkbundle-windows.sh
+++ b/gitian/mkbundle-windows.sh
@@ -43,6 +43,7 @@ echo "$TORBROWSER_VERSION" > $GITIAN_DIR/inputs/bare-version
 cp -a $WRAPPER_DIR/$VERSIONS_FILE $GITIAN_DIR/inputs/versions
 
 cp $WRAPPER_DIR/build-helpers/* $GITIAN_DIR/inputs/
+cp $WRAPPER_DIR/gpg/ubuntu-wine.gpg $GITIAN_DIR/inputs/
 
 cd $WRAPPER_DIR/..
 rm -f $GITIAN_DIR/inputs/relativelink-src.zip





More information about the tor-commits mailing list