You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2008/04/25 21:46:26 UTC

DO NOT REPLY [Bug 44875] New: Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

https://issues.apache.org/bugzilla/show_bug.cgi?id=44875

           Summary: Frequent SIGSEGV in apr_pool_destroy when shutting down
                    Tomcat
           Product: APR
           Version: HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: paul.miner@gmail.com


Created an attachment (id=21854)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21854)
Crash log 1

When shutting down the Tomcat server configured to use APR, the JVM will often
crash, with the problematic frame being listed as:
# C  [libapr-1.so.0+0x15f0b]  apr_pool_destroy+0xdb

The operating system is 64-bit RedHat Enterprise Linux 5, kernel
2.6.18-53.1.14.el5, dual socket dual core Xeon CPUs.

This also happened with APR 1.2.7 that the distribution came with. I downloaded
and compiled the latest version (1.2.12), and the problem was still present.
The problem only occurs when the webserver is shutdown.

Since the crash occurs while the APR code is being called within the JVM, the
JVM provides crash logs, two of which I will attach (both were created after
the update to APR 1.2.12).


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875


Mladen Turk <mt...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |WONTFIX




--- Comment #9 from Mladen Turk <mt...@apache.org>  2008-05-04 23:35:28 PST ---
It's a bug caused by double free. The root of the problem
is the fact that root pool on apr_terminate will destroy
all subpools before calling cleanups.
With APR 1.3 we have two new pool functions, one
for registering pre-callbacks allowing to cleanly close everything
before the pool is destroyed, and the other is to create detached
pools from the root pool. Since Java has its own GC, we can trust
it will always destroy the pool when the object is destroyed.

I'm closing this case in APR, cause its Tomcat Native problem,
so you might reopen the issue in Tomcat.
However the solution will be fully resolved once when we use 1.3 for TC native.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875


Bojan Smojver <bo...@rexursive.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bojan@rexursive.com




--- Comment #2 from Bojan Smojver <bo...@rexursive.com>  2008-04-27 23:45:55 PST ---
Any chance you can give us a backtrace with debugging symbols available, so
that we can tell where these errors occur in the source?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875





--- Comment #6 from Paul Miner <pa...@gmail.com>  2008-04-30 13:53:21 PST ---
Created an attachment (id=21891)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21891)
Output of readelf on libapr-1.so.0.2.12


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875





--- Comment #5 from Paul Miner <pa...@gmail.com>  2008-04-30 13:52:33 PST ---
Created an attachment (id=21890)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21890)
HotSpot error log for process 2968


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875





--- Comment #1 from Paul Miner <pa...@gmail.com>  2008-04-25 12:47:00 PST ---
Created an attachment (id=21855)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21855)
Crash log 2


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875


Bojan Smojver <bo...@rexursive.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875


Paul Miner <pa...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21854|0                           |1
        is obsolete|                            |
  Attachment #21855|0                           |1
        is obsolete|                            |




--- Comment #4 from Paul Miner <pa...@gmail.com>  2008-04-30 13:52:06 PST ---
Created an attachment (id=21889)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21889)
Backtrace for the process after the crash.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875





--- Comment #7 from Paul Miner <pa...@gmail.com>  2008-04-30 13:54:06 PST ---
Created an attachment (id=21892)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21892)
network.c from Tomcat 6.0.16


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875


Paul Miner <pa...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paul.miner@gmail.com
             Status|NEEDINFO                    |ASSIGNED




--- Comment #3 from Paul Miner <pa...@gmail.com>  2008-04-30 13:51:21 PST ---
I got a backtrace by using the following JVM option:
  -XX:OnError="sudo gdb - -x /home/tomcat/gdb.script %p"
Containing the following script for GDB:
  set pagination off
  thread apply all backtrace
  backtrace full
  detach
  quit

I'm attaching the hotspot error file, the backtrace from GDB, the output from
readelf on the APR library ("readelf -a -W
/usr/local/apr/lib/libapr-1.so.0.2.12"), and a copy of network.c from Tomcat
6.0.16 (Apache's SVN appears to be down at the moment, so I can't post a link
to it).

The thread that causes the SIGSEGV is LWP 4187.

>From the GDB backtrace:
Thread 28 (Thread 1147427136 (LWP 4187)):
...
#5  <signal handler called>
#6  0x00002aab3c277ad4 in allocator_free (allocator=0x2aab40065af0, node=0x2)
at memory/unix/apr_pools.c:354
#7  0x00002aab3c27822a in apr_pool_destroy (pool=0x2aab407c17f8) at
memory/unix/apr_pools.c:798
#8  0x00002aab3c03856f in Java_org_apache_tomcat_jni_Socket_destroy
(e=0x2940998, o=0x446448d8, sock=46915009648744) at src/network.c:236

>From memory/unix/apr_pools.c, lines 350-354
350     /* Walk the list of submitted nodes and free them one by one,
351      * shoving them in the right 'size' buckets as we go.
352      */
353     do {
354         next = node->next;

Lines 795-798
795     /* Free all the nodes in the pool (including the node holding the
796      * pool struct), by giving them back to the allocator.
797      */
798     allocator_free(allocator, active);

>From Tomcat native, src/network.c, lines 227-236
227     apr_pool_cleanup_kill(s->pool, s, sp_socket_cleanup);
228     if (s->net && s->net->cleanup) {
229         (*s->net->cleanup)(s->opaque);
230         s->net = NULL;
231     }
232     if (as) {
233         apr_socket_close(as);
234     }
235 
236     apr_pool_destroy(s->pool);

I used diStorm to disassemble the instructions listed in the hotspot log file,
which resulted in:
      MOV RAX, [RBP-0x30]
PC--> MOV RAX, [RAX]
Where RAX=0x0000000000000002

If there is anything else I can provide, please let me know.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44875] Frequent SIGSEGV in apr_pool_destroy when shutting down Tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44875





--- Comment #8 from Bojan Smojver <bo...@rexursive.com>  2008-04-30 18:35:05 PST ---
> #6  0x00002aab3c277ad4 in allocator_free (allocator=0x2aab40065af0, node=0x2)
                                                                      ^^^^^^^^
Looks like something stomped over this. Maybe it's been freed already or
something...


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org