https://bugs.kde.org/show_bug.cgi?id=386425

            Bug ID: 386425
           Summary: running valgrind + wine on armv7l gives illegal opcode
           Product: valgrind
           Version: 3.14 SVN
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: austinengl...@gmail.com
  Target Milestone: ---

Every test fails the same way:
(stretch)austin@localhost:~/wine-git/dlls/advapi32/tests$ make service.ok
../../../tools/runtest -q -P wine -T ../../.. -M advapi32.dll -p
advapi32_test.exe.so service && touch service.ok
==20504== 
==20504== Process terminating with default action of signal 4 (SIGILL)
==20504==  Illegal opcode at address 0x4FC2C54
==20504==    at 0x4FC2C54: signal_init_thread (signal_arm.c:974)
==20504==    by 0x4FCA7CB: thread_init (thread.c:354)
==20504==    by 0x4F9F303: __wine_process_init (loader.c:3341)
==20504==    by 0x485FBC3: wine_init (loader.c:979)
==20504==    by 0x108A27: main (main.c:258)
Illegal instruction (core dumped)
Makefile:374: recipe for target 'service.ok' failed
make: *** [service.ok] Error 132

I reviewed this with the wine ARM maintainer, who pointed out it's likely a
valgrind bug. The code in question:
https://source.winehq.org/git/wine.git/blob/40b7831cd80607e42b9e1c910a62f022c45ac884:/dlls/ntdll/signal_arm.c#l959

Removing the TEB/TPIDRURW handling get's past this:
diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
index e5e314049e..df050a96ae 100644
--- a/dlls/ntdll/signal_arm.c
+++ b/dlls/ntdll/signal_arm.c
@@ -968,12 +968,6 @@ void signal_init_thread( TEB *teb )
         pthread_key_create( &teb_key, NULL );
         init_done = TRUE;
     }
-
-#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_8A__)
-    /* Win32/ARM applications expect the TEB pointer to be in the TPIDRURW
register. */
-    __asm__ __volatile__( "mcr p15, 0, %0, c13, c0, 2" : : "r" (teb) );
-#endif
-
     pthread_setspecific( teb_key, teb );
 }

and now tests work.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to