Skip to content

Commit

Permalink
[CBRD-24028] Segment fault occurs when connections increase rapidly (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
shparkcubrid committed Aug 27, 2021
1 parent d6808c1 commit a191b90
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/base/mem_block.hpp
Expand Up @@ -411,6 +411,8 @@ namespace cubmem
if (m_use_stack)
{
m_ext_block.extend_to (m_stack.SIZE + additional_bytes);
// copy data from m_stack to m_ext_block at first extension
memcpy (m_ext_block.get_ptr (), m_stack.get_ptr (), m_stack.SIZE);
}
else
{
Expand All @@ -428,7 +430,12 @@ namespace cubmem
return;
}
m_ext_block.extend_to (total_bytes);
m_use_stack = false;
if (m_use_stack)
{
// copy data from m_stack to m_ext_block at first extension
memcpy (m_ext_block.get_ptr (), m_stack.get_ptr (), m_stack.SIZE);
m_use_stack = false;
}
}

template <size_t S>
Expand Down

0 comments on commit a191b90

Please sign in to comment.