datetime exception 0xC0000008 JRE 1.4 windows

  • Thread starter Michael Tomlinson
  • Start date
M

Michael Tomlinson

I finally resolved this issue and though I would share it here to hopefully
prevent anyone else from going through the same pain!

In Australia, daylight savings is supposed to end at 2am on the last sunday
of march.

Microsoft seem a little confused about this; on my PC the
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time
Zones\AUS Eastern Standard Time] key had
"TZI"=hex:a8,fd,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,05,00,03,00,
00,\
00,00,00,00,00,00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00
which sais 3am, but
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation]
"DaylightStart"=hex:00,00,0a,00,05,00,02,00,00,00,00,00,00,00,00,00
sais 2am.

Now, some bugs:
I was calling JAVAs date to string routine, which I found (using
sysinternals regmon) was first reading the
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation] key
and then examining each of the
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time
Zones\] keys to find a match.

Now on my workmates PC, it found and matched the "AUS Eastern Standard Time"
timezone, because both keys had 3am.

On my PC, they didn't match, so it continued searching through all the
timezones, didn't find a match, and then did something a little odd; it
issued a RegCloseKey on a NULL handle.

The MS documentation sais that RegCloseKey will return an error code, but it
actually emits a windows structured exception 0xC0000008 - bad handle.
This exception goes up through the JAVA and kills the program - but only
under the debugger. 0xC00000008 is ignored when running outside the
debugger.

Since we have the Java JVM (1.42) running inside a C++ program (using
LoadLibrary and dynamic binding) I'm guessing that not too many people have
encountered this one before, and it's probably unique to Australia too,
unless there's other timecodes that MS isn't so sure about.... hard for me
to verify!

Anyway I set my registry so that it was consistent, and the problem
dissapeared.
Only took me about a day to figure all this out :-(

Either the MS code shouldn't throw the exception, or the documentation needs
to be update; if the exception remains then the JAVA runtime probably needs
to be updated to not call RegCloseKey(0) anyway...

Mike

http://www.jsiinc.com/SUBA/tip0300/rh0398.htm

http://www.thrashmaster.com/developer/msbugs/bug1.htm

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regclosekey.asp
 
M

Michael Tomlinson

Er no - this wasn't about even caring that the time was correct; it came
down to the fact that the registry settings for the rules that specify the
changeover were different, which seems to be quite common on these PC's, and
under the right (or wrong!?) condition, the Java Runtime will crash due to
an poorly documented windows call.
Changing the clock wouldn't fix anything.
Sorry if my explanation wasn't all that clear.... it's a confusing issue :)
Mike

nos said:
New plan, just type in the correct time/date.
Save a day.

Michael Tomlinson said:
I finally resolved this issue and though I would share it here to hopefully
prevent anyone else from going through the same pain!

In Australia, daylight savings is supposed to end at 2am on the last sunday
of march.

Microsoft seem a little confused about this; on my PC the
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time
Zones\AUS Eastern Standard Time] key had
"TZI"=hex:a8,fd,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,05,00,03,00,
00,\
00,00,00,00,00,00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00
which sais 3am, but
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation]
"DaylightStart"=hex:00,00,0a,00,05,00,02,00,00,00,00,00,00,00,00,00
sais 2am.

Now, some bugs:
I was calling JAVAs date to string routine, which I found (using
sysinternals regmon) was first reading the
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation] key
and then examining each of the
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time
Zones\] keys to find a match.

Now on my workmates PC, it found and matched the "AUS Eastern Standard Time"
timezone, because both keys had 3am.

On my PC, they didn't match, so it continued searching through all the
timezones, didn't find a match, and then did something a little odd; it
issued a RegCloseKey on a NULL handle.

The MS documentation sais that RegCloseKey will return an error code,
but
it
actually emits a windows structured exception 0xC0000008 - bad handle.
This exception goes up through the JAVA and kills the program - but only
under the debugger. 0xC00000008 is ignored when running outside the
debugger.

Since we have the Java JVM (1.42) running inside a C++ program (using
LoadLibrary and dynamic binding) I'm guessing that not too many people have
encountered this one before, and it's probably unique to Australia too,
unless there's other timecodes that MS isn't so sure about.... hard for me
to verify!

Anyway I set my registry so that it was consistent, and the problem
dissapeared.
Only took me about a day to figure all this out :-(

Either the MS code shouldn't throw the exception, or the documentation needs
to be update; if the exception remains then the JAVA runtime probably needs
to be updated to not call RegCloseKey(0) anyway...

Mike

http://www.jsiinc.com/SUBA/tip0300/rh0398.htm

http://www.thrashmaster.com/developer/msbugs/bug1.htm
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/bas
e/regclosekey.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top