Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

DO NOT REPLY New: Segmentation in org.apache.tomcat.jni.File.infoGet() native method

svn commit: r1242142 - /tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java
(17 lines)
Update of "jeremiahlevinson" by jeremiahlevinson
(61 lines)
Feb 8, 2012
Bugzilla
Bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52627

             Bug #: 52627
           Summary: Segmentation in org.apache.tomcat.jni.File.infoGet()
                    native method
           Product: Tomcat Native
           Version: 1.1.22
          Platform: Macintosh
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Library
        AssignedTo: d### @tomcat.apache.org
        ReportedBy: ivma### @gmail.com
    Classification: Unclassified


Created attachment 28291
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28291
Source code for the repro case

There is a potential segfault in the tomcat native wrappers around
apr_file_info_get() (which themselves probably wrap the fstat() and stat()
syscalls).

I've attached a simple java file that reproduces this 100% of the time on
my OS
X 10.7 system with tomcat-native-1.1.22. I'm not sure if infoGet() is
actually
used in the tomcat server codebase, I stumbled upon the bug in my own
project
that uses the tomcat native library's JNI wrappers around Apache Portable
Runtime.

Repro instructions:

1) Download and build tomcat-native (I think I got the source from
https://github.com/apache/tomcat-native and followed the instructions). You
may
need to install libapr (apache portable runtime) through apt-get or port or
whatever package manager you use.

2) Download the TomcatNativeCrash.java attachment
3) Copy tomcat-native-*-dev.jar to the same directory as the attachment.
4) Copy the libtcnative library files for your architecture to the same
directory as the attachment (they get built into
tomcat-native/jni/native/.libs)
3) Build the repro case with:

javac -classpath ./tomcat-native*.jar:. TomcatNativeCrash.java

4) Run the repro case with:

java -Djava.library.path=. -classpath ./tomcat-native*.jar:.
./TomcatNativeCrash.java

The repro just opens a file descriptor to the file named by the first
argument
(its own source in the example), creates a FileInfo structure, and tries to
fstat it via org.apache.tomcat.jni.File.infoGet() 100,000 times. This
segfaults
for me every single time.

I've coded up a fix and submitted it as a pull request on github:
https://github.com/apache/tomcat-native/pull/1




Reply
Tags: bugzillasegmentationapache
svn commit: r1202546 - in /tomcat/jk/trunk: native/ native/apache-1.3/ native/apache-2.0/ native/com
November 16, 2011 12:47:22 AM
Author: mturk Date: Wed Nov 16 06:46:51 2011 New Revision: 1202546 URL: http://svn.apache.org/viewvc?rev=1202546&view=rev Log: Remove deprecated jni code Removed: tomcat/jk/trunk/native/common/jk_jni_worker.c …
svn commit: r1174289 - in /tomcat/jk/trunk: native/apache-1.3/ native/apache-2.0/ native/common/ nat
September 22, 2011 01:01:56 PM
Author: rjung Date: Thu Sep 22 18:01:31 2011 New Revision: 1174289 URL: http://svn.apache.org/viewvc?rev=1174289&view=rev Log: - URI Map: Add "sticky_ignore" extension attributes to uri worker map. It allows to disable stickyness for…
svn commit: r1174449 - in /tomcat/jk/trunk: native/apache-1.3/ native/apache-2.0/ native/common/ nat
September 22, 2011 06:24:09 PM
Author: rjung Date: Thu Sep 22 23:23:18 2011 New Revision: 1174449 URL: http://svn.apache.org/viewvc?rev=1174449&view=rev Log: Add the mapping rule extension "stateless" and analogous HTTPD env var JK_STATELESS. They can be used to improve…
svn commit: r1078805 - in /tomcat/jk/trunk: native/apache-1.3/ native/apache-2.0/ native/common/ nat
March 7, 2011 09:17:40 AM
Author: rjung Date: Mon Mar 7 15:17:11 2011 New Revision: 1078805 URL: http://svn.apache.org/viewvc?rev=1078805&view=rev Log: Support Servlet API getRemotePort(). Works for Tomcat 5.5.28, 6.0.20 and 7.0.0 in combination with Apache and ISAPI…
svn commit: r1187963 - in /tomcat/jk/trunk: native/apache-1.3/ native/apache-2.0/ native/common/ nat
October 23, 2011 03:14:19 PM
Author: rjung Date: Sun Oct 23 20:13:30 2011 New Revision: 1187963 URL: http://svn.apache.org/viewvc?rev=1187963&view=rev Log: BZ 51326: Add "session_cookie" and "session_path" rule extensions. Contributed by Eiji Takahashi. Modified: …
svn commit: r962531 [1/2] - in /tomcat/jk/trunk: native/apache-1.3/ native/apache-2.0/ native/iis/ n
July 9, 2010 08:56:10 AM
Author: rjung Date: Fri Jul 9 13:56:09 2010 New Revision: 962531 URL: http://svn.apache.org/viewvc?rev=962531&view=rev Log: Fix end of line setting for MSVC build files. Patch provided by sebb. Modified: …
svn commit: r962531 [2/2] - in /tomcat/jk/trunk: native/apache-1.3/ native/apache-2.0/ native/iis/ n
July 9, 2010 08:56:10 AM
Modified: tomcat/jk/trunk/native/jni/jni_connect.dsp URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/jni/jni_connect.dsp?rev=962531&r1=962530&r2=962531&view=diff
DO NOT REPLY New: apache and mod_auth_basic segmentation fault
June 14, 2010 01:19:37 PM
https://issues.apache.org/bugzilla/show_bug.cgi?id=49437 Summary: apache and mod_auth_basic segmentation fault Product: Apache httpd-2 Version: 2.2.15 Platform: PC OS/Version: Linux …
DO NOT REPLY Segmentation fault while starting apache
November 20, 2011 04:14:14 PM
https://issues.apache.org/bugzilla/show_bug.cgi?id=47937 Eric Covener <cov### @gmail.com> changed: What |Removed |Added
DO NOT REPLY New: Apache is terminated with signal 11, Segmentation fault
December 6, 2010 06:58:12 PM
https://issues.apache.org/bugzilla/show_bug.cgi?id=50423 Summary: Apache is terminated with signal 11, Segmentation fault Product: Apache httpd-2 Version: 2.2.3 Platform: Other …
DO NOT REPLY mod_jk gives segmentation fault when apache is started as root
October 25, 2011 01:12:19 PM
https://issues.apache.org/bugzilla/show_bug.cgi?id=39967 Rainer Jung <rainer### @kippdata.de> changed: What |Removed |Added
svn commit: r1187868 - in /tomcat/jk/trunk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c na
October 23, 2011 06:39:05 AM
Author: rjung Date: Sun Oct 23 11:38:18 2011 New Revision: 1187868 URL: http://svn.apache.org/viewvc?rev=1187868&view=rev Log: HTTPD: Allow to choose a sticky worker using the environment variable JK_ROUTE. This can be used if sessions and…
svn commit: r1126561 - in /tomcat/jk/trunk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c na
May 23, 2011 11:03:39 AM
Author: rjung Date: Mon May 23 16:03:12 2011 New Revision: 1126561 URL: http://svn.apache.org/viewvc?rev=1126561&view=rev Log: Forward WWW-Authenticate from backend when status is 401 and server generated error pages are used. Only…
svn commit: r1240904 - in /tomcat/jk/trunk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xd
February 6, 2012 01:38:55 AM
Author: rjung Date: Mon Feb 6 07:37:50 2012 New Revision: 1240904 URL: http://svn.apache.org/viewvc?rev=1240904&view=rev Log: BZ 52564: Fix building with format checking gcc security hardening cflags. Contributed by Tony Mancill. Modified: …
svn commit: r1187906 - in /tomcat/jk/trunk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xd
October 23, 2011 10:32:00 AM
Author: rjung Date: Sun Oct 23 15:31:26 2011 New Revision: 1187906 URL: http://svn.apache.org/viewvc?rev=1187906&view=rev Log: Fix BZ 52056: HTTPD: JK request log does not always log correct response status. Fixed by refactoring JK request log…
svn commit: r1187950 - in /tomcat/jk/trunk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xd
October 23, 2011 02:06:03 PM
Author: rjung Date: Sun Oct 23 19:05:16 2011 New Revision: 1187950 URL: http://svn.apache.org/viewvc?rev=1187950&view=rev Log: BZ 51743: HTTPD: Support rule extensions when defining the request worker with an environment variable (e.g.…
DO NOT REPLY New: apache-tomcat-6.0.32 does not work "Deploy directory or WAR file located on
May 10, 2011 09:39:45 PM
https://issues.apache.org/bugzilla/show_bug.cgi?id=51183 Bug #: 51183 Summary: apache-tomcat-6.0.32 does not work "Deploy directory or WAR file located on server" (403 error) Product: Tomcat 6…
svn commit: r1142156 - in /tomcat/jk/trunk: native/STATUS.txt native/iis/README native/netscape/READ
July 2, 2011 12:42:04 AM
Author: mturk Date: Sat Jul 2 05:40:54 2011 New Revision: 1142156 URL: http://svn.apache.org/viewvc?rev=1142156&view=rev Log: Update files according to the release HOWTO Modified: tomcat/jk/trunk/native/STATUS.txt …
DO NOT REPLY New: Expose a method via JMX which empties the webapp file cache
September 16, 2010 04:24:53 AM
https://issues.apache.org/bugzilla/show_bug.cgi?id=49939 Summary: Expose a method via JMX which empties the webapp file cache Product: Tomcat 6 Version: unspecified Platform: All …
DO NOT REPLY New: org.catalina.tomcat.startup.Tomcat#silence method doesn't use the host where we a
December 26, 2011 07:49:02 PM
https://issues.apache.org/bugzilla/show_bug.cgi?id=52387 Bug #: 52387 Summary: org.catalina.tomcat.startup.Tomcat#silence method doesn't use the host where we add the applications Product:…
An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17
January 25, 2011
HI i am downloaded the tomcat 7.x file from apache.. when i added this tomcat in the eclipse i am getting this error.. Please help me resolve this…
Problem with apache seding reply status
April 24, 2011
Hello can any one help with this how do I resolve this problem : http://pastebin.com/Xq4n1Je8 this make my server down can any one help me and tell…
How to use Tomcat Native?
January 4, 2011
I saw that Apache Tomcat has a native flavor, and it has the following binaries for Windows: openssl.exe tcnative-1.dll How to use it? Isn't it…
Native libraries not found in Tomcat
May 27, 2011
Hi, I developed an GWT application which includes some native libraries with JNI. when I test it form eclipse everything works fine but when I try…
Apache segmentation fault
February 22, 2011
Ubuntu 10.10, Apache 2.2.16: # service apache2 start * Starting web server apache2 Segmentation fault Action 'start' failed. The Apache error log…
Php extension works with CLI, segmentation fault with apache
January 7, 2011
I built a PHP extension using SWIG. It is a shared lib that I placed in my php project on my linux box. The project lives in the directory…
Apache Segmentation Fault when case changes in URL with CodeIgniter
January 19, 2011
I'm using CodeIgniter and I my controller filenames and class names are named as per documentation. On one particular controller, when I first load…
PHP Causing Segmentation Fault & Apache Blank Response
February 16, 2011
I recently updated a Debian Lenny server to php 5.3,5 using the dotdeb source. Soon after doing so certain (but not all) sites on the server stopped…
PHP and Apache Segmentation Fault with large variable size
April 14, 2011
Hello, I seem to be having a really weird problem. I have a single variable (string) where I am storing some data. As soon as the data stored in…
Can actual PHP code be causing a segmentation fault in Apache, and if so how?
April 29, 2011
I have Apache 2.2.14 installed with PHP version 5.3.2 and libapache2-mod-php5 version 5.3.2-1ubuntu4.7 on Ubuntu 10.04 x64. I am getting…
Apache LOG: child pid xxxx exit signal Segmentation fault (11)
March 17, 2011
Apache + PHP + Mysql + Linux [notice] child pid 23145 exit signal Segmentation fault (11), possible coredump in /tmp But nothing found under /tmp…
How Apache Ant deploys .war file to Tomcat
May 25, 2011
I'm using Apache Ant 1.8 to deploy a web application into a local Tomcat server, and the build.xml file (below) produces the desired effect when I…
Can not access jar file under lib folder in apache tomcat.
June 23, 2011
I have put my jar files in folder named "myLibs" under lib folder of my application. When I run application I get NoClassDefFoundException for the…
Error with hosting a jsp file in Apache Tomcat 7.0.8
March 2, 2011
Hi all I have little experience with hosting and administering jsp sites in Apache Tomcat 7.0.8. Today I tried to host a site Apache Tomcat 7.0.8…
Apache Tomcat Cataline file changes not reflecting!
March 3, 2011
Hi all, I am using apache-tomcat-6.0.18 on windows xp prefossional SP3. My requirement is to show additional information ( like Organization Name)…
Java apache tomcat is not detecting the jsp file even when it exists.
May 5, 2011
Hi, I have come across to a strange problem where apache tomcat server is showing 404 server code. But some of the files are being detected by the…
Php-Java Bridge War File deployment in apache tomcat
February 5, 2011
Hai Guys, Am a newbee and does not know much about apache-tomcat..... heres my problem -> I have my sites contents uploaded to public_html folder…
Apache tomcat file download only after session authentication jsp
April 14, 2011
Hi i am using apache tomcat. i have a jsp file for entering user name and password and a java bean for authentication. after user have been…
How to reference a file or resource in the Tomcat container from the Apache webserver side?
May 9, 2011
I'm basically a newbie to the Apache Tomcat container so bare with me. I'm pretty sure I've got all the settings and configurations down ie,…
Uploading multiple files using file upload control in apache tomcat
April 7, 2011
Hi, I am new to apache tomcat. I am running apache tomcat in my windows machine.I am having a html containing file upload control.Using that i…