flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Marut 27 Feb 2019, 21:18
On Windows if a thread crashes the whole process crashes, so you need to handle the exception on the second thread and either call ExitThread from there, or handle the exception in some other way.
On 32-bit programs a good way to do so could be either SEH or SetUnhandledExceptionFilter. |
|||
![]() |
|
DimonSoft 27 Feb 2019, 22:17
But please don’t, ’cause going beyond the allocated memory block is basically a buffer overflow vulnerability which is a bug in the software that should be fixed, not silenced by handling the exception and proceeding. Your handling will almost definitely be to do nothing and just ignore the exception which is a bad way, or it may be to change the target address to another address (say, for making a circular buffer) in which case the solution is not very performance-friendly.
|
|||
![]() |
|
comrade 28 Feb 2019, 01:38
Roman, what is the end goal? DimonSoft already pointed out that the cause of the crash is something that really should crash the process.
|
|||
![]() |
|
revolution 28 Feb 2019, 18:30
If your program is crashing because you exceed your buffer allocation then you need to sanitise your inputs before placing them in a buffer. Make sure you have enough space free before copying data in. If you have more data coming in than you have buffer space, then either discard that data, truncate the data, or increase the buffer size. Don't simply blindly copy in data and hope/pray that it will fit.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.