Juergen, you asked for it :)

Some problems with tabular found why testing with purify (most of
these were not found by purify, but visual inspection)

I loaded the user guide and went to the table in 3.1.2.3.

- actrow is not initialized in InsetTabular constructor (found by purify)

- in the first column, which has a double line on the right, the line
  turns to a single one when you edit a cell.

- typing in cells is awfully slow. This is probably worse due to
  purify overhead, but I do not see a slowness when typing in a normal
  paragraph. I suspect something wrong happens here (does anybody
  knows how to use quantify?).

- if I select the two first cells of a column and then do 'remove
  column', the selection gets confused. This does not seem to happen
  when I select only one cell.

- after doing that (I do not know what triggers the problem exactly,
  but I also used undo/redo), cells keep the red box around them after
  the cursor is put in another one (I get several red boxes in the
  table).

- another UMR I could not track down (see appended trace). I get
  several of these, but they seem to come from the same reason.

      UMR: Uninitialized memory read (60 times)
      This is occurring while in:
            LyXCursor::pos()const [lyxcursor.C:47]
               LyXParagraph::size_type LyXCursor::pos() const
               {
                       return pos_;
            => }
               
               
               void LyXCursor::boundary(bool b) 
            update__9InsetTextP10BufferViewRC7LyXFontb [insettext.C:425]
                   if (oldw != insetWidth) {
               //          printf("TW(%p): %d-%d-%d-%d\n",this,insetWidth, oldw,
               //                 
textWidth(bv->painter()),static_cast<int>(TEXT(bv)->width));
            =>         resizeLyXText(bv);
                       need_update = FULL;
               #if 0
                       if (owner()) {
            update__12InsetTabularP10BufferViewRC7LyXFontb [insettabular.C:400]
            LyXText::SingleWidth(BufferView*,LyXParagraph*,int,char)const [text.C:183]
            LyXText::NextBreakPoint(BufferView*,const Row*,int)const [text.C:1059]
            LyXText::BreakAgain(BufferView*,Row*)const [text.C:1633]
            LyXText::CheckParagraph(BufferView*,LyXParagraph*,int) [text2.C:2688]
            LyXText::UpdateInset(BufferView*,Inset*) [text2.C:2749]
            updateInset__10BufferViewP5Insetb [BufferView2.C:812]
            UpdateLocal__C12InsetTabularP10BufferViewQ212InsetTabular11UpdateCodesb 
[insettabular.C:481]
      Reading 4 bytes from 0xd5e638 in the heap.
      Address 0xd5e638 is 216 bytes into a malloc'd block at 0xd5e560 of 420 bytes.
      This block was allocated from:
            malloc         [rtlib.o]
            __bUiLtIn_nEw  [libgcc.a]
            __builtin_new  [rtlib.o]
            InsetText::getLyXText(BufferView*)const [insettext.C:1501]
               {
                   if ((cache.find(bv) != cache.end()) && cache[bv])
                       return cache[bv];
            =>     LyXText * lt = new LyXText(const_cast<InsetText *>(this));
                   lt->init(bv);
                   cache[bv] = lt;
                   if (the_locking_inset) {
            InsetText::resizeLyXText(BufferView*)const [insettext.h:236]
            update__9InsetTextP10BufferViewRC7LyXFontb [insettext.C:406]
            calculate_dimensions_of_cells__C12InsetTabularP10BufferViewRC7LyXFontb 
[insettabular.C:975]
            update__12InsetTabularP10BufferViewRC7LyXFontb [insettabular.C:409]
            LyXText::SingleWidth(BufferView*,LyXParagraph*,int,char)const [text.C:183]
            LyXText::NextBreakPoint(BufferView*,const Row*,int)const [text.C:1059]


- A memory leak related to undo in tables:

         MLK: 1500 bytes leaked in 3 blocks
         This memory was allocated from:
               malloc         [rtlib.o]
               LyXParagraph::LyXParagraph() [stl_alloc.h:151]
               LyXParagraph::Clone()const [paragraph.C:1603]
               LyXText::CreateUndo(Buffer*,Undo::undo_kind,const LyXParagraph*,const 
LyXParagraph*)const [text2.C:3508]
                              && start != end->next
                              && (before != behind || (!before && !behind))) {
                                  tmppar = start;
               =>                 tmppar2 = tmppar->Clone();
                                  tmppar2->id(tmppar->id());
                  
                                  // a memory optimization: Just store the layout 
information
               LyXText::SetUndo(Buffer*,Undo::undo_kind,const LyXParagraph*,const 
LyXParagraph*)const [text2.C:3440]
               InsetTabular::TabularFeatures(BufferView*,LyXTabular::Feature,const 
lyxstring&) [insettabular.C:1336]
               FormTabular::input(flobjs_*,long) [FormTabular.C:610]
               FormBase::InputCB(flobjs_*,long) [FormBase.C:151]
               C_FormBaseInputCB [FormBase.C:41]
               fl_object_qread [libforms.a]
         Block of 500 bytes (3 times); last block at 0xd82fc8


- Another different memory leak:

         MLK: 500 bytes leaked at 0x884148
         This memory was allocated from:
               malloc         [rtlib.o]
               LyXParagraph::LyXParagraph(LyXParagraph*) [stl_alloc.h:151]
               
Buffer::parseSingleLyXformat2Token(LyXLex&,LyXParagraph*&,LyXParagraph*&,const 
lyxstring&,int&,char&,LyXFont&,LyXParagraph::footnote_flag&,LyXParagraph::footnote_kind&)
 [buffer.C:339]
                                          return_par = par;
                                  else {
                                          par->fitToSize();
               =>                         par = new LyXParagraph(par);
                                  }
                                  pos = 0;
                                  lex.EatLine();
               Buffer::readLyXformat2(LyXLex&,LyXParagraph*) [buffer.C:294]
               Buffer::readFile(LyXLex&,LyXParagraph*) [buffer.C:1057]
               readFile__10BufferListRC9lyxstringb [bufferlist.C:398]
               loadLyXFile__10BufferListRC9lyxstringb [bufferlist.C:502]
               LyXFunc::MenuOpen() [lyxfunc.C:3121]
               LyXFunc::Dispatch(int,const lyxstring&) [lyxfunc.C:767]
               Menubar::Pimpl::MenuCallback(flobjs_*,long) [Menubar_pimpl.C:668]


Reply via email to