Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess violation reading location - non-terminated string (unreadable memory)
    primarykey
    data
    text
    <p>I'm using log4cplus library and I can't get logging to work. </p> <p>I use this code:</p> <pre><code>PropertyConfigurator::doConfigure(LOG4CPLUS_TEXT("log.properties")); Logger g_logger = Logger::getInstance(LOG4CPLUS_TEXT("mylogger")); LOG4CPLUS_WARN(g_logger, LOG4CPLUS_TEXT("test test test")); </code></pre> <p>And it breaks at <code>LOG4CPLUS_WARN</code> with error: <code>Access violation reading location</code></p> <p>This is my Call Stack:</p> <pre><code>msvcp110d.dll!std::basic_streambuf&lt;wchar_t,std::char_traits&lt;wchar_t&gt; &gt;::egptr() Line 236 C++ ProjectClientd.exe!std::basic_stringbuf&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt; &gt;::str() Line 103 C++ ProjectClientd.exe!std::basic_ostringstream&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt; &gt;::str() Line 553 C++ &gt; ProjectClientd.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 55 C++ ProjectClientd.exe!__tmainCRTStartup() Line 528 C ProjectClientd.exe!wWinMainCRTStartup() Line 377 C </code></pre> <p>where <code>wWinMain ... line 55</code> is a place where <code>LOG4CPLUS_WARN</code> is being called.</p> <p>I have checked what's wrong with this <code>basic_ostringstream</code> and it seems that something is messed up with encoding or something: <img src="https://i.stack.imgur.com/EGSej.png" alt="enter image description here"></p> <p>Non-terminated string (unreadable memory) and a whole bunch of strange letters at the end of my string? What may cause it? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload