[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] JDK-8204211: windows : handle potential C++ exception in GDIRenderer -was : RE:
From:       "Langer, Christoph" <christoph.langer () sap ! com>
Date:       2018-06-01 8:43:50
Message-ID: a9cce7674b5741eaa223022e6ea36460 () sap ! com
[Download RAW message or body]

Hi Matthias,

looks good to me.

Before you push, make sure to update the copyright year and use the client repo. 😊

Best regards
Christoph

> -----Original Message-----
> From: Baesken, Matthias
> Sent: Freitag, 1. Juni 2018 10:39
> To: Thomas Stüfe <thomas.stuefe@gmail.com>; 2d-dev <2d-
> dev@openjdk.java.net>
> Cc: Langer, Christoph <christoph.langer@sap.com>
> Subject: RFR: JDK-8204211: windows : handle potential C++ exception in
> GDIRenderer -was : RE: [OpenJDK 2D-Dev] java2d coding using
> SAFE_SIZE_ARRAY_ALLOC / safe_Malloc
> 
> Hi Thomas , thanks for the feedback.
> I created a bug and change for the excpetion handling in GDIRenderer.cpp  .
> Please review .
> 
> Thanks,  Matthias
> 
> Bug:
> 
> https://bugs.openjdk.java.net/browse/JDK-8204211
> 
> JDK-8204211: windows : handle potential C++ exception in GDIRenderer
> 
> 
> Change :
> 
> 
> http://cr.openjdk.java.net/~mbaesken/webrevs/8204211/
> 
> 
> 
> 
> > -----Original Message-----
> > From: Thomas Stüfe [mailto:thomas.stuefe@gmail.com]
> > Sent: Mittwoch, 30. Mai 2018 17:37
> > To: Baesken, Matthias <matthias.baesken@sap.com>
> > Cc: 2d-dev <2d-dev@openjdk.java.net>
> > Subject: Re: [OpenJDK 2D-Dev] java2d coding using
> > SAFE_SIZE_ARRAY_ALLOC / safe_Malloc
> >
> > Letting c++ exceptions escape from extern "C" functions is UB and may
> > (and probably will) crash the process. This should be fixed. Approach
> > taken by JDK-8039394 is fine (I would probably catch every C++
> > exception with catch(...), not just bad_alloc, just to be safe).
> >
> > Best Regards, Thomas
> >
> > On Wed, May 30, 2018 at 5:08 PM, Baesken, Matthias
> > <matthias.baesken@sap.com> wrote:
> > > Hello ,  there is still some  java2d coding  where
> SAFE_SIZE_ARRAY_ALLOC /
> > > safe_Malloc    is used  and  the  (potentially occurring) exception is not
> > > handled .
> > >
> > >
> > >
> > > This leads to  CL warnings  (when enabled  ) like
> > >
> > >
> > >
> > > " function assumed not to throw an exception but does ; The function is
> > > extern "C" and /EHc was specified"
> > >
> > >
> > >
> > > Example :
> > >
> > >
> > >
> > > java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp
> > >
> > >
> > >
> > > static POINT *TransformPoly()
> > >
> > >   …..
> > >
> > >     if (outpoints > POLYTEMPSIZE) {
> > >
> > >         pPoints = (POINT *) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc,
> > > sizeof(POINT), outpoints);
> > >
> > >     }
> > >
> > >
> > >
> > >
> > >
> > > Should  we add exception handling   here ?
> > >
> > >
> > >
> > > Similar fixes were done  in the change  8039394: Compiler warnings about
> > C++
> > > exceptions in windows printing code
> > >
> > >
> > >
> > > https://bugs.openjdk.java.net/browse/JDK-8039394
> > >
> > > http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/823387e2bf42
> > >
> > >
> > >
> > >
> > >
> > > Best regards, Matthias
> > >
> > >
> > >
> > >

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic