Paul fixed this for me Friday afternoon.  I was being over-zealous in
trying to avoid leaks.

Carolyn 

> -----Original Message-----
> From: Lawrence, Scott (BL60:9D30) 
> Sent: Monday, September 22, 2008 10:38 AM
> To: Beeton, Carolyn (CAR:9D60)
> Cc: sipx-dev
> Subject: Re: [sipX-dev] 13467 broke the supervisor
> 
> 
> On Fri, 2008-09-19 at 12:57 -0400, Carolyn Beeton wrote:
> > I don't quite understand how, but I think sipXsupervisor 
> was broken by
> > 13467 (add short title to email notifications).  I am now getting
> > segfaults:
> > 
> > #0  0x00002ba261963f43 in free () from /lib64/libc.so.6
> > #1  0x00002ba25fef9982 in UtlList::destroyAll (this=0x408054a0) at 
> > ../../../sipXportLib/src/utl/UtlList.cpp:160
> > #2  0x0000000000427c7d in EmailNotifier::handleAlarm 
> (this=0x1430e00, 
> > [EMAIL PROTECTED], [EMAIL PROTECTED],
> > 
> >     alarmData=0x14381c0, [EMAIL PROTECTED]) at 
> > ../../../sipXsupervisor/src/EmailNotifier.cpp:113
> > 
> > I don't understand why the destroyAll causes a segfault.  A 
> quick fix 
> > (remove the line to destroyAll) is attached, but then is there a 
> > memory leak?...
> 
> Sorry - I should have caught this reviewing the code:
> 
>    UtlSList subjectParams;
>    UtlString codeStr(alarmData->getCode());
>    UtlString titleStr(alarmData->getShortTitle());
>    subjectParams.append(&codeStr);
>    subjectParams.append(&titleStr);
>    assembleMsg(mEmailStrSubject, subjectParams, tempStr);
>                message.Subject(tempStr);
>    subjectParams.destroyAll();
> 
> You're putting pointers to local variables (codeStr and 
> titleStr) into the subjectParams list and then calling 
> destroyAll on the list, which calls 'delete' on each item on 
> the list - a no-no since they were not created with 'new'.  
> 
> You could either change that destroyAll to a removeAll or 
> just not do anything - the subjectParams list will be cleaned 
> up in exactly that way anyway when it goes out of scope.
> 
> 
> 
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev

Reply via email to