Client couldn't intercept status_stack_buffer_overrun

48 views
Skip to first unread message

splas...@gmail.com

unread,
Jun 10, 2021, 8:15:27 AM6/10/21
to DynamoRIO Users
Hello,
I'm doing some exception interception on Windows using DR's drmgr_register_exception_event(event_exception). But I couldn't catch the exception.
My simple program looks like:

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    if(argc <2)
    {
       printf("Syntax: %s <input string>\n", argv[0]);
       exit (0);
    }

    if (argv[1][0] == 'A')
    {
        abort();
    }
      return 0;
}
So, abort() function rises  status_stack_buffer_overrun exception.
My Client is:

#include "dr_api.h"
#include "drmgr.h"
#include "drx.h"
#include "utils.h"

static void
event_exit(void)
{
    dr_printf("Exit\n");
    drmgr_exit();
}

static bool
event_exception(void* drcontext, dr_exception_t* excpt)
{
    dr_printf("Exception!\n");

    return true;
}

DR_EXPORT void
dr_client_main(client_id_t id, int argc, const char *argv[])
{
    dr_set_client_name("DynamoRIO Sample Client 'signal'", "http://dynamorio.org/issues");
    dr_printf("client_main\n");
    drmgr_init();
    drmgr_register_exception_event(event_exception);
}

When abort() function is called, nigher event_exception is not trigered, nor event_exit.
But I think, they both should be triggered.
Could anyone shed some light on this problem?
Thanks

splas...@gmail.com

unread,
Jun 10, 2021, 8:18:56 AM6/10/21
to DynamoRIO Users
I forgot to show output of run and run command.
Run command:
dynamorio\bin64\drrun.exe -debug -c dynamorio\samples\bin64\signal.dll -- test_abort.exe A

Output:
client_main
<non-syscall, non-int2b 0x29 @ 0x00007ff692574585 from 0x00007ff692574580>

четверг, 10 июня 2021 г. в 15:15:27 UTC+3, splas...@gmail.com:

sharma...@google.com

unread,
Jun 14, 2021, 10:15:15 AM6/14/21
to DynamoRIO Users
Hi,
Based on dr_register_exception_event's documentation at [1], I see that the callback is not called for RaiseException. Can you check whether the implementation of abort uses the same? Maybe you can try using some other way to raise the exception.


Abhinav

Derek Bruening

unread,
Jun 14, 2021, 11:50:03 AM6/14/21
to dynamor...@googlegroups.com
I think this is the key:

<non-syscall, non-int2b 0x29 @ 0x00007ff692574585 from 0x00007ff692574580>

Interrupt 0x29: apparently something added in Windows 8.  DR does not have handling for it.
I would suggest filing an issue, and ideally submitting a pull request to add handling.

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/40be92f2-7c8b-4ae7-b929-37e61c68e857n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages