Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4221D10D05 for ; Mon, 30 Sep 2013 17:42:39 +0000 (UTC) Received: (qmail 96945 invoked by uid 500); 30 Sep 2013 17:42:35 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 96814 invoked by uid 500); 30 Sep 2013 17:42:27 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 96805 invoked by uid 99); 30 Sep 2013 17:42:25 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Sep 2013 17:42:25 +0000 Received: from localhost (HELO fc19x74v0.jboss.hr) (127.0.0.1) (smtp-auth username mturk, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Sep 2013 17:42:25 +0000 Message-ID: <5249B7FE.2060200@apache.org> Date: Mon, 30 Sep 2013 19:42:22 +0200 From: Mladen Turk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: dev@tomcat.apache.org Subject: Re: Recent tcnative null-dereference with 8.0.0-RC3 and 7.0.45 [tcnative-1.dll+0x7e23] References: <5246199A.70000@christopherschultz.net> <5246AEB6.5050509@kippdata.de> <5246B613.6010504@apache.org> <52492924.1040205@apache.org> <52497DE2.4010007@apache.org> <524999BB.1010007@christopherschultz.net> In-Reply-To: <524999BB.1010007@christopherschultz.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 09/30/2013 05:33 PM, Christopher Schultz wrote: > > I may need a little more guidance, since adding NULL-checks for > everything is a little silly. Here is the function declaration in tcnative: > > TCN_IMPLEMENT_CALL(jint, Poll, poll)(TCN_STDARGS, jlong pollset, > jlong timeout, jlongArray set, > jboolean remove) > > > Presumably, the pollset itself is non-null, but could all of the items > in the pollset be null? > APR does not check for parameter validity. Neither does TC native in most cases (checks are actually leftovers from initial debugging). It's up to java code to ensure params are valid, and thread safe if needed. I don't think there is nothing wrong with the native code. Using it is where the majority of problems happen. Neither thread safety or param checking should be part of native code. It's a thin low level wrapper. Everything else should be done in java. Regards -- ^TM --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org