Opened 13 years ago

Closed 13 years ago

#78 closed defect (fixed)

Crash in WGSS50.DLL at exit

Reported by: dmik Owned by:
Priority: major Milestone: RC2
Component: general Version: 1.6.0-b19 RC
Severity: low Keywords:
Cc:

Description

Some applications crash in WGSS50.DLL when exiting. This relates to at least Jeti/2 and Freecol. Here's the popuplog:

02-24-2011  16:14:43  SYS3170  PID 02b0  TID 0001  Slot 00a9
D:\DEV\OPENJDK6_B19_SDK_OS2_RC-20110221_MPUNSAFE\JRE\BIN\JAVA.EXE
c0010002
1d92bb43
P1=00000005  P2=XXXXXXXX  P3=XXXXXXXX  P4=XXXXXXXX
EAX=009d48f0  EBX=14540600  ECX=00014670  EDX=20014674
ESI=145405ac  EDI=20014670
DS=0053  DSACC=d0f3  DSLIM=5fffffff
ES=0053  ESACC=d0f3  ESLIM=5fffffff
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:1dee5ae5  CSACC=d0df  CSLIM=5fffffff
SS:ESP=0053:0081fe34  SSACC=d0f3  SSLIM=5fffffff
EBP=0081fe64  FLG=00010202

WGSS50.DLL 0001:0000bb43

Sometimes the crash happens in KERNEL32.DLL:

02-24-2011  16:07:45  SYS3175  PID 0295  TID 0001  Slot 00a9
D:\DEV\OPENJDK6_B19_SDK_OS2_RC-20110221_MPUNSAFE\JRE\BIN\JAVA.EXE
c0000005
1dee5ae5
P1=00000001  P2=009d48f0  P3=XXXXXXXX  P4=XXXXXXXX
EAX=009d48f0  EBX=14530600  ECX=00014a30  EDX=20014a34
ESI=145305ac  EDI=20014a30
DS=0053  DSACC=d0f3  DSLIM=5fffffff
ES=0053  ESACC=d0f3  ESLIM=5fffffff
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:1dee5ae5  CSACC=d0df  CSLIM=5fffffff
SS:ESP=0053:0081fe34  SSACC=d0f3  SSLIM=5fffffff
EBP=0081fe64  FLG=00010206

KERNEL32.DLL 0001:00025ae5

Needs to be investigated.

Change History (7)

comment:1 Changed 13 years ago by dmik

The crash in KERNEL32.DLL actually happens when you press Ctrl-C/Break in the attached console to end the application.

comment:2 Changed 13 years ago by dmik

I don't seem to observe these crashes in non-sound related applications.

I always observe both when terminating an application that is playing (or has played) a sound.

My guess is that it is somehow related to stopping the sound thread. Some race condition probably.

comment:3 Changed 13 years ago by dmik

JFTR, the KERNEL32.DLL trap is in SetEvent?, around line 210 in hmevent.cpp.

comment:4 Changed 13 years ago by dmik

Got stuck again with GCC. An attempt to build the debug version of OpenJDK with GCC 4.4.5 fails with this message:

d:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp:302: fatal error: error writing to D:\Temp/ccuhk8h8.s: Invalid
argument
compilation terminated.

Absolutely stupid one.

I found that both 4.4.5 and 4.4.4 fail here. 4.4.2 and 4.5.2 work.

In the end we have *no* GCC compiler ATM that could build OpenJDK completely. This is very annoying...

More over, I've just got my Linux machine screwed up. Some meaningless crash in /usr/bin/X for which I can't find anything on the Internet so far. I think I have to reinsatll it from scratch since it will be faster than spending days on debugging this dirty stuff and reading these endless reports over there.

comment:5 Changed 13 years ago by dmik

Created http://mantis.smedley.info/bug_view_page.php?bug_id=468 for the GCC issue. Built the problematic file manually with GCC 4.5.2. The build is going further now.

comment:6 Changed 13 years ago by dmik

The crash in WGSS50.DLL (and one of Ctrl-Break crashes in KERNEL32.DLL) is fixed in r274.

It turned out that using a DosExitList?() routine as a place to call static C++ object destructors is not correct: some Odin/WGSS subsystems (e.g. TLS storage and presumably some synchronization primitive machinery) are already uninitialized by that time while may still be in use by the code in the destructors (which was the reason of the crashes). A much better place for calling the destructors is DllMain?() which is provided when DLL is registered with Odin and is then called by it at the right time (in particular when the DLL is detached from the process at process termination).

This is what r274 implements. The DllMain?() code is quite universal and it is already shared between JAWTOS2.DLL and both JSOUND.DLL and JSOUNDDS.DLL. We will add it to more DLLs as we find the ones that rely on Odin in their static destructors (which will be indicated by similar crashes).

comment:7 Changed 13 years ago by dmik

Resolution: fixed
Status: newclosed

What is about the other Ctrl-Break crash (and Ctrl-Break program termination in general), the source of the problem is actually what is described in #33. So I will continue with it there.

Note: See TracTickets for help on using tickets.