bombela / backward-cpp

A beautiful stack trace pretty printer for C++
MIT License
3.74k stars 474 forks source link

Address sanitizer issue while printing stacktrace via Printer object #171

Closed dev-kumar-2204 closed 3 years ago

dev-kumar-2204 commented 4 years ago

Hi Below code produces memory leak issue while compiling with address_sanitizer flag.

StackTrace st; st.load_here(32); Printer p; p.object = true; p.color_mode = ColorMode::always; p.address = true; p.print(st, stderr); // This is issue line

Appreciate any help to remove this issue. Thanks

bombela commented 4 years ago

I wonder if its similar to #163. Thanks for the report.

dev-kumar-2204 commented 4 years ago

Both code are more or less same. In my case there is no SIGABRT. But address sanitizer(-fsanitize=address) complains about memory leak.

iillyyaa commented 3 years ago

I see the problem - found it by code inspection while chasing an address sanitizer warning. PR filed.