You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Kevin Quick (JIRA)" <ji...@apache.org> on 2010/07/16 21:01:51 UTC

[jira] Created: (AMQCPP-304) SEGFAULT on shutdown

SEGFAULT on shutdown
--------------------

                 Key: AMQCPP-304
                 URL: https://issues.apache.org/activemq/browse/AMQCPP-304
             Project: ActiveMQ C++ Client
          Issue Type: Bug
          Components: CMS Impl
    Affects Versions: 3.2.1
         Environment: Linux
            Reporter: Kevin Quick
            Assignee: Timothy Bish


If application does not initialize (or use) ActiveMQ-CPP before exiting, global static elements will call apr functionality without initialization of same, resulting in a segfault.

Similar issue to AMQCPP-303.  This global static element is:

   activemq/commands/ActiveMQDestination.cpp:
   ...
   util::ActiveMQProperties options;


Test file (mqtest.cpp):

   #include <iostream>

   // Normally comes from library include: explicit here facilitate problem demonstration
   #include <activemq/commands/ActiveMQDestination.cpp>

   int main(int, char**)
   {
     std::cout << "Hello" << std::endl;
   }

To reproduce:

$ gdb mqtest
...
(gdb) r
Starting program: /Mount/Work/per_mbus/persephone_trunk/pjs/nexus_handlers/mbus/mqtest 
[Thread debugging using libthread_db enabled]
Hello

Program received signal SIGSEGV, Segmentation fault.
0x080c0835 in mutex_hash (mem=0x80e386c) at atomic/unix/mutex.c:78
78          apr_thread_mutex_t *mutex = hash_mutex[ATOMIC_HASH(mem)];
Current language:  auto
The current source language is "auto; currently c".
(gdb) bt
#0  0x080c0835 in mutex_hash (mem=0x80e386c) at atomic/unix/mutex.c:78
#1  0x080c0864 in apr_atomic_add32 (mem=0x80e386c, val=4294967295) at atomic/unix/mutex.c:113
#2  0x0808630c in decaf::util::concurrent::atomic::AtomicInteger::decrementAndGet (this=0x80e3868) at decaf/util/concurrent/atomic/AtomicInteger.cpp:69
#3  0x08056e86 in decaf::util::concurrent::atomic::AtomicRefCounter::release (this=0x80e285c)
    at /Files/Compile/Sources/activemq-cpp-library-3.2.1/src/main/decaf/util/concurrent/atomic/AtomicRefCounter.h:68
#4  0x0808450d in ~Pointer (this=0x80e285c, __in_chrg=<value optimized out>) at ./decaf/lang/Pointer.h:143
#5  0x0808151e in ~Properties (this=0x80e2854, __in_chrg=<value optimized out>) at decaf/util/Properties.cpp:133
#6  0x0805cae1 in ~ActiveMQProperties (this=0x80e2850, __in_chrg=<value optimized out>) at activemq/util/ActiveMQProperties.cpp:31
#7  0x08054c00 in __tcf_17 () at /Files/Compile/Sources/activemq-cpp-library-3.2.1/src/main/activemq/commands/ActiveMQDestination.cpp:59
#8  0xb7b2b529 in exit () from /System/Links/Libraries/libc.so.6
(gdb) 


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQCPP-304) SEGFAULT on shutdown

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish resolved AMQCPP-304.
---------------------------------

    Resolution: Fixed

Removed those global variables, not sure why they were there anyway.

> SEGFAULT on shutdown
> --------------------
>
>                 Key: AMQCPP-304
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-304
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl
>    Affects Versions: 3.2.1
>         Environment: Linux
>            Reporter: Kevin Quick
>            Assignee: Timothy Bish
>
> If application does not initialize (or use) ActiveMQ-CPP before exiting, global static elements will call apr functionality without initialization of same, resulting in a segfault.
> Similar issue to AMQCPP-303.  This global static element is:
>    activemq/commands/ActiveMQDestination.cpp:
>    ...
>    util::ActiveMQProperties options;
> Test file (mqtest.cpp):
>    #include <iostream>
>    // Normally comes from library include: explicit here facilitate problem demonstration
>    #include <activemq/commands/ActiveMQDestination.cpp>
>    int main(int, char**)
>    {
>      std::cout << "Hello" << std::endl;
>    }
> To reproduce:
> $ gdb mqtest
> ...
> (gdb) r
> Starting program: /Mount/Work/per_mbus/persephone_trunk/pjs/nexus_handlers/mbus/mqtest 
> [Thread debugging using libthread_db enabled]
> Hello
> Program received signal SIGSEGV, Segmentation fault.
> 0x080c0835 in mutex_hash (mem=0x80e386c) at atomic/unix/mutex.c:78
> 78          apr_thread_mutex_t *mutex = hash_mutex[ATOMIC_HASH(mem)];
> Current language:  auto
> The current source language is "auto; currently c".
> (gdb) bt
> #0  0x080c0835 in mutex_hash (mem=0x80e386c) at atomic/unix/mutex.c:78
> #1  0x080c0864 in apr_atomic_add32 (mem=0x80e386c, val=4294967295) at atomic/unix/mutex.c:113
> #2  0x0808630c in decaf::util::concurrent::atomic::AtomicInteger::decrementAndGet (this=0x80e3868) at decaf/util/concurrent/atomic/AtomicInteger.cpp:69
> #3  0x08056e86 in decaf::util::concurrent::atomic::AtomicRefCounter::release (this=0x80e285c)
>     at /Files/Compile/Sources/activemq-cpp-library-3.2.1/src/main/decaf/util/concurrent/atomic/AtomicRefCounter.h:68
> #4  0x0808450d in ~Pointer (this=0x80e285c, __in_chrg=<value optimized out>) at ./decaf/lang/Pointer.h:143
> #5  0x0808151e in ~Properties (this=0x80e2854, __in_chrg=<value optimized out>) at decaf/util/Properties.cpp:133
> #6  0x0805cae1 in ~ActiveMQProperties (this=0x80e2850, __in_chrg=<value optimized out>) at activemq/util/ActiveMQProperties.cpp:31
> #7  0x08054c00 in __tcf_17 () at /Files/Compile/Sources/activemq-cpp-library-3.2.1/src/main/activemq/commands/ActiveMQDestination.cpp:59
> #8  0xb7b2b529 in exit () from /System/Links/Libraries/libc.so.6
> (gdb) 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-304) SEGFAULT on shutdown

Posted by "Kevin Quick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60709#action_60709 ] 

Kevin Quick commented on AMQCPP-304:
------------------------------------

Examples:

Cmdline argument parsing (e.g. getopt) detects an error: application exits rather than attempting to do anything with bad input.

User requests a help/usage on the command line (e.g. --help).  Application displays help information, then exits without doing anything else.

etc...


> SEGFAULT on shutdown
> --------------------
>
>                 Key: AMQCPP-304
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-304
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl
>    Affects Versions: 3.2.1
>         Environment: Linux
>            Reporter: Kevin Quick
>            Assignee: Timothy Bish
>
> If application does not initialize (or use) ActiveMQ-CPP before exiting, global static elements will call apr functionality without initialization of same, resulting in a segfault.
> Similar issue to AMQCPP-303.  This global static element is:
>    activemq/commands/ActiveMQDestination.cpp:
>    ...
>    util::ActiveMQProperties options;
> Test file (mqtest.cpp):
>    #include <iostream>
>    // Normally comes from library include: explicit here facilitate problem demonstration
>    #include <activemq/commands/ActiveMQDestination.cpp>
>    int main(int, char**)
>    {
>      std::cout << "Hello" << std::endl;
>    }
> To reproduce:
> $ gdb mqtest
> ...
> (gdb) r
> Starting program: /Mount/Work/per_mbus/persephone_trunk/pjs/nexus_handlers/mbus/mqtest 
> [Thread debugging using libthread_db enabled]
> Hello
> Program received signal SIGSEGV, Segmentation fault.
> 0x080c0835 in mutex_hash (mem=0x80e386c) at atomic/unix/mutex.c:78
> 78          apr_thread_mutex_t *mutex = hash_mutex[ATOMIC_HASH(mem)];
> Current language:  auto
> The current source language is "auto; currently c".
> (gdb) bt
> #0  0x080c0835 in mutex_hash (mem=0x80e386c) at atomic/unix/mutex.c:78
> #1  0x080c0864 in apr_atomic_add32 (mem=0x80e386c, val=4294967295) at atomic/unix/mutex.c:113
> #2  0x0808630c in decaf::util::concurrent::atomic::AtomicInteger::decrementAndGet (this=0x80e3868) at decaf/util/concurrent/atomic/AtomicInteger.cpp:69
> #3  0x08056e86 in decaf::util::concurrent::atomic::AtomicRefCounter::release (this=0x80e285c)
>     at /Files/Compile/Sources/activemq-cpp-library-3.2.1/src/main/decaf/util/concurrent/atomic/AtomicRefCounter.h:68
> #4  0x0808450d in ~Pointer (this=0x80e285c, __in_chrg=<value optimized out>) at ./decaf/lang/Pointer.h:143
> #5  0x0808151e in ~Properties (this=0x80e2854, __in_chrg=<value optimized out>) at decaf/util/Properties.cpp:133
> #6  0x0805cae1 in ~ActiveMQProperties (this=0x80e2850, __in_chrg=<value optimized out>) at activemq/util/ActiveMQProperties.cpp:31
> #7  0x08054c00 in __tcf_17 () at /Files/Compile/Sources/activemq-cpp-library-3.2.1/src/main/activemq/commands/ActiveMQDestination.cpp:59
> #8  0xb7b2b529 in exit () from /System/Links/Libraries/libc.so.6
> (gdb) 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-304) SEGFAULT on shutdown

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60706#action_60706 ] 

Timothy Bish commented on AMQCPP-304:
-------------------------------------

Why would you link to the AMQCPP code and then not use it?

> SEGFAULT on shutdown
> --------------------
>
>                 Key: AMQCPP-304
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-304
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl
>    Affects Versions: 3.2.1
>         Environment: Linux
>            Reporter: Kevin Quick
>            Assignee: Timothy Bish
>
> If application does not initialize (or use) ActiveMQ-CPP before exiting, global static elements will call apr functionality without initialization of same, resulting in a segfault.
> Similar issue to AMQCPP-303.  This global static element is:
>    activemq/commands/ActiveMQDestination.cpp:
>    ...
>    util::ActiveMQProperties options;
> Test file (mqtest.cpp):
>    #include <iostream>
>    // Normally comes from library include: explicit here facilitate problem demonstration
>    #include <activemq/commands/ActiveMQDestination.cpp>
>    int main(int, char**)
>    {
>      std::cout << "Hello" << std::endl;
>    }
> To reproduce:
> $ gdb mqtest
> ...
> (gdb) r
> Starting program: /Mount/Work/per_mbus/persephone_trunk/pjs/nexus_handlers/mbus/mqtest 
> [Thread debugging using libthread_db enabled]
> Hello
> Program received signal SIGSEGV, Segmentation fault.
> 0x080c0835 in mutex_hash (mem=0x80e386c) at atomic/unix/mutex.c:78
> 78          apr_thread_mutex_t *mutex = hash_mutex[ATOMIC_HASH(mem)];
> Current language:  auto
> The current source language is "auto; currently c".
> (gdb) bt
> #0  0x080c0835 in mutex_hash (mem=0x80e386c) at atomic/unix/mutex.c:78
> #1  0x080c0864 in apr_atomic_add32 (mem=0x80e386c, val=4294967295) at atomic/unix/mutex.c:113
> #2  0x0808630c in decaf::util::concurrent::atomic::AtomicInteger::decrementAndGet (this=0x80e3868) at decaf/util/concurrent/atomic/AtomicInteger.cpp:69
> #3  0x08056e86 in decaf::util::concurrent::atomic::AtomicRefCounter::release (this=0x80e285c)
>     at /Files/Compile/Sources/activemq-cpp-library-3.2.1/src/main/decaf/util/concurrent/atomic/AtomicRefCounter.h:68
> #4  0x0808450d in ~Pointer (this=0x80e285c, __in_chrg=<value optimized out>) at ./decaf/lang/Pointer.h:143
> #5  0x0808151e in ~Properties (this=0x80e2854, __in_chrg=<value optimized out>) at decaf/util/Properties.cpp:133
> #6  0x0805cae1 in ~ActiveMQProperties (this=0x80e2850, __in_chrg=<value optimized out>) at activemq/util/ActiveMQProperties.cpp:31
> #7  0x08054c00 in __tcf_17 () at /Files/Compile/Sources/activemq-cpp-library-3.2.1/src/main/activemq/commands/ActiveMQDestination.cpp:59
> #8  0xb7b2b529 in exit () from /System/Links/Libraries/libc.so.6
> (gdb) 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.