tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <>
Subject Re: Recent tcnative null-dereference with 8.0.0-RC3 and 7.0.45 [tcnative-1.dll+0x7e23]
Date Wed, 02 Oct 2013 05:18:28 GMT
On 10/01/2013 07:32 PM, sebb wrote:
> If a Java application succeeds in crashing the JVM, then IMO the JVM
> has a bug. I believe that all native code should strive to behave the
> same way.

This is conceptual difference.

Most of those checks are done again inside Java.
However inside JVM the Java API hides its native methods and
ensures params are validated. Our API is Servlet spec and our VM is Tomcat.

All the invalid data should be checked in java part which can be
invalid as part of normal operation. Our native code already checks
for some invalid data which can be invalid in such situations.
OTOH invalid data passed to native caused by bug is just that, a bug.
So fix the bug and you won't need the check.

We can add compile time '#if defined(MAINTAINER_MODE) ... #endif' checks
for easier debugging at development, but all the checks inside native method
can be equally well coded before the actual JNI call and since our API is servlet
and no use code can pass beyond that.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message