Re: Graal and Tomcat Native

2019-07-22 Thread Giorgio Zoppi
Just a comment the function choosenum is not safe, the rand() is not a good PRG, i would use if it is possible arc4random in bsd/linux. Best Regards, Giorgio. El lun., 22 jul. 2019 a las 9:12, jean-frederic clere () escribió: > On 18/07/2019 11:05, Rainer Jung wrote: > > Hi Jean-Frederic and

Re: Graal and Tomcat Native

2019-07-22 Thread jean-frederic clere
On 18/07/2019 11:05, Rainer Jung wrote: > Hi Jean-Frederic and Rémy, > > I do not have a real answer, but a workaround. It is possible to get the > same result without any printf style functions or atoi, just by doing > arithmetics. But: maybe then the crash simply moves to another position.

Re: Graal and Tomcat Native

2019-07-18 Thread Rainer Jung
Hi Jean-Frederic and Rémy, I do not have a real answer, but a workaround. It is possible to get the same result without any printf style functions or atoi, just by doing arithmetics. But: maybe then the crash simply moves to another position. In src/ssl.c you can use: static int

Re: Graal and Tomcat Native

2019-07-18 Thread jean-frederic clere
On 12/07/2019 11:21, Rémy Maucherat wrote: > On Thu, Jul 11, 2019 at 11:01 PM Rainer Jung > wrote: > > Am 11.07.2019 um 22:10 schrieb Rémy Maucherat: > > On Thu, Jul 11, 2019 at 8:42 PM Rainer Jung > mailto:rainer.j...@kippdata.de> > >

Re: Graal and Tomcat Native

2019-07-15 Thread Rémy Maucherat
On Fri, Jul 12, 2019 at 11:21 AM Rémy Maucherat wrote: > In the native code, it crashes on: > https://github.com/apache/tomcat-native/blob/master/native/src/ssl.c#L635 > > I modified the code to: > double d = (((double)(rand()%RAND_MAX)/RAND_MAX)*(h-l)); > apr_snprintf(buf, sizeof(buf),

Re: Graal and Tomcat Native

2019-07-12 Thread Rémy Maucherat
On Thu, Jul 11, 2019 at 11:01 PM Rainer Jung wrote: > Am 11.07.2019 um 22:10 schrieb Rémy Maucherat: > > On Thu, Jul 11, 2019 at 8:42 PM Rainer Jung > > wrote: > > > > Hi Rémy, > > > > When one looks up the macros in native/include/tcn.h, this boils > >

Re: Graal and Tomcat Native

2019-07-11 Thread Rainer Jung
Am 11.07.2019 um 22:10 schrieb Rémy Maucherat: On Thu, Jul 11, 2019 at 8:42 PM Rainer Jung > wrote: Hi Rémy, When one looks up the macros in native/include/tcn.h, this boils down to the following returning null: (*env)->FindClass(env,

Re: Graal and Tomcat Native

2019-07-11 Thread Rémy Maucherat
On Thu, Jul 11, 2019 at 8:42 PM Rainer Jung wrote: > Hi Rémy, > > Am 11.07.2019 um 18:35 schrieb Rémy Maucherat: > > On Thu, Jul 11, 2019 at 4:36 PM Rainer Jung > > wrote: > > > > Probably not very helup, but to make sure, the GetEnv is failing, I > >

Re: Graal and Tomcat Native

2019-07-11 Thread Rainer Jung
Hi Rémy, Am 11.07.2019 um 18:35 schrieb Rémy Maucherat: On Thu, Jul 11, 2019 at 4:36 PM Rainer Jung > wrote: Probably not very helup, but to make sure, the GetEnv is failing, I would add a little code to native/src/jnilib.c in JNI_OnLoad() that

Re: Graal and Tomcat Native

2019-07-11 Thread Rémy Maucherat
On Thu, Jul 11, 2019 at 4:36 PM Rainer Jung wrote: > Probably not very helup, but to make sure, the GetEnv is failing, I > would add a little code to native/src/jnilib.c in JNI_OnLoad() that > creates an observable side effect while executing int he function. E.g. > on Unix/Linux you could add

Re: Graal and Tomcat Native

2019-07-11 Thread Rainer Jung
Probably not very helup, but to make sure, the GetEnv is failing, I would add a little code to native/src/jnilib.c in JNI_OnLoad() that creates an observable side effect while executing int he function. E.g. on Unix/Linux you could add something like #include ... FILE *fd =

Re: Graal and Tomcat Native

2019-07-11 Thread Rémy Maucherat
On Thu, Jul 11, 2019 at 9:18 AM Rainer Jung wrote: > Hi Rémy, > > for which Java version and distribution is this? The docs for Java 7 and > 8 are much less precise about return codes than the cited docs for Java > 9. So older versions might give a generic error. The used code for > checking

Re: Graal and Tomcat Native

2019-07-11 Thread Rainer Jung
Hi Rémy, for which Java version and distribution is this? The docs for Java 7 and 8 are much less precise about return codes than the cited docs for Java 9. So older versions might give a generic error. The used code for checking versions is in the HotSpot sources for version 8 inside

Re: Graal and Tomcat Native

2019-07-10 Thread Rémy Maucherat
On Wed, Jul 10, 2019 at 9:10 PM Igal Sapir wrote: > Rémy, > > At the risk of pointing out the obvious as I'm sure that you are much > more familiar with this than I am: > > On 7/10/2019 11:42 AM, Rémy Maucherat wrote: > > Hi, > > > > I'm a bit stumped there, as I'm trying to get native to work

Re: Graal and Tomcat Native

2019-07-10 Thread Igal Sapir
Rémy, At the risk of pointing out the obvious as I'm sure that you are much more familiar with this than I am: On 7/10/2019 11:42 AM, Rémy Maucherat wrote: Hi, I'm a bit stumped there, as I'm trying to get native to work in that rather special environment. JNI_OnLoad fails with: WARNING: