Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-23-2005
stephan stephan is offline
Registered User
 
Name: Stephan Stapel
Organization: Stephan Stapel
Project: BristolNG
 
Join Date: Oct 2003
Location: Essen, Germany
Posts: 169
Mismatched memory question

Good evening,

I downloaded the purify trial and ran it on one of my applications and it discovered lots of "freeing mismatched memory" problems. I have no idea how severe this message really is but could you please give a statement on that and whether it will be fixed in upcoming version?!

regs,

Stephan

Here goes the output of purify:

[i] Starting Purify'd e:\develop\adaxis\aaclient\Release\aaclient.exe at 23.03.2005 21:52:43
[i] Starting main
[E] FMM: Freeing mismatched memory in delete(void *) {3 occurrences}
Address 0x01e93c98 points into a malloc'd block in heap 0x01b40000
Location of free attempt
delete(void *) [.\build\intel\dll_obj\longjmp.obj:23]
Ice::argsToStringSeq(int,char * * const) [C:\WINDOWS\system32\ice21.dll]
_except_list [e:\develop\adaxis\aaclient\Release\aaclient.exe]
Allocation location
malloc [F:\VS70Builds\3052\vc\crtbld\crt\src\intel\memset. asm:53]
Ice::ObjectWriter::__write(BasicStream::IceInterna l *)const [C:\WINDOWS\system32\ice21.dll]
IceInternal::IncomingBase::__warning(Exception::Ic eUtil const&)const [C:\WINDOWS\system32\ice21.dll]
_except_list [e:\develop\adaxis\aaclient\Release\aaclient.exe]
[E] FMM: Freeing mismatched memory in delete(void *) {18 occurrences}
Address 0x01e94ce8 points into a malloc'd block in heap 0x01b40000
Location of free attempt
delete(void *) [.\build\intel\dll_obj\longjmp.obj:23]
Ice::PropertiesI:arseCommandLineOptions(basic_st ring<char,char_traits<char>::std,allocator<char>:: std>::std const&,vector<basic_string<char,char_traits<char>: :std,allocator<char>::std>::std,allocator<basic_st ring<char,char_traits<char>::std,allocator<char>:: std>::std>::std>::std const&) [C:\WINDOWS\system32\ice21.dll]
_except_list [e:\develop\adaxis\aaclient\Release\aaclient.exe]
Allocation location
malloc [F:\VS70Builds\3052\vc\crtbld\crt\src\intel\memset. asm:53]
Ice::ObjectWriter::__write(BasicStream::IceInterna l *)const [C:\WINDOWS\system32\ice21.dll]
IceInternal::IncomingBase::__warning(Exception::Ic eUtil const&)const [C:\WINDOWS\system32\ice21.dll]
_except_list [e:\develop\adaxis\aaclient\Release\aaclient.exe]
[E] FMM: Freeing mismatched memory in delete(void *) {12 occurrences}
[E] FMM: Freeing mismatched memory in delete(void *) {1 occurrence}
[E] FMM: Freeing mismatched memory in delete(void *) {12 occurrences}
[E] FMM: Freeing mismatched memory in delete(void *) {1 occurrence}
[E] FMM: Freeing mismatched memory in delete(void *) {1 occurrence}
[E] FMM: Freeing mismatched memory in Ice::==(Plugin::Ice const&,Plugin::Ice const&) {1 occurrence}
[E] FMM: Freeing mismatched memory in Ice::==(Plugin::Ice const&,Plugin::Ice const&) {1 occurrence}
[E] FMM: Freeing mismatched memory in delete(void *) {1 occurrence}
[i] Program terminated at 23.03.2005 21:52:59
Reply With Quote
  #2 (permalink)  
Old 03-23-2005
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 813
I've also seen all these FMMs in release builds.

I think it's because Purify needs debug info to work properly. Do you get these FMMs with a debug build? You could also try your own release build of Ice with debug info (in pdb files, i.e. with /Zi) ... we will consider making this the default.

Cheers,
Bernard
Reply With Quote
  #3 (permalink)  
Old 03-23-2005
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 907
Which compiler is this? VC++ 6 or .NET?

The reports are almost certainly bogus. Last time I purified, the code ran clean (but that was probably with a debug build). However, since we are not doing anything different with respect to memory management for debug and release builds, if it purifies cleanly in debug mode, it should purify cleanly in release mode.

Cheers,

Michi.
Reply With Quote
  #4 (permalink)  
Old 03-25-2005
stephan stephan is offline
Registered User
 
Name: Stephan Stapel
Organization: Stephan Stapel
Project: BristolNG
 
Join Date: Oct 2003
Location: Essen, Germany
Posts: 169
Hi again!

I ran Purify on the debug version of the application as you suggested.

However, I still find FMM messages and they are not fewer :(

Do you see a possible impact on application stability?

regs,

Stephan



[i] Starting Purify'd e:\develop\adaxis\aaclient\debug\aaclient.exe at 24.03.2005 18:40:13
[i] Starting main
[E] FMM: Freeing mismatched memory in delete(void *) {1 occurrence}
[E] FMM: Freeing mismatched memory in delete(void *) {1 occurrence}
[E] FMM: Freeing mismatched memory in delete(void *) {3 occurrences}
[E] FMM: Freeing mismatched memory in delete(void *) {1 occurrence}
Address 0x02496e80 points into a malloc'd block in heap 0x02400000
Location of free attempt
delete(void *) [f:\vs70builds\3077\vc\crtbld\crt\src\dbgdel.cpp:37]
startHook [c:\builds\ice\src\iceutil\thread.cpp:203]
threadstartex [f:\vs70builds\3077\vc\crtbld\crt\src\threadex.c:24 1]
Allocation location
malloc [f:\vs70builds\3077\vc\crtbld\crt\src\dbgheap.c:138]
startHook [c:\builds\ice\src\iceutil\thread.cpp:203]
threadstartex [f:\vs70builds\3077\vc\crtbld\crt\src\threadex.c:24 1]
[i] EXH: Handled exception in IceInternal::doConnect(UINT,sockaddr_in&,int) {19 occurrences}
[i] EXI: Ignored exception in Ice::ConnectionRefusedException::ice_throw(void)co nst {15 occurrences}
[i] EXH: Handled exception in Ice::ConnectionRefusedException::ice_throw(void)co nst {15 occurrences}
[i] EXI: Ignored exception in Ice::ConnectionRefusedException::ice_throw(void)co nst {10 occurrences}
[E] FMM: Freeing mismatched memory in delete(void *) {10 occurrences}
Address 0x024991f8 points into a malloc'd block in heap 0x02400000
Location of free attempt
delete(void *) [f:\vs70builds\3077\vc\crtbld\crt\src\dbgdel.cpp:37]
?std@@@std@@QAEXPAU_Node@?$_Tree_nod@V?$_Tmap_trai ts@V?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$cha r_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$alloc ator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D @std@@V?$allocator@D@2@@std@@V12@@std@@@2@$0A@@std @@@2@I@Z [d:\msdev2003\vc7\include\xmemory.:132]
std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,0> >::_Tidy(void) [d:\msdev2003\vc7\include\xtree.:1147]
std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,0> >::~_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<ch [d:\msdev2003\vc7\include\xtree.:392]
?2@@std@@QAE@XZ [e:\develop\adaxis\aaclient\debug\aaclient.exe]
Ice::Current::~Current(void) [e:\develop\adaxis\aaclient\debug\aaclient.exe]
IceDelegateD::adaxis::CAAClient::timeout(map<basic _string<char,char_traits<char>::std,allocator<char >::std>::std,basic_string<char,char_traits<char>:: std,allocator<char>::std>::std,less<basic_string<c har,char_traits<char>::std,allocator<char>::std>:: std>::std,allocator<pair<>::BV?$basic_string::DU?$ char_traits::D::std,allocator<char>::BV?$basic_str ing>::std,basic_string<char,char_traits<char>::std ,allocator<char>::std>::std>::std const&) [e:\develop\adaxis\interfaces\caaclient.cpp:1408]
IceProxy::adaxis::CAAClient::timeout(map<basic_str ing<char,char_traits<char>::std,allocator<char>::s td>::std,basic_string<char,char_traits<char>::std, allocator<char>::std>::std,less<basic_string<char, char_traits<char>::std,allocator<char>::std>::std> ::std,allocator<pair<>::BV?$basic_string::DU?$char _traits::D::std,allocator<char>::BV?$basic_string> ::std,basic_string<char,char_traits<char>::std,all ocator<char>::std>::std>::std const&) [e:\develop\adaxis\interfaces\caaclient.cpp:620]
IceProxy::adaxis::CAAClient::timeout(void) [e:\develop\adaxis\interfaces\caaclient.cpp:607]
CGeneralTimeoutThread::extRun(void) [e:\develop\adaxis\aaclient\cgeneraltimeoutthread.c pp:64]
Allocation location
malloc [f:\vs70builds\3077\vc\crtbld\crt\src\dbgheap.c:138]
startHook [c:\builds\ice\src\iceutil\thread.cpp:203]
threadstartex [f:\vs70builds\3077\vc\crtbld\crt\src\threadex.c:24 1]
[i] EXI: Ignored exception in Ice::ConnectionRefusedException::ice_throw(void)co nst {4 occurrences}
[i] EXH: Handled exception in Ice::ConnectionRefusedException::ice_throw(void)co nst {4 occurrences}
Reply With Quote
  #5 (permalink)  
Old 03-25-2005
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 813
Again, user error

I've just purified the operations test:
- latest Ice, debug build
- Visual Studio 2003
- Windows XP SP2
- Purify 2003.06.13.402.000 Build: 5352 (latest AFAIK)

With a normal build, I get thousands of FMMs; however Purify tells me what to do:

C:\builds\ice\test\Ice\operations>purify server
Purify for Windows,
(C) Copyright IBM Corporation. 1992, 2004. All Rights Reserved.
Version 2003.06.03; Build: 5352;
WinNT 5.1 2600 Service Pack 2 Uniprocessor Free
Instrumenting:
server.EXE 507904 bytes

Purify: While processing file C:\builds\ice\test\Ice\operations\server.EXE:
Warning: Code detected but missing .reloc section.
Unable to instrument module as requested.
Module will be instrumented in Minimal mode.
For VC, use /FIXED:NO linker option.


"Minimal mode" means trouble.
I add /FIXED:NO and relink the exes, et voila, clean Purify runs

Please continue to purify Ice! If you find any problem, giving us a test-case (or an existing Ice demo / test program) would be very useful.

Cheers,
Bernard
Reply With Quote
  #6 (permalink)  
Old 03-26-2005
stephan stephan is offline
Registered User
 
Name: Stephan Stapel
Organization: Stephan Stapel
Project: BristolNG
 
Join Date: Oct 2003
Location: Essen, Germany
Posts: 169
Hi Bernard,

thanks for the hint. I switch on (resp. off) the fixed parameter and I get no fmm errors in the debug version (against one remaining in the release version).

Can you please tell me if "fixed:no" results in a cosmetic correction (no stop purify throwing error messages) or whether it really improves the safety of the program?

If it's the latter one, will you include this parameter in the Visual C++ settings corner in the readme?

Stephan
Reply With Quote
  #7 (permalink)  
Old 03-28-2005
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 813
Hi Stephan,

The issue is whether Purify is able to instrument the libraries linked with your .exe or not. If it cannot, it will report bogus FMMs; if it can, it figures out that there is no mismatched memory.
I think it's a Purify-only requirement: the exes are not safer with /FIXED:NO.

We will look into making the default builds more Purify-friendly.

Bernard
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about memory limit in Ice. ehero Help Center 3 06-28-2005 11:35 AM
A question about decrease memory laotee Help Center 5 06-27-2005 06:25 AM
a question about memory laotee Help Center 8 06-22-2005 11:17 PM
question about memory mgmt Baloo Help Center 2 10-01-2004 07:02 PM
In-memory IceStorm vukicevic Patches 2 01-20-2004 08:56 PM


All times are GMT -4. The time now is 06:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.