[Libreoffice] [SOLVED] Debug-mode getline-using sal unittest crashes, triggered by _GLIBCXX_DEBUG

Julien Nabet serval2412 at yahoo.fr
Mon Jun 27 11:05:46 PDT 2011


Le 27/06/2011 16:57, Caolán McNamara a écrit :
> On Fri, 2011-06-24 at 20:02 +0200, Julien Nabet wrote:
>> But when i use  the test file, nothing as you can see below :
>>
>> $ g++ -D_GLIBCXX_DEBUG attachment.cxx
>> $ echo hello world | ./a.out
>> Line is: "hello world"
> Hmm, hard to track down a reproducible test-case then. Anything in
> echo hello world | valgrind ./a.out ?
$ cat test.c
#include <iostream>
#include <string>

using namespace std;

int main (int argc, char * const argv[]) {
     string line;
     getline(cin, line);
     cout << "Line is: \"" << line << "\"" << endl;
    return 0;
}
$ g++ -D_GLIBCXX_DEBUG test.c
$ echo hello world| valgrind ./a.out
==2612== Memcheck, a memory error detector
==2612== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==2612== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==2612== Command: ./a.out
==2612==
Line is: "hello world"
==2612==
==2612== HEAP SUMMARY:
==2612==     in use at exit: 0 bytes in 0 blocks
==2612==   total heap usage: 5 allocs, 5 frees, 96 bytes allocated
==2612==
==2612== All heap blocks were freed -- no leaks are possible
==2612==
==2612== For counts of detected and suppressed errors, rerun with: -v
==2612== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 6)
$
> And was this with a system cppunit or the built-in one ?
libcppunit-1.12-1 and libcppunit-dev are not installed and in 
config.log, I've got :
configure:14349: checking which cppunit to use
configure:14449: result: internal

So I suppose I use the build-in one.

Are there other tests I could do ?

Julien.



More information about the LibreOffice mailing list