[Bug 749] New - Sune Hotspot Java crashed in win95 mode

wine-bugs at winehq.com wine-bugs at winehq.com
Thu May 30 17:10:38 CDT 2002


http://bugs.winehq.com/show_bug.cgi?id=749

*** shadow/749	Thu May 30 17:10:38 2002
--- shadow/749.tmp.13654	Thu May 30 17:10:38 2002
***************
*** 0 ****
--- 1,79 ----
+ +============================================================================+
+ | Sune Hotspot Java crashed in win95 mode                                    |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 749                         Product: Wine                    |
+ |       Status: UNCONFIRMED                 Version: CVS                     |
+ |   Resolution:                            Platform:                         |
+ |     Severity: normal                   OS/Version: All                     |
+ |     Priority: P1                        Component: wine-misc               |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: wine-bugs at winehq.com                                         |
+ |  Reported By: bon at elektron.ikp.physik.tu-darmstadt.de                      |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |    Milestone: TargetMilestone: ---                                         |
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Running Hotspot jave with wine in winxx incarnation, wine crashes when the java
+ machine finds some errors with threads and tries to print out the Thread ID.
+ This is done by:
+ 
+ hotspot2_0-src-win/src/share/vm/utilities/debug.cpp:  Thread::current()->print();
+ 
+ and I think this resolves to
+ hotspot2_0-src-win/src/os_cpu/win32_i486/vm/threadLS_win32_i486.cpp:
+ ...
+ int ThreadLocalStorage::base_offset() {
+   return os::win32::is_nt()
+        ? 0xe10  // found by looking at TLS code on NT
+        :  0x88; // found by looking at TLS code on Windows95
+ }
+ // This code is win32/x86 specific
+ void ThreadLocalStorage::generate_code_for_get_thread() {
+   ::ThreadLocalStorageOffset = base_offset() + thread_offset();
+ 
+   // We have to generate code for get_thread since the
+   // tls index is resolved at load time.
+   // The reason we cannot use the nice assembler class is
+   // it uses resource object which in turn uses get_thread
+   // for allocation.
+   address buffer = (address) &get_thread;
+ 
+   if (os::win32::is_nt()) {
+     // mov eax, dword ptr fs:[ThreadLocalStorageOffset]
+     // 64 A1 ThreadLocalStorageOffset
+     *buffer++ = 0x64;
+     *buffer++ = 0xA1;
+ 
+     *((int*) buffer) = ThreadLocalStorageOffset;
+     buffer += sizeof(int);
+   } else {
+     // mov eax, dword ptr fs:[18H];
+     // 64 A1 18 00 00 00
+     *buffer++ = 0x64;
+     *buffer++ = 0xA1;
+     *buffer++ = 0x18;
+     *buffer++ = 0x00;
+     *buffer++ = 0x00;
+     *buffer++ = 0x00;
+ 
+     // mov eax, dword ptr [eax+ThreadLocalStorageOffset];
+     // 8B 80 ThreadLocalStorageOffset
+     *buffer++ = 0x8B;
+     *buffer++ = 0x80;
+     *((int*) buffer) = ThreadLocalStorageOffset;
+     buffer += sizeof(int);
+   }
+ 
+   // ret
+   // C3
+   *buffer++ = 0xC3;
+ 
+ 
+ wine/scheduler/process.c defines at 0x88 a DWORD tls_bits[2], which may be the
+ culprit, if I understand things right.
+ 
+ The source for the Hotspot Java engine may be downloaded at SUN.
+ 
+ Reproduce the bug by simply calling "wine javaw" with winver set to win95.
\ No newline at end of file



More information about the wine-bugs mailing list