linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Hearn <mh@codeweavers.com>
To: Thomas Sailer <sailer@scs.ch>
Cc: Andrew Morton <akpm@osdl.org>,
	torvalds@osdl.org, the3dfxdude@gmail.com, pouech-eric@wanadoo.fr,
	dan@debian.org, roland@redhat.com, linux-kernel@vger.kernel.org,
	wine-devel@winehq.com, wine-patches@winehq.com
Subject: Re: ptrace single-stepping change breaks Wine
Date: Thu, 30 Dec 2004 13:06:20 +0000	[thread overview]
Message-ID: <1104411980.3073.6.camel@littlegreen> (raw)
In-Reply-To: <1104401393.5128.24.camel@gamecube.scs.ch>

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

On Thu, 2004-12-30 at 11:09 +0100, Thomas Sailer wrote:
> On Wed, 2004-12-29 at 20:15 -0800, Andrew Morton wrote:
> > You can globally disable flex-mmap with
> > 
> > 	echo 1 > /proc/sys/vm/legacy_va_layout
> > 
> > Does it fix things?
> 
> Haven't tried. But setarch i386 -L /usr/bin/wine ... did fix it.
> 
> Tom

Tom, does this patch against Wine help? It should do the same thing as
the setarch program, so if that fixes it then this should also (if I've
understood how this mechanism works of course).

Mike Hearn <mh@codeweavers.com>
Set the Linux ABI personality to get a legacy VM layout

[-- Attachment #2: linux-personality.patch --]
[-- Type: text/x-patch, Size: 1568 bytes --]

--- configure.ac  (revision 14)
+++ configure.ac  (local)
@@ -188,6 +188,7 @@ AC_CHECK_HEADERS(\
 	linux/joystick.h \
 	linux/major.h \
 	linux/param.h \
+	linux/personality.h \
 	linux/serial.h \
 	linux/ucdrom.h \
 	machine/cpu.h \
--- libs/wine/loader.c  (revision 14)
+++ libs/wine/loader.c  (local)
@@ -41,6 +41,11 @@
 #include "winbase.h"
 #include "wine/library.h"
 
+#ifdef HAVE_LINUX_PERSONALITY_H
+#include <sys/syscall.h>
+#include <linux/personality.h>
+#endif
+
 #ifdef __APPLE__
 #include <crt_externs.h>
 #define environ (*_NSGetEnviron())
@@ -515,6 +520,22 @@ static void debug_usage(void)
 
 
 /***********************************************************************
+ *           linux_personality_init
+ *
+ * Sets the "please unbreak me" mmap flag to disable things like
+ * flex-mmap. Note that this will also disable exec-shield
+ * randomization for any ELF DLLs loaded after this point but the
+ * initial libraries (libc etc) linked in automatically will be
+ * randomized.
+ */
+static void linux_personality_init(void)
+{
+#if defined(HAVE_LINUX_PERSONALITY_H) && defined(__i386__)
+    syscall(SYS_personality, PER_LINUX32 | 0x0200000 /* ADDR_COMPAT_LAYOUT */);
+#endif
+}
+
+/***********************************************************************
  *           wine_init
  *
  * Main Wine initialisation.
@@ -526,6 +547,7 @@ void wine_init( int argc, char *argv[], 
     void *ntdll;
     void (*init_func)(void);
 
+    linux_personality_init();
     build_dll_path();
     wine_init_argv0_path( argv[0] );
     __wine_main_argc = argc;

  reply	other threads:[~2004-12-30 13:01 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.58.0411151439270.2222@ppc970.osdl.org>
2004-11-15 22:53 ` ptrace single-stepping change breaks Wine Roland McGrath
2004-11-19 19:00   ` Eric Pouech
2004-11-19 19:20     ` Linus Torvalds
2004-11-19 19:33       ` Eric Pouech
2004-11-19 19:51         ` Linus Torvalds
2004-11-19 20:41           ` Eric Pouech
2004-11-19 21:22             ` Linus Torvalds
2004-11-19 21:23             ` Daniel Jacobowitz
2004-11-19 21:53               ` Linus Torvalds
2004-11-20 21:49                 ` Jesse Allen
2004-11-21  4:55                   ` Jesse Allen
2004-11-21 21:32                   ` Davide Libenzi
2004-11-21 22:33                     ` Linus Torvalds
2004-11-21 23:14                       ` Davide Libenzi
2004-11-22  1:12                         ` Linus Torvalds
2004-11-22  0:13                       ` Andreas Schwab
2004-11-22  1:07                         ` Linus Torvalds
2004-11-22  4:06                           ` Davide Libenzi
2004-11-22  4:29                             ` Linus Torvalds
2004-11-22  6:23                               ` Linus Torvalds
2004-11-22 11:06                                 ` Andreas Schwab
2004-11-22 16:27                                   ` Linus Torvalds
2004-11-22 13:46                                 ` Davide Libenzi
2004-11-22 23:15                                 ` Jesse Allen
2004-11-22 23:48                                   ` Jesse Allen
2004-11-28 17:01                                   ` Eric Pouech
2004-11-22 20:52                   ` Eric Pouech
2004-11-22 21:10                     ` Linus Torvalds
2004-11-22 22:19                       ` Mike Hearn
2004-11-22 22:25                         ` Linus Torvalds
2004-12-29  2:14                         ` Thomas Sailer
2004-12-29 15:02                           ` Mike Hearn
2004-12-29 18:53                             ` Linus Torvalds
2004-12-29 19:40                               ` Jesse Allen
2004-12-29 20:04                                 ` Linus Torvalds
2004-12-29 21:43                                   ` Jesse Allen
2004-12-30  0:44                                     ` Linus Torvalds
2004-12-30  1:13                                       ` Davide Libenzi
2004-12-30  1:55                                         ` Linus Torvalds
2004-12-30  4:51                                           ` Linus Torvalds
2004-12-30  4:58                                             ` Linus Torvalds
2004-12-30  5:07                                               ` Davide Libenzi
2004-12-30  7:26                                                 ` Linus Torvalds
2004-12-30 17:59                                                   ` Davide Libenzi
2004-12-30 18:16                                                     ` Linus Torvalds
2004-12-30 19:27                                                     ` Jesse Allen
2004-12-30 19:34                                                       ` Linus Torvalds
2004-12-30 22:46                                                         ` Linus Torvalds
2004-12-30 23:00                                                           ` Daniel Jacobowitz
2004-12-30 23:17                                                             ` Linus Torvalds
2004-12-31  5:36                                                               ` Daniel Jacobowitz
2004-12-31  5:47                                                                 ` Linus Torvalds
2004-12-31  7:00                                                                   ` Jesse Allen
2004-12-31 15:10                                                                   ` Daniel Jacobowitz
2004-12-31 17:19                                                                     ` Linus Torvalds
2005-01-01 23:20                                                                       ` Daniel Jacobowitz
2005-01-29  9:25                                                                   ` Kari Hurtta
2004-12-30 23:15                                                           ` Andi Kleen
2004-12-31  0:38                                                             ` Linus Torvalds
2004-12-31 12:35                                                               ` Andi Kleen
2004-12-31 15:16                                                                 ` Davide Libenzi
2004-12-31 17:30                                                                   ` Linus Torvalds
2004-12-31 19:55                                                                     ` Jesse Allen
2004-12-31 17:14                                                                 ` Linus Torvalds
2004-12-31  4:55                                                           ` Jesse Allen
2004-12-31  5:05                                                             ` Linus Torvalds
2004-12-31  5:38                                                               ` Daniel Jacobowitz
2004-12-30 19:19                                                   ` Davide Libenzi
2004-12-30  5:06                                           ` Davide Libenzi
2004-12-30  4:28                                       ` Jesse Allen
2004-12-29 20:56                                 ` Jesse Allen
2004-12-29 19:35                             ` Thomas Sailer
2004-12-29 20:13                               ` Jesse Allen
2004-12-30  1:49                                 ` Thomas Sailer
2004-12-30  2:10                                   ` Linus Torvalds
2004-12-30  2:39                                     ` Thomas Sailer
2004-12-30  2:57                                     ` Thomas Sailer
2004-12-30  3:15                                     ` Thomas Sailer
2004-12-30  4:15                                       ` Andrew Morton
2004-12-30 10:09                                         ` Thomas Sailer
2004-12-30 13:06                                           ` Mike Hearn [this message]
2004-12-31 13:13                                             ` Thomas Sailer
2004-12-31 13:31                                               ` Mike Hearn
2004-12-31 15:42                                                 ` Jesse Allen
2004-12-31 15:56                                                   ` Davide Libenzi
2004-12-31 15:59                                                     ` Jesse Allen
2004-12-31 22:01                                                     ` Linus Torvalds
2005-01-01 22:04                                                       ` Davide Libenzi
2005-01-01 22:14                                                         ` Linus Torvalds
2005-01-02  3:46                                                           ` Davide Libenzi
2005-01-07  4:51                                                       ` minor nit with decoding popf instruction - was " John Kacur
2005-01-07  6:48                                                         ` Linus Torvalds
2005-01-08  5:05                                                           ` John Kacur
2004-12-31 15:51                                                 ` Thomas Sailer
     [not found]                                                   ` <1104873315.3557.87.camel@littlegreen>
2005-01-04 21:21                                                     ` Andrew Morton
2005-01-05 10:43                                                     ` Thomas Sailer
2005-01-05 11:24                                                       ` Ingo Molnar
2005-01-05 11:40                                                     ` Alexandre Julliard
2004-12-30 12:11                                     ` Mike Hearn
2004-11-20  3:40               ` Roland McGrath
2004-11-19 20:59       ` Grzegorz Kulewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1104411980.3073.6.camel@littlegreen \
    --to=mh@codeweavers.com \
    --cc=akpm@osdl.org \
    --cc=dan@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pouech-eric@wanadoo.fr \
    --cc=roland@redhat.com \
    --cc=sailer@scs.ch \
    --cc=the3dfxdude@gmail.com \
    --cc=torvalds@osdl.org \
    --cc=wine-devel@winehq.com \
    --cc=wine-patches@winehq.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).