edisona / rcf-cpp

Automatically exported from code.google.com/p/rcf-cpp
1 stars 0 forks source link

When the server return a reference variable to client,the server collapsed #18

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make rcf1.0 to a dll and use it in program.
2. write a function and it has a reference type variable declaration.
3. When a client call that function then return a value to it of reference 
variable,but the server collapsed just this time.

What is the expected output? What do you see instead?
If use rcf lib in program on static library compiler mode, It will work 
very well, but the program link very slowly.

What version of the product are you using? On what operating system?
The rcf version is 1.0, The Operation system is Vista sp1

Please provide any additional information below.
The function callback trace:
0:001> k
ChildEBP RetAddr  
01d0d714 1047487e rcf10dll!_free_dbg_nolock+0x13e 
[f:\sp\vctools\crt_bld\self_x86\crt\src\dbgheap.c @ 1282]
01d0d74c 1046a6f7 rcf10dll!_free_dbg+0x4e [f:\sp\vctools\crt_bld\self_x86
\crt\src\dbgheap.c @ 1220]
01d0d788 1032be5c rcf10dll!operator delete+0xb7 
[f:\sp\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp @ 54]
01d0d86c 10342eac rcf10dll!
std::allocator<std::_Tree_nod<std::_Tmap_traits<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> >,0> 
>::_Node>::deallocate+0x2c [c:\program files\microsoft visual studio 8
\vc\include\xmemory @ 141]
01d0d960 1033b8d4 rcf10dll!std::_Tree<std::_Tmap_traits<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> >,0> 
>::_Erase+0x8c [c:\program files\microsoft visual studio 8
\vc\include\xtree @ 1079]
01d0da44 1032b447 rcf10dll!std::_Tree<std::_Tmap_traits<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> >,0> 
>::clear+0x44 [c:\program files\microsoft visual studio 8\vc\include\xtree 
@ 955]
01d0dba8 1030c20f rcf10dll!std::_Tree<std::_Tmap_traits<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> >,0> 
>::erase+0x167 [c:\program files\microsoft visual studio 8
\vc\include\xtree @ 921]
01d0dcf0 102d8691 rcf10dll!std::_Tree<std::_Tmap_traits<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> >,0> 
>::_Tidy+0x9f [c:\program files\microsoft visual studio 8\vc\include\xtree 
@ 1327]
01d0dde0 102a369b rcf10dll!std::_Tree<std::_Tmap_traits<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> >,0> 
>::~_Tree<std::_Tmap_traits<void *,void *,std::less<void 
*>,std::allocator<std::pair<void * const,void *> >,0> >+0x51 [c:\program 
files\microsoft visual studio 8\vc\include\xtree @ 527]
01d0dec0 1036666e rcf10dll!std::map<void *,void *,std::less<void 
*>,std::allocator<std::pair<void * const,void *> > >::~map<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> > >+0x2b
01d0dfa0 103660de rcf10dll!std::pair<type_info const * const,std::map<void 
*,void *,std::less<void *>,std::allocator<std::pair<void * const,void *> > 
> >::~pair<type_info const * const,std::map<void *,void *,std::less<void 
*>,std::allocator<std::pair<void * const,void *> > > >+0x2e
01d0e080 103657db rcf10dll!std::_Tree_nod<std::_Tmap_traits<type_info 
const *,std::map<void *,void *,std::less<void 
*>,std::allocator<std::pair<void * const,void *> > >,std::less<type_info 
const *>,std::allocator<std::pair<type_info const * const,std::map<void 
*,void *,std::less<void *>,std::allocator<std::pair<void * const,void *> > 
> > >,0> >::_Node::~_Node+0x2e
01d0e160 1035dac8 rcf10dll!std::_Tree_nod<std::_Tmap_traits<type_info 
const *,std::map<void *,void *,std::less<void 
*>,std::allocator<std::pair<void * const,void *> > >,std::less<type_info 
const *>,std::allocator<std::pair<type_info const * const,std::map<void 
*,void *,std::less<void *>,std::allocator<std::pair<void * const,void *> > 
> > >,0> >::_Node::`scalar deleting destructor'+0x2b
01d0e238 102ecf5c rcf10dll!
std::_Destroy<std::_Tree_nod<std::_Tmap_traits<type_info const 
*,std::map<void *,void *,std::less<void *>,std::allocator<std::pair<void * 
const,void *> > >,std::less<type_info const 
*>,std::allocator<std::pair<type_info const * const,std::map<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> > > > 
>,0> >::_Node>+0x28 [c:\program files\microsoft visual studio 8
\vc\include\xmemory @ 61]
01d0e31c 102b75bb rcf10dll!
std::allocator<std::_Tree_nod<std::_Tmap_traits<type_info const 
*,std::map<void *,void *,std::less<void *>,std::allocator<std::pair<void * 
const,void *> > >,std::less<type_info const 
*>,std::allocator<std::pair<type_info const * const,std::map<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> > > > 
>,0> >::_Node>::destroy+0x2c [c:\program files\microsoft visual studio 8
\vc\include\xmemory @ 161]
01d0e40c 1027f884 rcf10dll!std::_Tree<std::_Tmap_traits<type_info const 
*,std::map<void *,void *,std::less<void *>,std::allocator<std::pair<void * 
const,void *> > >,std::less<type_info const 
*>,std::allocator<std::pair<type_info const * const,std::map<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> > > > 
>,0> >::_Erase+0x7b [c:\program files\microsoft visual studio 8
\vc\include\xtree @ 1078]
01d0e4f0 1021af1b rcf10dll!std::_Tree<std::_Tmap_traits<type_info const 
*,std::map<void *,void *,std::less<void *>,std::allocator<std::pair<void * 
const,void *> > >,std::less<type_info const 
*>,std::allocator<std::pair<type_info const * const,std::map<void *,void 
*,std::less<void *>,std::allocator<std::pair<void * const,void *> > > > 
>,0> >::clear+0x44 [c:\program files\microsoft visual studio 8
\vc\include\xtree @ 955]
01d0e5d0 1021bb23 rcf10dll!RCF::PointerContext::clear+0x2b 
[d:\kat\3rdparty\rcf-1.0\include\rcf\serializationprotocol.hpp @ 59]
01d0e6b0 10212e48 rcf10dll!RCF::SerializationProtocolIn::clear+0x33 
[d:\kat\3rdparty\rcf-1.0\src\rcf\serializationprotocol.cpp @ 213]
01d0e9c8 1025d48e rcf10dll!RCF::RcfServer::onWriteCompleted+0x278 
[d:\kat\3rdparty\rcf-1.0\src\rcf\rcfserver.cpp @ 705]

Original issue reported on code.google.com by hndam...@hotmail.com on 22 Jun 2009 at 2:08

Attachments:

GoogleCodeExporter commented 9 years ago
When compiling RCF into a DLL, both the DLL and the modules that link to it, 
need to 
be dynamically linked to the compiler runtimes. E.g. with Visual C++, that 
means you 
need the /MD switch instead of /MT.

The reason is that RCF passes C++ objects across the DLL boundary (such as 
std::string), and to make memory management work in such a situation, both the 
DLL 
and its client need to link to the same compiler runtime.

If you require your modules to be statically linked, you'll need to compile 
RCF.cpp 
into each module.

Original comment by jarl.lin...@gmail.com on 25 Jun 2009 at 7:35

GoogleCodeExporter commented 9 years ago

Original comment by jarl.lin...@gmail.com on 11 Jul 2009 at 10:36