![]() In my view, there are a couple things worth fixing here:ġ. To reproduce this bug reliably, one should confirm (using unset!) that LANG, LC_ALL, and LC_CTYPE are not listed by 'env’. if LANG and LC_ALL are set to empty values, 'locale' reports LC_ALL as having a value of "C"). Or that what 'locale' reports sometimes doesn't match the env values (e.g. It didn't help that an empty value and no/NULL value look the same in the 'locale' output, This is why I couldn't reproduce this bug, even when logged into the test machine and setting up seemingly matching 'locale' output. ![]() The real way to clear/remove a var is 'unset'. In Bourne-style shells, I've always used "export VARNAME=" to clear vars, which has always done what I needed up until now. I now know this is *not* the same as being set to an empty value. One of the main things that made this difficult to reproduce is that the 8011194 fix looks specifically for env vars which do not have any value set (getenv(.) = NULL). This adjustment is not made when OnLoad-ing an agent jar. In order for files to be displayed correctly in double-clicked apps under non-ASCII languages, if the native encoding is reported as US-ASCII, but no values are set for LANG/LC_ALL/LC_CTYPE, we use UTF-8 instead, as it's known to be supported on Mac. jars have file.encoding value of US-ASCII on Mac OS X”). The discrepancy in determining the encoding was introduced in 8 (backported to 7u60) with the fix for JDK-8011194 ("Apps launched via double-clicked. No path on bootclasspath -> ClassNotFoundException. appendBootClassPath() continues without calling AddToBootstrapClassLoaderSearch. 'iconvToPlatform' is set to convert UTF-8 to US-ASCII, but the Boot-Class-Path contains (many) characters that can’t convert to US-ASCII, so iconv() fails (errno says: "Illegal byte sequence"). When Agent.jar is OnLoad-ed, Boot-Class-Path is read (as a UTF-8 string), and converted to the native platform encoding, which comes up as US-ASCII (based, I believe, on env var settings). In the test, Setup.java sees a defulaultEncoding of UTF-8 (based on the file.encoding system property), and constructs the full 'unicode' Boot-Class-Path manifest entry for Agent.jar. ![]() The problem boils down to different decisions being made about the default/platform encoding in the standard java main() environment, versus the jvmti/OnLoad/premain() environment, under particular conditions on Mac.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |