-
Notifications
You must be signed in to change notification settings - Fork 566
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
Build and Test failure on Ubuntu 12.04 #762
Comments
From [email protected] on May 12, 2012 08:49:53 Thanks for the report and patch: CLONE_VM is defined in /usr/include/bits/sched.h under macro __USE_GNU in Ubuuntu-12.04. There are several test failure to be fixed after patch:
47/98 Test Summary: Build and Test failure on Ubuntu 12.04 |
From [email protected] on May 14, 2012 21:56:55 It seems there is a deadlock. #0 0x00007fc2adf551bb in ?? () from /lib/x86_64-linux-gnu/libc.so.6 The app is executing malloc code around While the DR is building code for app, it calls vfscanf to check memory map, which calls to app's malloc, and causes deadlock. 0x7fc2adf551a0: push % r10 0x7fc2adf551a2: push %rdx Labels: Bug-Hang |
From [email protected] on May 15, 2012 05:35:39 This happens despite our private loader and segment mangling, or did you turn those off to debug? I guess we have to figure out how it finds the lock, %rdx in the above code snippet. |
From [email protected] on May 15, 2012 07:22:04 Even using private loader, DR is still using app's libc. So I am not surprised there would be a deadlock. Since we are using scanf, we should either write our own scanf or let DR use a separate libc. |
From [email protected] on May 15, 2012 08:00:33 I guess sscanf is just not as safe as we assumed. We really can't call it if it calls malloc. I found a BSD stand alone implementation of sscanf in an ancient revision of Kerberos and I have it in my ptrace injector branch, along with a bunch of other libc independence code ( issue #46 ). I'll split sscanf out as a separate diff and send it along, once I've made sure that the code works. It appears to modify the input string, which I don't like. It would be interesting to try and find the glibc change between versions of Ubuntu that introduced this malloc call. |
From [email protected] on May 15, 2012 08:09:38 From the source code of _IO_vfscanf_internal @ stdio-common/vfscanf.c, it clearly uses realloc, which might call malloc. |
From [email protected] on May 15, 2012 09:20:25 Right, I'm curious though if this is something new in the glibc that ships with Ubuntu 12.04 vs. 11.08, or if we just never hit it before. We'd have to dig into glibc revision history. It would be interesting to know, but not super important. |
From [email protected] on May 22, 2012 07:40:06 We can also fix the CLONE_* build errors by including linux/sched.h directly. I actually prefer this because I've never liked having to define GNU_SOURCE before header inclusions, and it sidesteps the REG* naming conflicts. clone is really a linux specific concept, so I have no qualms about including linux/sched.h. I also have a new, minimal sscanf implementation prepared. Owner: [email protected] |
From [email protected] on June 04, 2012 21:29:27 Status: Fixed |
From [email protected] on May 02, 2012 15:37:30
What version of DynamoRIO are you using? URL: http://dynamorio.googlecode.com/svn/trunk Revision: 1354 What operating system version are you running on? Linux 3.2.0-24-generic-pae
#37
-Ubuntu SMP i686 i686 i386 GNU/LinuxCopy-pasted commands from HowToBuild (except for ia32-libs part), got the following:
[ 14%] Building C object core/CMakeFiles/dynamorio.dir/linux/os.c.o
/tmp/dynamorio/core/linux/os.c: In function ‘dr_create_client_thread’:
/tmp/dynamorio/core/linux/os.c:2935:18: error: ‘CLONE_VM’ undeclared (first use in this function)
Seems like now it is hard requirement that one should define _GNU_SOURCE in order to use CLONE_VM. Just defining _GNU_SOURCE at the top of linux/os.c does not work, since it brings in REG_ZZZ defines that conflict with the ones from dynamorio. Attached patch solves the problem for me.
Attachment: dr-use-gnu.patch
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=762
The text was updated successfully, but these errors were encountered: