Re: [Libreoffice] [PATCH], VALGRIND=memcheck => sc unit test discovered bug

2011-10-06 Thread Kohei Yoshida
On Thu, 2011-10-06 at 16:58 +0200, Markus Mohrhard wrote:
> Hello Caolan,
> 
> 2011/10/6 Caolán McNamara 
> btw, in case people don't know you can
> export VALGRIND=memcheck
> make -sr
> and the unit tests are run under valgrind then
> 
> e.g. the sc unit test has the attached valgrind.log bug in it,
> I've
> attached a probable fix.
> 
> You can blame me, I know it and I saw the problem in one of my ouputs
> but wrote it on my todo list because I was debugging a crash in the
> basic support.

Heh. Don't over-blame yourself for something you are not
responsible. ;-)  That's my code, so it's not yours to take heat for.

(Besides I don't believe in blame-fest.  We help each other out.)

> I'll have a look at the patch later.

The patch is perfectly fine.  You have my blessing.

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH], VALGRIND=memcheck => sc unit test discovered bug

2011-10-06 Thread Markus Mohrhard
Hello Caolan,

2011/10/6 Caolán McNamara 

> btw, in case people don't know you can
> export VALGRIND=memcheck
> make -sr
> and the unit tests are run under valgrind then
>
> e.g. the sc unit test has the attached valgrind.log bug in it, I've
> attached a probable fix.
>

You can blame me, I know it and I saw the problem in one of my ouputs but
wrote it on my todo list because I was debugging a crash in the basic
support.


I'll have a look at the patch later.

Thanks a lot for reminding me again that i should not put such things on my
TODO list

Regards,
Markus
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH], VALGRIND=memcheck => sc unit test discovered bug

2011-10-06 Thread Caolán McNamara
btw, in case people don't know you can
export VALGRIND=memcheck
make -sr 
and the unit tests are run under valgrind then

e.g. the sc unit test has the attached valgrind.log bug in it, I've
attached a probable fix.

2f632a0b39e6ae6518131ef6d100831c69c2f68f is another bug found through
valgrind on the unit tests.

C.
==18095== Conditional jump or move depends on uninitialised value(s)
==18095==at 0x1080841A: ScDBQueryDataIterator::DataAccessInternal::getCurrent(ScDBQueryDataIterator::Value&) (dociter.cxx:585)
==18095==by 0x108087F6: ScDBQueryDataIterator::DataAccessInternal::getFirst(ScDBQueryDataIterator::Value&) (dociter.cxx:648)
==18095==by 0x108094B3: ScDBQueryDataIterator::GetFirst(ScDBQueryDataIterator::Value&) (dociter.cxx:925)
==18095==by 0x10A281D6: ScInterpreter::ScDBCount() (interpr1.cxx:6509)
==18095==by 0x10A5B9C6: ScInterpreter::Interpret() (interpr4.cxx:3934)
==18095==by 0x107CC9C7: ScFormulaCell::InterpretTail(ScFormulaCell::ScInterpretTailParameter) (cell.cxx:1563)
==18095==by 0x107CBABA: ScFormulaCell::Interpret() (cell.cxx:1290)
==18095==by 0x107CE500: ScFormulaCell::MaybeInterpret() (cell.cxx:2025)
==18095==by 0x107D59E1: ScFormulaCell::GetErrCode() (cell2.cxx:733)
==18095==by 0x109A9BA7: ScCellFormat::GetString(ScBaseCell*, unsigned long, String&, Color**, SvNumberFormatter&, unsigned char, unsigned char, ScForceTextFmt) (cellform.cxx:124)
==18095==by 0x1083BCDC: ScDocument::GetCellScriptType(ScBaseCell*, unsigned long) (documen6.cxx:147)
==18095==by 0x1083BE72: ScDocument::GetScriptType(short, int, short, ScBaseCell*) (documen6.cxx:182)
==18095==by 0x107E919F: ScColumn::HasEditCells(int, int, int&) const (column.cxx:2137)
==18095==by 0x107EF11B: ScColumn::GetOptimalHeight(int, int, unsigned short*, OutputDevice*, double, double, Fraction const&, Fraction const&, bool, unsigned short, int) (column2.cxx:745)
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 76a254f..bc9689b 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -517,7 +517,8 @@ SCSIZE ScDBQueryDataIterator::SearchColEntryIndex(ScDocument& rDoc, SCTAB nTab,
 ScDBQueryDataIterator::DataAccessInternal::DataAccessInternal(const ScDBQueryDataIterator* pParent, ScDBQueryParamInternal* pParam, ScDocument* pDoc) :
 DataAccess(pParent),
 mpParam(pParam),
-mpDoc(pDoc)
+mpDoc(pDoc),
+bCalcAsShown( pDoc->GetDocOptions().IsCalcAsShown() )
 {
 nCol = mpParam->mnField;
 nRow = mpParam->nRow1;
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice