thanks Aescleal
i add some code my test and finger out your point,
#include "test.h"
#include <string.h>
#include <stdio.h>
int test_t::get_xxxx(int count)
{
printf("in class:%p class size %d\n",this,sizeof(*this));
//printf("%p %d\n",&m_str,sizeof(m_str));
m_xxxx += count;
//m_str = "ddd";
return m_xxxx;
}
#include "test.h"
#include <stdio.h>
int main(int argc,char* argv[])
{
test_t test;
printf("in main:%p %d\n",&test,sizeof(test_t));
int count = test.get_xxxx(10);
printf ("%d \n",count);
return 0;
}
fist output:
in main:0xff896a74 8
in class:0xff896a74 class size 8
10
while adding m_str code and only recompiled shared lib,output:
in main:0xfff2f2d4 8
in class:0xfff2f2d4 class size 12
<big>0xfff2f2dc</big> 4
Segmentation fault
m_str is addr exceed test_t