Le 14 juil. 09 à 14:50, Kornel Benko a écrit :
Ok, I send you the full log (compressed)

There are several entries that are probably real bugs (but harmless?)
related to

==14288== Use of uninitialised value of size 8
==14288==    at 0x62F2FB1: (within /usr/lib64/libstdc++.so.6.0.9)
==14288== by 0x63048D5: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (in /usr/ lib64/libstdc++.so.6.0.9) ==14288== by 0x6304B86: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (in /usr/lib64/libstdc++.so.6.0.9) ==14288== by 0x630D21F: std::ostream& std::ostream::_M_insert<long>(long) (in /usr/lib64/libstdc++.so.6.0.9) ==14288== by 0xA5E702: lyx::operator<<(lyx::LyXErr&, int) (in /usr/ local/lyx1.6/bin/lyx) ==14288== by 0x620995: lyx::Encodings::read(lyx::support::FileName const&, lyx::support::FileName const&) (in /usr/local/lyx1.6/bin/lyx)

I guess we output uninitialized variables in the LYXERR call. Did you run with any -dbg flag?

This is probably the problem:

==14288== Invalid read of size 1
==14288== at 0x4C22B49: strncmp (in /usr/lib64/valgrind/amd64-linux/ vgpreload_memcheck.so)
==14288==    by 0x6A0EE41: (within /lib64/libc-2.6.1.so)
==14288==    by 0x6A0EBBD: putenv (in /lib64/libc-2.6.1.so)
==14288== by 0xA3FE89: lyx::support::setEnv(std::string const&, std::string const&) (in /usr/local/lyx1.6/bin/lyx) ==14288== by 0xA434BD: lyx::Messages::get(std::string const&) const (in /usr/local/lyx1.6/bin/lyx)

==14288== Address 0xC2A7D38 is 24 bytes inside a block of size 39 free'd ==14288== at 0x4C2162D: operator delete(void*) (in /usr/lib64/ valgrind/amd64-linux/vgpreload_memcheck.so) ==14288== by 0x63154BB: std::string::assign(std::string const&) (in /usr/lib64/libstdc++.so.6.0.9) ==14288== by 0xA3FD90: lyx::support::setEnv(std::string const&, std::string const&) (in /usr/local/lyx1.6/bin/lyx) ==14288== by 0xA434BD: lyx::Messages::get(std::string const&) const (in /usr/local/lyx1.6/bin/lyx)

The relevant function is:

bool setEnv(string const & name, string const & value)
{
        // CHECK Look at and fix this.
        // f.ex. what about error checking?

        string const encoded = to_local8bit(from_utf8(value));
#if defined (HAVE_SETENV)
        return ::setenv(name.c_str(), encoded.c_str(), 1) == 0;
#elif defined (HAVE_PUTENV)
        static map<string, string> varmap;
        varmap[name] = name + '=' + encoded;
        return ::putenv(const_cast<char*>(varmap[name].c_str())) == 0;
#else
#error No environment-setting function has been defined.
#endif
        return false;
}

Does somebody see why there is a memory allocation in the putenv case?

JMarc

Reply via email to