Re: RFR: 8310829: guarantee(!HAS_PENDING_EXCEPTION) failed in ExceptionTranslation::doit [v2]

2023-06-26 Thread Doug Simon
On Mon, 26 Jun 2023 07:59:17 GMT, David Holmes  wrote:

> if the first decode encounters a class initialization error then it will just 
> return with the exception pending and no decoding will actually have occurred

That's fine - if VMSupport fails class initialization, then no "rich" decoding 
can occur (by definition) and so throwing the clinit error is the best we can 
do.

> If we get to the encode first and it encounters an initialization error it 
> will still attempt to do a decode that must in turn fail 

You have to keep in mind that `encode` and `decode` are called in different 
runtimes. If encoding an exception in the HotSpot runtime fails (e.g. due to an 
OOME calling `VMSupport.` in the HotSpot heap), then it's still fine to 
try call `VMSupport.decode` in the libgraal runtime. If `VMSupport.decode` in 
the libgraal runtime also fails, then it throw the exception describing the 
secondary failure. There's simply no way to guarantee all info is shown when 
secondary issues occur during exception handling.

-

PR Comment: https://git.openjdk.org/jdk/pull/14641#issuecomment-1607433634


Re: RFR: 8310829: guarantee(!HAS_PENDING_EXCEPTION) failed in ExceptionTranslation::doit [v2]

2023-06-26 Thread Doug Simon
> The VMSupport class is required for translating an exception between the 
> HotSpot and libgraal heaps.
> Loading it lazily can result in a loading exception, obscuring the exception 
> being translated.
> To avoid this, VMSupport is loaded eagerly along with the other vmClasses.

Doug Simon has updated the pull request incrementally with one additional 
commit since the last revision:

  try harder to show nested exception during exception translation

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/14641/files
  - new: https://git.openjdk.org/jdk/pull/14641/files/fafc0aae..614e1e9f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=14641&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14641&range=00-01

  Stats: 51 lines in 4 files changed: 21 ins; 4 del; 26 mod
  Patch: https://git.openjdk.org/jdk/pull/14641.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14641/head:pull/14641

PR: https://git.openjdk.org/jdk/pull/14641