activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "omri zomet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQCPP-529) Crash in Threads due to small stack size (set to 32768 bytes)
Date Thu, 02 Jan 2014 07:24:51 GMT

    [ https://issues.apache.org/jira/browse/AMQCPP-529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13860063#comment-13860063
] 

omri zomet commented on AMQCPP-529:
-----------------------------------

The char[] allocation isn't in the AMQ-CPP library, but in the callback function onMessage()
of my MessageListener.
The array is of size 16384.
I can post a stack trace - however not sure it will help, as it simply crashes in one of the
sub-function being called (SIGSEGV).

If I declare a bigger array (say 200,000) in onMessage() itself - I get a crash on calling
onMessage() - see below:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2ce1b90 (LWP 6128)]
0x083c502a in CActiveMQClient::onMessage (this=0x8b5b5b0, message=<error reading variable>)
at ActiveMQClient.cpp:703
703     {


> Crash in Threads due to small stack size (set to 32768 bytes)
> -------------------------------------------------------------
>
>                 Key: AMQCPP-529
>                 URL: https://issues.apache.org/jira/browse/AMQCPP-529
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: Decaf
>    Affects Versions: 3.8.1
>         Environment: linux50
>            Reporter: omri zomet
>            Assignee: Timothy Bish
>            Priority: Critical
>
> Using version 3.8.1 of activemq-cpp (after using version 3.4.5) - we have suffered a
crash in code running in amq threads.
> Investigation shows that this happens when trying to use a char[] buffer on stack of
size > 16384 , probably due to the stack size being of size 32768.
> Thread::Thread() constructors call initializeSelf() with stackSize=(-1), which 
> in turn call createThreadInstance() with negative stackSize value (hence using PLATFORM_DEFAULT_STACK_SIZE).
> Relevant code below:
> ----------------------
>  #define PLATFORM_DEFAULT_STACK_SIZE 0x8000
> -----------------------
> void createThreadInstance(ThreadHandle* thread, long long stackSize, int  priority, bool
suspended, threadingTask threadMain, void* threadArg) {
>         if (stackSize <= 0) {
>             stackSize = PLATFORM_DEFAULT_STACK_SIZE;
>         }
> ...
> }
> ----------------------



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message