Page 1 of 1

[g3.4pre-419-gbcadd2bf0-m] Crash after taking a screenshot

Posted: Thu May 17, 2018 8:32 am
by Marisa the Magician
Anytime I take a screenshot gzdoom crashes with the message "munmap_chunk(): invalid pointer", I've tracked it down to line 644 of m_misc.cpp.

Guess you forgot a check for null before calling delete on the screenshot buffer.

Re: [g3.4pre-419-gbcadd2bf0-m] Crash after taking a screensh

Posted: Thu May 17, 2018 9:14 am
by ketmar
1. it is absolutely safe to call `delete` on null pointer — by the c++ specs.
2. it is inside `if (buffer != NULL)` check anyway, isn't it?

it looks like there is a buffer overrun somewhere in another code, and glibc's memory allocator structs are corrupted.

Re: [g3.4pre-419-gbcadd2bf0-m] Crash after taking a screensh

Posted: Thu May 17, 2018 9:24 am
by _mental_
It's just an incorrect address passed to delete. Graf was a bit too aggressive with code removal in this commit.

Re: [g3.4pre-419-gbcadd2bf0-m] Crash after taking a screensh

Posted: Fri May 18, 2018 9:51 am
by Cacodemon345
It should be fixed.

Re: [g3.4pre-419-gbcadd2bf0-m] Crash after taking a screensh

Posted: Sat May 19, 2018 3:07 am
by _mental_
No, it's not. Fixed in ace5ee3.