Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #1660
Closed
Open
Issue created Apr 01, 2015 by Derek Bruening@derekbrueningContributor

dr_get_main_module() and get_application_base() fail for early inject across execve with relative path

This shows up as a CRASH in Dr. Memory's execve test:

#7  0xf72742f6 in master_signal_handler () at /work/dr/git/src/core/arch/x86/x86.asm:1444
#8  0x49de2afc in ?? ()
#9  0x7395063c in report_thread_init (drcontext=0x49d61480) at /work/drmemory/git/src/drmemory/report.c:2030
#10 0x73815106 in event_thread_init (drcontext=0x49d61480) at /work/drmemory/git/src/drmemory/drmemory.c:556

it's in callstack_thread_init():

    module_data_t *data = dr_get_main_module();
    instr_t inst;
    byte *pc = data->entry_point;

dr_get_main_module() returned NULL.

(gdb) p executable_start $1 = (app_pc) 0x0 (gdb) p get_application_name() $2 = 0xf73c9460 <executable_path> "tests/malloc"

The app to run is passed to tests/execve as either "./malloc" or here "tests/malloc".

08048000-08049000 r-xp 00000000 fd:03 15236022 /work/drmemory/git/build_x86_dbg/tests/malloc

get_application_base() wants the full path: if (strcmp(iter.comment, name) == 0) {

The execve test works just fine if I pass in the full path as the arg.

DR test suite didn't catch this b/c the test apps are all invoked directly by drrun, who makes the path absolute.

Assignee
Assign to
Time tracking