Internal Dynamo Error on Ubuntu 11.10 64-Bit. Cross-Compilation.

217 views
Skip to first unread message

piper

unread,
Dec 29, 2011, 1:52:32 AM12/29/11
to DynamoRIO Users

Compiled DynamoRIO from source on Ubuntu 11.10 VM 64-bit under
Parallels. Configured it to cross-compile (see below). It configured
fine. It compiled and linked fine. However, when I loaded
libstrace.so against a sample 32-bit program, DR generated an
exception and exited.

I updated all dependencies. Versions for some dependencies are listed
here:

Dependencies:
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
binutils 2.21.53

I extracted the commands and error messages below:

I> cmake complains, but gcc is updated to version 4.6.1

cmake ...

piper@piper-Parallels-Virtual-Platform:~/Downloads/dynamorio-read-only/
build$ CFLAGS=-m32 CXXFLAGS=-m32 cmake -DDEBUG=ON ..

-- Version number: 3.0.1204
/usr/bin/gcc missing flag "-mmnemonic.*intel"
/usr/bin/gcc too old: using /home/piper/Downloads/dynamorio-read-only/
make/as-2.18.50
-- Configuring done
-- Generating done
-- Build files have been written to: /home/piper/Downloads/dynamorio-
read-only/build

II> Loading libstrace.so errors out:

piper@piper-Parallels-Virtual-Platform:~/Downloads/dynamorio-read-only/
build$ ./bin32/drrun -v -debug -ops '-loglevel 2 -syntax_intel' -
client ./api/samples/bin/libstrace.so 0 "" ../test_apps/
test_netaware_app 9090

Using debug DynamoRIO (/home/piper/Downloads/dynamorio-read-only/build/
lib32/debug/libdynamorio.so)
With DynamoRIO options="-code_api -client_lib "/home/piper/Downloads/
dynamorio-read-only/build/api/samples/bin/libstrace.so;0;" -loglevel 2
-syntax_intel"
Using logging directory="/home/piper/Downloads/dynamorio-read-only/
build/logs"
Running "../test_apps/test_netaware_app 9090"
<log dir=/home/piper/Downloads/dynamorio-read-only/build/logs/
test_netaware_app.20776.00000000>
<Starting application test_netaware_app (20776)>
<Initial options = -syntax_intel -loglevel 2 -client_lib '/home/piper/
Downloads/dynamorio-read-only/build/api/samples/bin/libstrace.so;0;' -
code_api -stack_size 56K -max_elide_jmp 0 -max_elide_call 0 -
no_inline_ignored_syscalls -no_native_exec -no_indcall2direct >
Client strace is running
new thread context id=20776 new depth
<Application test_netaware_app (20776). Internal Error Internal
DynamoRIO Error: /home/piper/Downloads/dynamorio-read-only/core/linux/
signal.c:2283 sc->fpstate->sw_reserved.xstate_size >= sizeof(*xstate)
(Error occurred @0 frags)
version 3.0.1204, custom build
-syntax_intel -loglevel 2 -client_lib '/home/piper/Downloads/dynamorio-
read-only/build/api/samples/bin/libstrace.so;0;' -code_api -stack_size
56K -max_elide_jmp 0 -max_elide_call 0 -no_i
0x1c6fa738 0xf753541e
0x1c6fa898 0xf76b02af
0x1c6fa8d8 0xf76b488a
0x1c6faab8 0xf76b55b9
0x1c6fab58 0xf7677d2a
0xffe5ac60 0xf7677bec
0xffe5add8 0xf77c57b9
0xffe5ae90 0xffe5c32c
0xffe5c30c 0x4e45504f>


How do fix this?

Regards,
Piper

Derek Bruening

unread,
Jan 1, 2012, 12:37:26 PM1/1/12
to dynamor...@googlegroups.com
1) Do you have binutils installed, in particular /usr/bin/as?

2) What happens when you run with
http://dynamorio.org/DynamoRIO-Linux-3.0.1204-1.tar.gz?
If you still see the assert, can you open an Issue for further
investigation. In the Issue, include the value of
sc->fpstate->sw_reserved.xstate_size and how your system's struct
_xstate differs from DR's core/linux/include/sigcontext.h.

- Derek

piper

unread,
Jan 2, 2012, 1:29:41 PM1/2/12
to DynamoRIO Users
Thank you for addressing this problem. I will follow up on my end
with more specifics.

For now, I let you know that binutils 2.21.53 is installed. /usr/bin/
as is installed, too.

I will follow on with the second item you gave me.

piper

unread,
Jan 3, 2012, 5:01:13 PM1/3/12
to DynamoRIO Users
Derek,

I followed up with item 2>, and used the version you suggested:
DynamoRIO-Linux-3.0.1204-1.tar.gz

The 64-bit tests went OK.

I then tried strace against a 32-bit application to get a segmentation
fault:

piper@piper-Parallels-Virtual-Platform:~/Downloads/DynamoRIO-
Linux-3.0.1204-1-2$ ./bin32/drrun -client ./samples/bin32/libstrace.so
0 "" /home/piper/Downloads/dynamorio-read-only/test_apps/net_aware_app
9090
Client strace is running
new thread context id=27615 new depth
Segmentation fault

Next, I ran with the debug version of the library to get:

piper@piper-Parallels-Virtual-Platform:~/Downloads/DynamoRIO-
Linux-3.0.1204-1-2$ ./bin32/drrun -client ./samples/bin32/
libstrace.so.debug 0 "" /home/piper/Downloads/dynamorio-read-only/
test_apps/net_aware_app 9090
<Application contact-net (27627). Client library targets an
incompatible API version and should be re-compiled.>
Segmentation fault

The subject application, net_aware_app.c was compiled on the same
operating system. Here, we are talking about Ubuntu 11.10 64-bit. I
downloaded the image from: http://www.ubuntu.com/download/ubuntu/download

So, it looks doing 32-bit instrumentation on 64-bit is problematic on
this VM. Any idea how to fix this?

Regards,
Piper
On Jan 1, 11:37 am, Derek Bruening <i...@alum.mit.edu> wrote:

Derek Bruening

unread,
Jan 3, 2012, 11:21:43 PM1/3/12
to dynamor...@googlegroups.com
The recent r1209 builds and runs on all 3 Ubuntu 11.10 app flavors (32-bit
kernel, 64-bit kernel w/ 32-bit app or 64-bit app) with small apps like
"ls" and either no client or the strace sample client. Is that the case on
your VM?

If your particular app still has problems but simpler apps work, can you
open an Issue and attach as simple a version of the app as possible that
exhibits the problem (ideally source code and how to build), and indicate
whether your underlying processor has AVX.

- Derek

> --
> You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
> To post to this group, send email to dynamor...@googlegroups.com.
> To unsubscribe from this group, send email to dynamorio-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/dynamorio-users?hl=en.
>

piper

unread,
Jan 4, 2012, 10:00:05 AM1/4/12
to DynamoRIO Users
Derek,

I built 64-bit DR on 11.10 64-bit VM under Parallels. Tested against
a small 64-bit app, ls, with strace and memtrace. Results were
normal. Next, tested against /usr/games/gnomine and got:

Running "/usr/games/gnomine "
ERROR: ld.so: object 'libdynamorio.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libdrpreload.so' from LD_PRELOAD cannot be
preloaded: ignored.

Ran the file program against gnomine to get:
/usr/games/gnomine: setgid ELF 64-bit LSB executable, x86-64, version
1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15,
stripped

Conclusion: Small apps work under 64-bit build, but more complex apps
may not, as in the case above.

Next, I will work on opening an issue, and posting the source code for
the net-aware app. At the bare metal level, we have an AVX
processor. This URL gives the specs:
http://ark.intel.com/products/50067/Intel-Core-i7-2720QM-Processor-(6M-Cache-2_20-GHz)

Regards,
Piper

Reid Kleckner

unread,
Jan 4, 2012, 10:37:27 AM1/4/12
to dynamor...@googlegroups.com
Those LD_PRELOAD errors look like 32/64 bit mismatches.  If /usr/games/gnomine is a 32-bit app use bin32/drrun to launch it and bin64/drrun if it is 64-bit.

Reid

Derek Bruening

unread,
Jan 4, 2012, 10:45:30 AM1/4/12
to dynamor...@googlegroups.com
On Wed, Jan 4, 2012 at 10:00 AM, piper <mmlm...@sbcglobal.net> wrote:
I built 64-bit DR on 11.10 64-bit VM under Parallels.  Tested against
a small 64-bit app, ls, with strace and memtrace.  Results were
normal.  Next, tested against /usr/games/gnomine and got:

Running "/usr/games/gnomine "
ERROR: ld.so: object 'libdynamorio.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libdrpreload.so' from LD_PRELOAD cannot be
preloaded: ignored.

There is no DR problem here.  /usr/games/gnomine has the sgid bit set, which means LD_PRELOAD cannot contain an absolute path.  You'll need to use /etc/ld.so.preload to inject into it (until we have our custom injector built).  See the Limitation section of the docs (which today mentions only suid-root but really any suid or sgid applies).

- Derek


Derek Bruening

unread,
Jan 4, 2012, 10:53:14 AM1/4/12
to dynamor...@googlegroups.com
On Wed, Jan 4, 2012 at 10:00 AM, piper <mmlm...@sbcglobal.net> wrote:
This assert is what we're most interested in.  Can you reproduce it?  Can you build the DR tests (pass -DBUILD_TESTS=ON to cmake) and run the linux.sigcontext test via "ctest -V -R sigcontext"?  Does it pass?

- Derek

piper

unread,
Jan 4, 2012, 11:51:40 AM1/4/12
to DynamoRIO Users
Derek,

Backed down to Ubuntu 10.04 VM 64-bit, and then compiled DynamoRIO
from source. Again under
Parallels. Configured it to cross-compile as before, and obtained
result identical to that listed in my original posting.

I have been building DR from the 3.0.1210 source. Maybe I should back
down to an earlier version of the source, like 2.2.0. Do I check that
out as read-only like the 3.0.1210 current version? If so, how do I
proceed? Will that help? As I related earlier, the underlying
processor is AVX.

My idea is to get on with some development work with a stable version
that installs fine on Ubuntu 10.04 VM 64-bit.

Regards,
Piper

On Jan 4, 9:53 am, Derek Bruening <bruen...@google.com> wrote:

piper

unread,
Jan 4, 2012, 12:24:12 PM1/4/12
to DynamoRIO Users
I have DR built from source on an Ubuntu 11.04 64-bit machine, bare
metal, no VM. The underlying processor is an Intel Xeon W3503 that
has SSE4.2 Instruction Set Extensions, and not AVX as for the other
cases I wrote about. Here, everything works beautifully. I have
cross-compiled, and have a 32-bit DR running against the same net-
aware application I used to test before. All results are normal. I
have written a complex client lib that works great, too. So, maybe
here the problem is the Vector Extensions.

On Jan 4, 9:53 am, Derek Bruening <bruen...@google.com> wrote:
Reply all
Reply to author
Forward
0 new messages