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

Crash when calling atoi in client loaded with the Linux private loader #494

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

Comments

@derekbruening
Copy link
Contributor

From [email protected] on June 09, 2011 17:37:03

To reproduce:

Place the following client in api/samples/atoi.c:

#include "dr_api.h"
DR_EXPORT void dr_init(client_id_t id) {
int three = atoi("3");
dr_printf("%d\n", three);
}

Rebuild (need to run 'cmake .' to pick up the new .c file) and run it on ls, and I get a segfault with this stack trace:

#0 0x0000000048855cc1 in ____strtoll_l_internal ()
#1 0x0000000048853240 in atoi ()
#2 0x000000007200067b in dr_init (id=0) at /afs/csail.mit.edu/u/r/rnk/dynamorio/git-clone/api/samples/atoi.c:6
#3 0x0000000071272237 in instrument_init ()
at /afs/csail.mit.edu/u/r/rnk/dynamorio/git-clone/core/x86/instrument.c:527
#4 0x0000000071079f1b in dynamorio_app_init ()
at /afs/csail.mit.edu/u/r/rnk/dynamorio/git-clone/core/dynamo.c:620
#5 0x00007f741ec95a56 in _init () at /afs/csail.mit.edu/u/r/rnk/dynamorio/git-clone/core/linux/preload.c:186
#6 0x00007f741eea8718 in call_init () from /lib64/ld-linux-x86-64.so.2
#7 0x00007f741eea8847 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#8 0x00007f741ee9ba9a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#9 0x0000000000000001 in ?? ()
#10 0x00007fffb63dab8c in ?? ()
#11 0x0000000000000000 in ?? ()

I don't have enough debug info for libc to tell what it's trying to do, but I'm guessing this is a complication of having two versions of libc in the address space. -no_private_loader fixes the problem. -mangle_app_tls didn't solve this problem, so I'm not sure what the issue is.

I'll leave this assigned to me; I may look at it later. It's possible this is the same issue as issue #480 .

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

@derekbruening
Copy link
Contributor Author

From [email protected] on June 14, 2011 08:21:47

xref issue #495 : may be the same thing

@derekbruening
Copy link
Contributor Author

From [email protected] on August 06, 2011 17:13:21

Fixed in r900 .

Status: Fixed

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