On 11/26/2013 08:55 AM, Slava wrote:
Generated assembly for Test::Test() and Test::Test(const std::stringstream& logStream) is identical up to saving the parameter passed in rsi/esi in stack (in debug version). When I change the constructor parameter to for example int, the crash occurs as well. So I would conclude, the crash is caused by dereferencing destroyed local variable. It just does not show itself in case of no parameter because the stack memory conflict occasionally does not happen under these circumstances and valgrind is not able to detect it properly.
that makes sense I suppose. You are definitely right that maintaining the sink streams solves my problems so I should not further complicate matters by finding examples that 'appear' to work with temporaries. thank you kindly for your help Slava, Steven