View unanswered posts | View active topics It is currently March 31st, 2017, 11:21 am



Reply to topic  [ 8 posts ] 
 TBBMM.dll and Server 2003 
Author Message

Joined: March 12th, 2009, 3:58 am
Posts: 5
Post TBBMM.dll and Server 2003
When I use TBBMM.DLL on Server 2003 service pack 1 it works fine. If I use it on Server 2003 service pack 2 it crashes.
Error from event log:
Faulting application CamPrintApp.exe, version 0.0.0.0, faulting module tbbmm.dll, version 2.1.2008.605, fault address 0x0000186b.

Any help would be appreciated.
Using C++Builder 5.


March 12th, 2009, 5:26 am
Profile
Site Admin

Joined: July 4th, 2008, 2:56 pm
Posts: 226
Post Re: TBBMM.dll and Server 2003
Sorry for the late reply.

Quote:
When I use TBBMM.DLL on Server 2003 service pack 1 it works fine. If I use it on Server 2003 service pack 2 it crashes.


TBH I haven't tried it on Server 2003. Is that specific to that particular app or is it consistently failing on all the apps you've built with tbbmm.dll? Have you identified the line that caused the fault to occur?


March 26th, 2009, 9:16 am
Profile

Joined: March 12th, 2009, 3:58 am
Posts: 5
Post Re: TBBMM.dll and Server 2003
This is the only application that uses tbmm.dll. Here is the stack when it throws EExternalException C000001D:
77E4BEE7 C:\WINDOWS\system32\kernel32.dll
004D66F7 System::_16583
7C828723 ntdll.dll
7C82855E ntdll.dll
32501E05 d:\workcell\camprintapp\CC3250MT.DLL
325012BC d:\workcell\camprintapp\CC3250MT.DLL
00414C53 std::allocator<SString>::deallocate(this=:0012F8A4, p=:7FF90100, =64)
00414B68 std::vector<SString, std::allocator<SString> >::~vector<SString, std::allocator<SString> >(this=:7FF67E78)
0047F129 SParsedLine::~SParsedLine(this=:7FF67E78)
004802F3 SParsedFile::Parse(this=:7FF47D60, StopAtDelimiter=3)
00470582 SParsedFile::Refresh(this=:7FF47D60, StopAtDelimiter=3)
004816F9 SIniFile::SIniFile(this=:7FF47D60, fname={ 4294967295, { }, { "CAMPrintService.ini" } }, AppendHeader={ 4294967295, { }, { "" } })
00404DE6 TFrmCamPrintApp::InteractIni(this=:7FF91D00, DoSave=false)
004077B8 TFrmCamPrintApp::btnStartThreadsClick(this=:7FF91D00, Sender=:7FF91D00)
00408808 TFrmCamPrintApp::FormShow(this=:7FF91D00, Sender=:7FF91D00)
004AD4B7 Forms::TCustomForm::DoShow
004BC328 Controls::TControl::WndProc
004ADBCB Forms::TCustomForm::WndProc
004BC16F Controls::TControl::Perform
004BE94C Controls::TWinControl::UpdateShowing
004BE9B7 Controls::TWinControl::UpdateControlState
004ADBCB Forms::TCustomForm::WndProc
004BC16F Controls::TControl::Perform
004BB0F1 Controls::TControl::SetVisible
00401323 WinMain( =:00400000, =NULL, =:001420CA, =9)
3257E14F d:\workcell\camprintapp\CC3250MT.DLL


March 31st, 2009, 4:31 am
Profile
Site Admin

Joined: July 4th, 2008, 2:56 pm
Posts: 226
Post Re: TBBMM.dll and Server 2003
From the stack trace, it doesn't look like the fault is caused by TBBMM. In fact, this almost seems like the infamous bug in all versions of BCB where objects are doubly-destroyed.

Before jumping to any conclusions though, could you compile a simple app with TBBMM and run it on Server 2k3?


April 1st, 2009, 3:24 pm
Profile

Joined: March 12th, 2009, 3:58 am
Posts: 5
Post Re: TBBMM.dll and Server 2003
I've not been able to replicate with any simple code, creating a thread, doing mallocs, news, frees, deletes, etc. I wouldn't point fingers at tbbmm.dll if the code didn't work with borlands default borlndmm.dll. When I simply replace your borlndmm.dll with the one from either borland or from fastmm, the application runs without problems.
To be fair, when I launch the application from the command line, it just hangs (with tbbmm.dll). The main form never shows, it just seems to hang. I need to go to task manager to kill it. To get the exception and the stack trace I ran it using remote debugger. I really really want to use tbbmm.dll because the performance is WAY better than Borlands and FastMM.
It runs fine on Server 2003 with SP1, but with SP2, not so good.


April 2nd, 2009, 1:22 am
Profile
Site Admin

Joined: July 4th, 2008, 2:56 pm
Posts: 226
Post Re: TBBMM.dll and Server 2003
Quote:
I wouldn't point fingers at tbbmm.dll if the code didn't work with borlands default borlndmm.dll.


This doesn't mean much really. Every memory manager allocates memory differently. For example, an invalid read from a memory address won't result in exception in one memory manager but will in another - simply because the read may end up in an invalid location in one and not in the other. Every memory manager chooses to allocate / return the free blocks (or not) to the OS differently.

Also, with the old borlndmm.dll (pre-BDS2006), you can destroy an object multiple times without causing an exception. The compiler is infamous for doing that - just check QC. Even with RAD Studio 2009, they're only starting to fix these compiler bugs. And even then, CB2009 with Update 2 is still unusable.

At this point, all I have to advice is, look at 00414C53 std::allocator<SString>::deallocate(this=:0012F8A4, p=:7FF90100, =64). Make sure you, or the compiler, is not causing std::alloator's deallocate to delete an object / memory which has already been deleted.

I've filed over 10 compiler bugs in CodeGear's QC site over the years and majority of them are related to the compiler doing multiple delete on objects in the stack following a handled exception (i.e. try-catch block). Passing objects into a static method with __fastcall modifier is also a problem. That's just to name a few.

I'd recommend anyone who works with C++ Builder to visit the CodeGear QC website regularly:
http://qc.embarcadero.com/wc/qcmain.aspx?da=728

Also if you're running tbbmm.dll on a fully multithreaded app, you're more likely to run into an error if you relied on the old memory manager for locking (most likely inadvertently) as tbbmm does NOT lock. Again, all of those are not the fault of tbbmm - if anything, it shows how flawed the compiler and the old memory manager (or in some cases, the code) really is.


April 2nd, 2009, 11:48 am
Profile

Joined: March 12th, 2009, 3:58 am
Posts: 5
Post Re: TBBMM.dll and Server 2003
That makes sense to me, I'll check into that. Thank-you for your reply.


April 3rd, 2009, 3:08 am
Profile
Site Admin

Joined: July 4th, 2008, 2:56 pm
Posts: 226
Post Re: TBBMM.dll and Server 2003
No worries. :)


April 5th, 2009, 12:46 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB.