Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HANG dynamorio hangs when I add -debug switch #957

Closed
derekbruening opened this issue Nov 28, 2014 · 6 comments
Closed

HANG dynamorio hangs when I add -debug switch #957

derekbruening opened this issue Nov 28, 2014 · 6 comments

Comments

@derekbruening
Copy link
Contributor

From [email protected] on October 19, 2012 06:59:42

For the Summary, please follow the guidelines at https://code.google.com/p/dynamorio/wiki/BugReporting and use one of the CRASH, APP CRASH, HANG, or ASSERT keywords What version of DynamoRIO are you using? 3.2.0-3 What operating system version are you running on? 64 bit Ubuntu 12.04
Linux kernel 3.2.0-32-generic What application are you running? a simple systemc example:

\#include "systemc.h"

SC_MODULE(first) {
    SC_CTOR(first) {
        SC_THREAD(first_foo);
    }
    void first_foo() {
        cout \<< "hello from first module\n";
    }
};

SC_MODULE(second) {
    SC_CTOR(second) {
        SC_THREAD(second_foo);
    }
    void second_foo() {
        cout \<< "hello from second module\n";
    }
};

SC_MODULE(top) {
    first *f;
    second *s;
    SC_CTOR(top) {
        f = new first("1st");
        s = new second("2nd");
    }
};

int sc_main(int argc, char* argv[]) {
    top("top");
    sc_start();
    return 0;
} Is your application 32-bit or 64-bit? 64-bit How are you running the application under DynamoRIO? drrun -client /PATH/TO/DR/bin/libwrapperpp.so 0 "" /PATH/TO/APP/a.out What happens when you run without any client? it gives me the regular application output in addition to the first two lines about basename such as:

basename: missing operand
Try `basename --help' for more information.

             SystemC 2.3.0-ASI --- Sep 20 2012 23:24:20
        Copyright (c) 1996-2012 by all Contributors,
        ALL RIGHTS RESERVED

hello from first module
hello from second module

What happens when you run with debug build ("-debug" flag to drrun/drconfig/drinject)? It works ok when I run without -debug switch. It hangs when I include -debug switch after printing:


<Starting application a.out (4015)>
<Initial options = -client_lib '/home/gokce/bitbucket/gokcehan-thesis/dynamorio/
bin/libwrapperpp.so;0;' -code_api -stack_size 56K -max_elide_jmp 0 -max_elide_ca
ll 0 -no_inline_ignored_syscalls -no_native_exec -no_indcall2direct >
tracing started.. What steps will reproduce the problem? I have prepared a minimal example of the client where I observe the hang:

\#include "dr_api.h"
\#include "drwrap.h"
\#include "drsyms.h"

\#include \<systemc>  // this is the header of my application library

static void event_exit(void);

DR_EXPORT void
dr_init(client_id_t id)
{
    drwrap_init();
    drsym_init(0);
    dr_printf("tracing started..\n");
    dr_register_exit_event(event_exit);
}

static void
event_exit()
{
    drwrap_exit();
    drsym_exit();
    dr_printf("tracing finished..\n");
}

As I said above, it hangs with -debug switch, works ok without it. What is the expected output? What do you see instead? Is this an application crash, a DynamoRIO crash, a DynamoRIO assert, or a hang (see https://code.google.com/p/dynamorio/wiki/BugReporting and set the title appropriately)? I would expect just the output of my systemc program since I haven't really done anything in my client. Please provide any additional information below. This issue may or may not be related to my previous issue: https://code.google.com/p/dynamorio/issues/detail?id=956&q=systemc These two were first discussed in: https://groups.google.com/forum/?fromgroups=#!topic/DynamoRIO-Users/GkVL9IxxdnQ

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=957

@derekbruening
Copy link
Contributor Author

From [email protected] on November 15, 2012 08:06:55

There was a discussion going on about make process effecting the execution in: https://groups.google.com/forum/?fromgroups=#!topic/DynamoRIO-Users/jY3JfkZGLh8 I checked this again to see if this problem relates to the same thing. I realized now there's a typo in the minimal example client code under What steps will reproduce the problem?, there should be no #include \<systemc.h> line (that belongs to issue #956 ).

Also I cannot reproduce the HANG anymore but instead it gives me a memory dump like error as this:

\<Preferred vmm heap allocation failed>
\<Full size vmm heap allocation failed>
\<Starting application a.out (6269)>
\<Initial options = -client_lib '/PATH/TO/DR/bin/libwrapperpp.so;0;' -code_api -stack_size 56K -max_elide_jmp 0 -max_elide_call 0 -no_inline_ignored_syscalls -no_native_exec -no_indcall2direct >
tracing started..

             SystemC 2.3.0-ASI --- Sep 20 2012 23:24:20
        Copyright (c) 1996-2012 by all Contributors,
        ALL RIGHTS RESERVED

\<rank order violation report_buf_lock(mutex)@/home/bruening/dr/git/src/core/utils.c:1944 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation callback_registration_lock(readwrite)@/home/bruening/dr/git/src/core/x86/instrument.c:117 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation dr_client_mutex(readwrite)@/home/bruening/dr/git/src/core/x86/instrument.c:2690 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation dr_client_mutex(mutex)@/home/bruening/dr/git/src/core/x86/instrument.c:2614 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation dr_client_mutex(mutex)@/home/bruening/dr/git/src/core/x86/instrument.c:2614 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation dr_client_mutex(recursive)@/home/bruening/dr/git/src/core/x86/instrument.c:2751 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation dr_client_mutex(readwrite)@/home/bruening/dr/git/src/core/x86/instrument.c:2690 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation dr_client_mutex(recursive)@/home/bruening/dr/git/src/core/x86/instrument.c:2751 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation dr_client_mutex(readwrite)@/home/bruening/dr/git/src/core/x86/instrument.c:2690 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation global_alloc_lock(recursive)@/home/bruening/dr/git/src/core/heap.c:307 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation HTLOCK_RANK(readwrite)@/home/bruening/dr/git/src/core/hashtablex.h:550 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation shared_cache_lock(mutex)@/home/bruening/dr/git/src/core/fcache.c:1529 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation special_heap_lock(mutex)@/home/bruening/dr/git/src/core/heap.c:3997 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation fcache_unit_areas(readwrite)@/home/bruening/dr/git/src/core/fcache.c:859 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation shared_cache_lock(mutex)@/home/bruening/dr/git/src/core/fcache.c:1529 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<rank order violation shared_vm_areas(readwrite)@/home/bruening/dr/git/src/core/vmareas.c:1537 acquired after memory_info_buf_lock(mutex)@/home/bruening/dr/git/src/core/linux/os.c:260 in tid:187d>
\<Application a.out (6269).  Internal Error Internal DynamoRIO Error: /home/bruening/dr/git/src/core/utils.c:629 lock->owner != get_thread_id() && "deadlock on recursive mutex_lock"
(Error occurred @2300 frags)
version 3.2.0, build 3
-client_lib '/PATH/TO/DR/bin/libwrapperpp.so;0;' -code_api -stack_size 56K -max_elide_jmp 0 -max_elide_call 0 -no_inline_ignored_syscalls -no_native_exec
0x0000000041f91be0 0x000000007110acec
0x0000000041f91d40 0x000000007110cea1
0x0000000041f91da0 0x000000007110d5ca
0x0000000041f91dd0 0x000000007110d4bc
0x0000000041f91e00 0x00000000712a6c85
0x0000000041f91e40 0x00000000712a9632
0x0000000041f91ed0 0x00000000712a9869
0x0000000041f91f20 0x00000000712b4abb
0x0000000041f922a0 0x00000000712b59e9
0x0000000041f92370 0x00000000712728c9>

@derekbruening
Copy link
Contributor Author

From [email protected] on November 20, 2012 16:27:30

I compiled the example app and client, and I can't reproduce anything. It works just fine, more or less.

Do you have the same problems on other apps like ls?

@derekbruening
Copy link
Contributor Author

From [email protected] on November 21, 2012 07:06:06

  • ls => works fine
    • hello world => works fine
    • pthreads hello world => crash
    • systemc hello world (also using pthreads indirectly) => crash

so I feel like it might be related to pthreads somehow..

@derekbruening
Copy link
Contributor Author

From [email protected] on November 21, 2012 15:20:53

What happens if you run DR without a client with -debug?

The initial report says this is DR 3.2.0-3. Does the problem go away with a recent build of DR? Recent builds: http://build.chromium.org/p/client.dynamorio/builds/ Let me know if those don't work.

@derekbruening
Copy link
Contributor Author

From [email protected] on November 22, 2012 06:07:18

I have the same SIGSEGV error

Does the problem go away with a recent build of DR?

Tried 1731 with and without client but no luck..

@derekbruening
Copy link
Contributor Author

From [email protected] on January 23, 2013 05:46:39

Not reproducible anymore according to discussion here: https://groups.google.com/forum/#!msg/dynamorio-users/hpZfQga33yw/IENBV1xWMckJ

Status: CannotReproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant