JDK-4827353 : atomic::membar doesn't on x86
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8,windows
  • CPU: x86,sparc
  • Submitted: 2003-03-05
  • Updated: 2012-10-08
  • Resolved: 2003-03-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
1.4.1_07 07Fixed 1.4.2Fixed
Related Reports
Duplicate :  
Relates :  
Description
There are three problems with x86 membar:

1) It's a no-op on win32

2) Linux uses sfence, instead of mfence, doing only store barriers

3) Solaris x86 claims to do a mfence, but uses the sfence encoding!

This is a critical flaw. There is a reproducable VM crash on win32,
and the solx86/linux bug could easily result in random VM crashes.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.1_07 generic mantis-beta FIXED IN: 1.4.1_07 mantis-beta INTEGRATED IN: 1.4.1_07 mantis-b19 mantis-beta tiger-b03
14-06-2004

WORK AROUND Never use a machine with more than one cpu.
11-06-2004

EVALUATION Crash is reproducable on win32. Its a bug. There is some risk that the fix will have an effect on performance, but the only other choice is to give the wrong answer or crash. ###@###.### 2003-03-04 ------------------------------------ Fix for mantis: 1. change i486 assembler to emit the correct opcode 2. Win32 and Linux atomic::membar() use locked-add as memory barriers. ###@###.### 2003-03-07 Fix for 1.4.1_06: 1. change i486 assembler to emit the correct opcode 2. Win32 atomic::membar() use locked-add as memory barriers, for linux it is not applicable. ###@###.### 2003-09-16
16-09-2003

SUGGESTED FIX win32 copies the solaris membar code. linux uses the "mfence" instead of "sfence" opcode the i486 assembler changes the emited encoding for membar(). ------------------------------------------ We have lots of membar's during startup. Using cpuid causes a significant slowdown. Instead we use "lock addl $0, 0(%%esp)" on both Windows and Linux for atomic::membar(). See attached webrev.tgz for the changes ###@###.### 2003-03-07
07-03-2003