[CS241] [CSCI2410] Possible Confirmation

Justin Palmer jwp at cs.brown.edu
Mon Dec 17 16:47:45 EST 2007


Yuri and I did a quick pass.  Our hack of an idea was to call delete on 
sp_parse_type.strip when we hit the end of our feature list.  Our print 
statements inside ec's ECTree destructor fired on every sentence, but it 
didn't stop the memory leak.

Hope you have better luck : /.  Sounds like your ideas are better, for 
sure.

On Mon, 17 Dec 2007, Skip wrote:

> On the memory leak:

The code in features.new expects the destructor for sp_sentence_type to
delete the field we added, sp_parse_type.strip.
extract_spfeatures uses only one sp_sentence_type instance, so this
destructor is only called once. Only the last stripped tree is deallocated.

Instead of creating a new sp_sentence_type for each sentence in the corpus,
sp_corpus_type.map_sentences keeps reading new sentences into the same
sp_sentence_type using sp_sentence_type.read.
sp_sentence_type.read deletes the pointers mark kept track of, but it
doesn't delete our strip tree.

It should be a fairly easy fix.  I'll try to have it out by 5 or so.

On Dec 17, 2007 2:23 AM, Joseph Browne <joseph.browne at yahoo.fr> wrote:

> Ok... We'll see what happens...  Thanks!
>
> ----- Message d'origine ----
> De : Lenora Huang <lenorah at cs.brown.edu>
> À : Joseph Browne <joseph_browne at brown.edu>
> Envoyé le : Lundi, 17 Décembre 2007, 2h06mn 35s
> Objet : RE: [CS241] [CSCI2410] Possible Confirmation
>
> ECTree::init(TREEFORM, STRIPFORM), stands for reading tree and writing
> strip.
>
> Yes. I think it's working. These 2 lines must be added to make ECTree
> start
> to work and then to hit the assertion Eugene fixed a few days ago. (If you
> haven't updated the file, stripRule.c)
> If you have updated the file, then you're very likely to get stuck where
> I'm
> stuck right now. No error messages but the program stops. Please try and
> tell me if you meet the same situation since I still have no ideas how to
> resolve or even debug this.
>
> Lenora
>
>
> -----Original Message-----
> From: Joseph Browne [mailto:joseph.browne at yahoo.fr]
> Sent: Monday, December 17, 2007 1:48 AM
> To: Lenora Huang
> Subject: Re : [CS241] [CSCI2410] Possible Confirmation
>
> Lenora:
>
> Hey, two questions:  1) have you already tried this and succeeded? 2) what
> arguments did you use?
>
> -Joseph
>
> ----- Message d'origine ----
> De : Lenora Huang <lenorah at cs.brown.edu>
> À : Joseph Browne <joseph_browne at brown.edu>; CSCI2410
> <cs241 at list.cs.brown.edu>
> Envoyé le : Lundi, 17 Décembre 2007, 1h42mn 44s
> Objet : RE: [CS241] [CSCI2410] Possible Confirmation
>
> Hi, Joseph.
> Yes, ECTree:init() and stripInit() have to be called before ECTree is
> used.
> I added these two lines right before fcps.extract_features() is called in
> main of extract_features.cc.
>
> Lenora
>
> -----Original Message-----
> From: cs241-bounces at list.cs.brown.edu
> [mailto:cs241-bounces at list.cs.brown.edu] On Behalf Of Joseph Browne
> Sent: Monday, December 17, 2007 1:21 AM
> To: CSCI2410
> Subject: [CS241] [CSCI2410] Possible Confirmation
>
> After another crash (someone logged me off) I was able to run the program
> again with debug flags on.  Looking at the following stack trace, it seems
> that the problem is indeed in makeECTree and that, more specifically, it
> has
> to do with Eugene's SymbolMap (I think it is a static object called gst)
> not
> being initialized correctly.  Look at the function call for the third
> frame
> -- toIndex() is being called on a null pointer...
>
> #0  0x0804ae44 in std::_Rb_tree<std::string, std::pair<std::string const,
> unsigned int>, std::_Select1st<std::pair<std::string const, unsigned int>
> >,
> std::less<std::string>, std::allocator<std::pair<std::string const,
> unsigned
> int> > >::_M_begin (this=0x8)
>    at
>
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_tre
> e.h:466
> #1  0x0804b2e5 in std::_Rb_tree<std::string, std::pair<std::string const,
> unsigned int>, std::_Select1st<std::pair<std::string const, unsigned int>
> >,
> std::less<std::string>, std::allocator<std::pair<std::string const,
> unsigned
> int> > >::find (this=0x8, __k=@0xbfc16584)
>    at
>
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_tre
> e.h:1313
> #2  0x0804b405 in std::map<std::string, unsigned int,
> std::less<std::string>, std::allocator<std::pair<std::string const,
> unsigned
> int> > >::find (this=0x8, __x=@0xbfc16584) at
>
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_map
> .h:534
> #3  0x0804d0f4 in SymbolTable::toIndex (this=0x0, s=@0xbfc16584) at
> SymbolTable.h:36
> #4  0x08095f18 in makeECTree (other=0xb7c92350) at ECTree.C:390
>
> I am going to try to make an addition by modifiying extract-spfeatures.ccto
> initialize Eugene's Tree by calling ECTree::init(false, false) in the main
> function... we will see if this helps.
>
> -Joseph
>
>
>
>
> ____________________________________________________________________________
> _
> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
> Mail
> http://mail.yahoo.fr
> _______________________________________________
> CS241 mailing list
> CS241 at list.cs.brown.edu
> http://list.cs.brown.edu/mailman/listinfo/cs241
>
> _______________________________________________
> CS241 mailing list
> CS241 at list.cs.brown.edu
> http://list.cs.brown.edu/mailman/listinfo/cs241
>
>
>
>
> ____________________________________________________________________________
> _
> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
> Mail
> http://mail.yahoo.fr
>
>
>
>  _____________________________________________________________________________
> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
> Mail http://mail.yahoo.fr
> _______________________________________________
> CS241 mailing list
> CS241 at list.cs.brown.edu
> http://list.cs.brown.edu/mailman/listinfo/cs241
>


More information about the CS241 mailing list