Bug 283374 (alloca) - monitoring alloca calls
Summary: monitoring alloca calls
Status: RESOLVED DUPLICATE of bug 206618
Alias: alloca
Product: valgrind
Classification: Developer tools
Component: sgcheck (other bugs)
Version First Reported In: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-05 07:32 UTC by Zohar Gofer
Modified: 2012-08-10 14:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zohar Gofer 2011-10-05 07:32:25 UTC
Code like this:

int mvCmp(unsigned char* a_pKey1, unsigned char* a_pKey2, size_t a_iSize) const
{
  void* str1 = alloca(a_iSize);
  void* str2 = alloca(a_iSize);

  memcpy(str1, a_pKey1, a_iSize);
  memcpy(str2, a_pKey2, a_iSize);
...
}

Generates a false error of: Invalid write of size 4
and comment that: Address 0x22003700 is not derived from any known block
and suppression like this:
{
   <insert_a_suppression_name_here>
   exp-ptrcheck:Heap
   fun:memcpy
...
}

This means that ptrcheck thinks that memory is allocated on the heap instead of the stack. alloca calls should add the memory allocated to the stack analysis.
Comment 1 Tom Hughes 2011-10-05 07:41:59 UTC

*** This bug has been marked as a duplicate of bug 206618 ***