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

Building Dr. Memory from sources on Ubuntu x86_64 #6

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

Building Dr. Memory from sources on Ubuntu x86_64 #6

derekbruening opened this issue Nov 28, 2014 · 11 comments

Comments

@derekbruening
Copy link
Contributor

From [email protected] on June 11, 2010 11:35:42

$ ctest -S tests/runsuite.cmake
CMake Error at tests/runsuite.cmake:128 (message):
cannot find DynamoRIO VMKERNEL build at
/home/timurrrr/drmemory/SVN/trunk/tests/../../../exports_vmk/cmake
Error in read script: /home/timurrrr/drmemory/SVN/trunk/tests/runsuite.cmake

I've applied the following patch to do without VMK:
Index: tests/runsuite.cmake

--- tests/runsuite.cmake ( revision 16 )
+++ tests/runsuite.cmake (working copy)
@@ -123,11 +123,11 @@
endif (NOT EXISTS "${DR_path}")
endif (NOT arg_vmk_only)

-if (UNIX)

  • if (NOT EXISTS "${DRvmk_path}")
  • message(FATAL_ERROR "cannot find DynamoRIO VMKERNEL build at ${DRvmk_path}")
  • endif (NOT EXISTS "${DRvmk_path}")
    -endif (UNIX)
    +#if (UNIX)
    +# if (NOT EXISTS "${DRvmk_path}")
    +# message(FATAL_ERROR "cannot find DynamoRIO VMKERNEL build at ${DRvmk_path}")
    +# endif (NOT EXISTS "${DRvmk_path}")
    +#endif (UNIX)

allow setting the base cache variables via an include file

set(base_cache "")
@@ -368,18 +368,18 @@
" ON) # only run release tests for long suite
endif (NOT arg_vmk_only)
if (UNIX)

  • testbuild("${name}-vmk-debug-32" OFF "
  •  ${tool}
    
  •  DynamoRIO_DIR:PATH=${DRvmk_path}
    
  •  CMAKE_BUILD_TYPE:STRING=Debug
    
  •  VMKERNEL:BOOL=ON
    
  •  " OFF)
    
  • testbuild("${name}-vmk-release-32" OFF "
  •  ${tool}
    
  •  DynamoRIO_DIR:PATH=${DRvmk_path}
    
  •  CMAKE_BUILD_TYPE:STRING=Release
    
  •  VMKERNEL:BOOL=ON
    
  •  " ON) # only run release tests for long suite
    
  • #testbuild("${name}-vmk-debug-32" OFF "
  • ${tool}

  • DynamoRIO_DIR:PATH=${DRvmk_path}

  • CMAKE_BUILD_TYPE:STRING=Debug

  • VMKERNEL:BOOL=ON

  • " OFF)

  • #testbuild("${name}-vmk-release-32" OFF "
  • ${tool}

  • DynamoRIO_DIR:PATH=${DRvmk_path}

  • CMAKE_BUILD_TYPE:STRING=Release

  • VMKERNEL:BOOL=ON

  • " ON) # only run release tests for long suite

else (UNIX)
if ("${tool}" MATCHES "MEMORY")
# No online symbol support for cygwin yet so using separate build

Then
$ ctest -S tests/runsuite.cmake
Error(s) when building project
No tests were found!!!

RESULTS

drheapstat-debug-32: **** pre-build configure errors ****
drheapstat-release-32: **** pre-build configure errors ****
drmemory-debug-32: **** 50 build errors ****
/.../trunk/drmemory/syscall_linux.c:50:59: error: asm-i386/stat.h: No such file or directory
/.../trunk/drmemory/syscall_linux.c:78:21: error: asm/ipc.h: No such file or directory
/.../trunk/drmemory/syscall_linux.c:116:29: error: linux/umsdos_fs.h: No such file or directory
/.../trunk/drmemory/syscall_linux.c:251: error: invalid application of ‘sizeof’ to incomplete type ‘struct __old_kernel_stat’
<... and more errors ...>

Looks like Kostya had the same issues earlier but he doesn't remember whether he succeeded in building Dr.Memory for Linux: https://groups.google.com/group/drmemory-users/browse_thread/thread/9769aadd7bb197b5?pli=1

Original issue: http://code.google.com/p/drmemory/issues/detail?id=6

@derekbruening
Copy link
Contributor Author

From [email protected] on June 11, 2010 08:41:17

Looks like I've worked around the #include issues with the following patch:
Index: drmemory/syscall_linux.c

--- drmemory/syscall_linux.c ( revision 16 )
+++ drmemory/syscall_linux.c (working copy)
@@ -38,13 +38,11 @@
#define __USE_GNU 1

#include <sys/types.h>
-#if 0
+#if 1
/* FIXME PR 413981: need portable inclusion of these types:

  • For Ubuntu 9.04 x64 this works:
    _/

    include <asm/stat.h>

    -# include <sys/ustat.h>
    -# include <sys/statfs.h>
    #else
    /_ What's needed on FC10 x64 _/

    include <asm-i386/stat.h> /_ struct __old_kernel_stat */

    @@ -75,7 +73,6 @@

    /* ipc /
    #include <sys/ipc.h>
    -#include <asm/ipc.h>
    #include <sys/sem.h>
    #include <sys/shm.h>
    #include <sys/msg.h>
    @@ -113,7 +110,7 @@
    #include <linux/route.h>
    #include <linux/if_arp.h>
    #include <linux/soundcard.h>
    -#include <linux/umsdos_fs.h>
    +#include <linux/msdos_fs.h>
    #include <linux/vt.h>
    #include <linux/ipmi.h> /
    PR 531644 */

==END=OF=PATCH==

@derekbruening
Copy link
Contributor Author

From [email protected] on June 11, 2010 08:53:23

Now it fails with

drmemory-debug-32: **** 50 build errors ****
/.../trunk/drmemory/syscall_linux.c:329: error: invalid application of ‘sizeof’ to incomplete type ‘struct statfs’
/.../trunk/drmemory/syscall_linux.c:330: error: invalid application of ‘sizeof’ to incomplete type ‘struct statfs’
/.../trunk/drmemory/syscall_linux.c:1138: error: ‘MTIOCGETCONFIG’ undeclared (first use in this function)
/.../trunk/drmemory/syscall_linux.c:1138: error: (Each undeclared identifier is reported only once
/.../trunk/drmemory/syscall_linux.c:1138: error: for each function it appears in.)
/.../trunk/drmemory/syscall_linux.c:1138: error: invalid application of ‘sizeof’ to incomplete type ‘struct mtconfiginfo’
/.../trunk/drmemory/syscall_linux.c:1139: error: ‘MTIOCSETCONFIG’ undeclared (first use in this function)
<...>

@derekbruening
Copy link
Contributor Author

From [email protected] on August 04, 2010 07:12:04

Labels: Component-Build

@derekbruening
Copy link
Contributor Author

From [email protected] on August 20, 2010 07:37:24

Derek,
What version of Linux do you use? FC10?
I can create a VM with that version Linux and try to fix the build issues so Dr. Memory is buildable on (at least) that version of Linux + Ubuntu.

Cc: derek.bruening

@derekbruening
Copy link
Contributor Author

From [email protected] on August 20, 2010 07:50:59

I'm using FC12 now, but building with gcc 4.1.2 and glibc-2.2.5-44 headers.

here are my notes on the issue:

[linux] portable inclusion of syscall types

on different platforms the header files needed for our very specific kernel
syscall arg struct types vary and it's going to be a pain to get it right
everywhere.

xref linux build broken on gcc 4.4

Since this is open-source it would be nice to support more recent gcc
versions so that external contributors can actually build and run the test
suite.

native gcc (4.4.3) on my FC12 box:
drmemory/syscall_linux.c:50:59: error: asm-i386/stat.h: No such file or directory
drmemory/syscall_linux.c:78:21: error: asm/ipc.h: No such file or directory
In file included from drmemory/syscall_linux.c:98:
/usr/include/linux/ext2_fs.h: In function ‘ext2_mask_flags’:
drmemory/syscall_linux.c:116:29: error: linux/umsdos_fs.h: No such file or directory
...

Probably the right approach is to use CMake to locate the header files for
each particular platform. If there are struct differences we'll have to
add that complexity to syscall_linux.c.

@derekbruening
Copy link
Contributor Author

From [email protected] on August 20, 2010 08:01:26

FC12 -> x86 or x64_64?
Do you plan to upgrade to FC13?

@derekbruening
Copy link
Contributor Author

From [email protected] on August 20, 2010 08:21:15

FC12 x86_64, though see above: what really matters is what gcc and include headers are used and mine are from a toolchain and not from FC12.

no, no plans to upgrade in immediate future, since very latest FC kernels often have problems w/ VMware Workstation

@derekbruening
Copy link
Contributor Author

From [email protected] on November 30, 2010 12:17:39

Derek,
can you please try building DynamoRIO/DrMemory on Lucid x86_64?
I think we have the same environment now.

Also, can you please post the shell commands to build DR+DrM on Linux so I can try setting up a buildbot?

@derekbruening
Copy link
Contributor Author

From [email protected] on December 02, 2010 09:03:45

with r99 Dr. Memory now builds on Lucid and FC12 x64

there are still 3 issues:

  1. tests/loader fails for two reasons: issue uninit and unaddr in loader _dl_rtld_di_serinfo + _dl_make_stack_executable #79 , and b/c it uses hardcoded paths
  2. tests/suppress contains hardcoded offsets
  3. Dr. Heapstat requires Flex + Java to build

Owner: [email protected]
Cc: -derek.bruening [email protected]

@derekbruening
Copy link
Contributor Author

From [email protected] on December 07, 2010 18:45:04

tests are fixed in r102 , r103 , r105 along with issue #80 I will write up instructions for Flex on a wiki page

resolving this issue

Status: Verified

@derekbruening
Copy link
Contributor Author

From [email protected] on December 10, 2010 18:02:54

Issue 126 has been merged into this issue.

gregcawthorne added a commit that referenced this issue Apr 17, 2021
AArch64 port of drmemory.

Only contains slowpath support with shared_slowpath off.

Pattern mode and fastpath modes are being worked on separately.

Depends on:
https://github.com/DynamoRIO/dynamorio/tree/mem-ref-for-clean-calls-aarch64/core

Current tests we have analysed:
Test project /home/grecaw01/APD-testing/drmem-upstream3/drmemory/build
      Start  1: drmf_proj
 1/49 Test  #1: drmf_proj .........................   Passed    0.45 sec
      Start  2: unit_tests
 2/49 Test  #2: unit_tests ........................   Passed    0.02 sec
      Start  3: hello
 3/49 Test  #3: hello .............................   Passed    3.55 sec
      Start  4: free
 4/49 Test  #4: free ..............................   Passed    3.67 sec
      Start  5: malloc
 5/49 Test  #5: malloc ............................   Passed    3.88 sec
      Start  6: leak_indirect
 6/49 Test  #6: leak_indirect .....................   Passed    3.52 sec
      Start  7: patterns
 7/49 Test  #7: patterns ..........................   Passed    3.93 sec
      Start  8: free.exitcode
 8/49 Test  #8: free.exitcode .....................   Passed    3.64 sec
      Start  9: track_origins
 9/49 Test  #9: track_origins .....................***Failed    0.34 sec
      Start 10: free.pattern
10/49 Test #10: free.pattern ......................***Failed    0.35 sec
      Start 11: malloc.pattern
11/49 Test #11: malloc.pattern ....................***Failed    0.34 sec
      Start 12: track_origins.pattern
12/49 Test #12: track_origins.pattern .............***Failed    0.34 sec
      Start 13: fuzz_corpus
13/49 Test #13: fuzz_corpus .......................   Passed    3.56 sec
      Start 14: fuzz_buffer
14/49 Test #14: fuzz_buffer .......................   Passed    4.62 sec
      Start 15: fuzz_buffer.replace_buffer
15/49 Test #15: fuzz_buffer.replace_buffer ........   Passed    4.62 sec
      Start 16: fuzz_buffer.overflow
16/49 Test #16: fuzz_buffer.overflow ..............***Failed    0.34 sec
      Start 17: fuzz_buffer.mutator.o-b-s-3
17/49 Test #17: fuzz_buffer.mutator.o-b-s-3 .......   Passed    4.59 sec
      Start 18: fuzz_buffer.mutator.r-b-s-3
18/49 Test #18: fuzz_buffer.mutator.r-b-s-3 .......   Passed    4.63 sec
      Start 19: fuzz_buffer.mutator.o-b-3
19/49 Test #19: fuzz_buffer.mutator.o-b-3 .........   Passed    4.60 sec
      Start 20: fuzz_buffer.mutator.r-n
20/49 Test #20: fuzz_buffer.mutator.r-n ...........   Passed    4.54 sec
      Start 21: fuzz_buffer.mutator.random_seed
21/49 Test #21: fuzz_buffer.mutator.random_seed ...   Passed    4.57 sec
      Start 22: fuzz_buffer.one-input
22/49 Test #22: fuzz_buffer.one-input .............   Passed    3.82 sec
      Start 23: fuzz_buffer.load_input
23/49 Test #23: fuzz_buffer.load_input ............   Passed    3.81 sec
      Start 24: fuzz_buffer.skip_initial
24/49 Test #24: fuzz_buffer.skip_initial ..........   Passed    4.01 sec
      Start 25: fuzz_buffer.fixed_size
25/49 Test #25: fuzz_buffer.fixed_size ............   Passed    5.36 sec
      Start 26: fuzz_buffer.offset
26/49 Test #26: fuzz_buffer.offset ................   Passed    5.42 sec
      Start 27: fuzz_buffer.module_name
27/49 Test #27: fuzz_buffer.module_name ...........   Passed    4.58 sec
      Start 28: fuzz_buffer.dictionary
28/49 Test #28: fuzz_buffer.dictionary ............   Passed    4.20 sec
      Start 29: fuzz_buffer.cpp
29/49 Test #29: fuzz_buffer.cpp ...................   Passed   17.77 sec
      Start 30: fuzz_custom_mutator
30/49 Test #30: fuzz_custom_mutator ...............   Passed    4.57 sec
      Start 31: drsyscall_test
31/49 Test #31: drsyscall_test ....................   Passed    0.22 sec
      Start 32: strace_test
32/49 Test #32: strace_test .......................   Passed    0.22 sec
      Start 33: drfuzz_test_empty
33/49 Test #33: drfuzz_test_empty .................   Passed    0.22 sec
      Start 34: drfuzz_test_mutator
34/49 Test #34: drfuzz_test_mutator ...............   Passed    2.38 sec
      Start 35: drfuzz_test_repeat
35/49 Test #35: drfuzz_test_repeat ................***Failed
      Start 36: drfuzz_test_segfault
36/49 Test #36: drfuzz_test_segfault ..............   Passed    0.20 sec
      Start 37: drfuzz_test_app_abort
37/49 Test #37: drfuzz_test_app_abort .............   Passed    0.22 sec
      Start 38: drfuzz_test_no_crash
38/49 Test #38: drfuzz_test_no_crash ..............   Passed    0.22 sec
      Start 39: umbra_test_empty
39/49 Test #39: umbra_test_empty ..................   Passed    0.22 sec
      Start 40: umbra_test_overlap
40/49 Test #40: umbra_test_overlap ................   Passed    0.23 sec
      Start 41: umbra_test_shadow_mem
41/49 Test #41: umbra_test_shadow_mem .............   Passed    0.30 sec
      Start 42: umbra_test_insert_app_to_shadow
42/49 Test #42: umbra_test_insert_app_to_shadow ...   Passed    0.29 sec
      Start 43: umbra_test_consistency
43/49 Test #43: umbra_test_consistency ............   Passed    0.30 sec
      Start 44: umbra_test_allscales
44/49 Test #44: umbra_test_allscales ..............   Passed    0.39 sec
      Start 45: drltrace
45/49 Test #45: drltrace ..........................   Passed    0.35 sec
      Start 46: drltrace_libcalls
46/49 Test #46: drltrace_libcalls .................   Passed    0.36 sec
      Start 47: drltrace_symargs
47/49 Test #47: drltrace_symargs ..................   Passed    0.36 sec
      Start 48: drltrace_libargs
48/49 Test #48: drltrace_libargs ..................   Passed    0.35 sec
      Start 49: strace_sample
49/49 Test #49: strace_sample .....................   Passed    0.22 sec

88% tests passed, 6 tests failed out of 49
gregcawthorne added a commit that referenced this issue Apr 17, 2021
AArch64 port of drmemory.

Only contains slowpath support with shared_slowpath off.

Pattern mode and fastpath modes are being worked on separately.

Currently this build does break some x86 functionality.

Depends on:
https://github.com/DynamoRIO/dynamorio/tree/mem-ref-for-clean-calls-aarch64/core

Current tests we have analysed:
Test project /home/grecaw01/APD-testing/drmem-upstream3/drmemory/build
      Start  1: drmf_proj
 1/49 Test  #1: drmf_proj .........................   Passed    0.45 sec
      Start  2: unit_tests
 2/49 Test  #2: unit_tests ........................   Passed    0.02 sec
      Start  3: hello
 3/49 Test  #3: hello .............................   Passed    3.55 sec
      Start  4: free
 4/49 Test  #4: free ..............................   Passed    3.67 sec
      Start  5: malloc
 5/49 Test  #5: malloc ............................   Passed    3.88 sec
      Start  6: leak_indirect
 6/49 Test  #6: leak_indirect .....................   Passed    3.52 sec
      Start  7: patterns
 7/49 Test  #7: patterns ..........................   Passed    3.93 sec
      Start  8: free.exitcode
 8/49 Test  #8: free.exitcode .....................   Passed    3.64 sec
      Start  9: track_origins
 9/49 Test  #9: track_origins .....................***Failed    0.34 sec
      Start 10: free.pattern
10/49 Test #10: free.pattern ......................***Failed    0.35 sec
      Start 11: malloc.pattern
11/49 Test #11: malloc.pattern ....................***Failed    0.34 sec
      Start 12: track_origins.pattern
12/49 Test #12: track_origins.pattern .............***Failed    0.34 sec
      Start 13: fuzz_corpus
13/49 Test #13: fuzz_corpus .......................   Passed    3.56 sec
      Start 14: fuzz_buffer
14/49 Test #14: fuzz_buffer .......................   Passed    4.62 sec
      Start 15: fuzz_buffer.replace_buffer
15/49 Test #15: fuzz_buffer.replace_buffer ........   Passed    4.62 sec
      Start 16: fuzz_buffer.overflow
16/49 Test #16: fuzz_buffer.overflow ..............***Failed    0.34 sec
      Start 17: fuzz_buffer.mutator.o-b-s-3
17/49 Test #17: fuzz_buffer.mutator.o-b-s-3 .......   Passed    4.59 sec
      Start 18: fuzz_buffer.mutator.r-b-s-3
18/49 Test #18: fuzz_buffer.mutator.r-b-s-3 .......   Passed    4.63 sec
      Start 19: fuzz_buffer.mutator.o-b-3
19/49 Test #19: fuzz_buffer.mutator.o-b-3 .........   Passed    4.60 sec
      Start 20: fuzz_buffer.mutator.r-n
20/49 Test #20: fuzz_buffer.mutator.r-n ...........   Passed    4.54 sec
      Start 21: fuzz_buffer.mutator.random_seed
21/49 Test #21: fuzz_buffer.mutator.random_seed ...   Passed    4.57 sec
      Start 22: fuzz_buffer.one-input
22/49 Test #22: fuzz_buffer.one-input .............   Passed    3.82 sec
      Start 23: fuzz_buffer.load_input
23/49 Test #23: fuzz_buffer.load_input ............   Passed    3.81 sec
      Start 24: fuzz_buffer.skip_initial
24/49 Test #24: fuzz_buffer.skip_initial ..........   Passed    4.01 sec
      Start 25: fuzz_buffer.fixed_size
25/49 Test #25: fuzz_buffer.fixed_size ............   Passed    5.36 sec
      Start 26: fuzz_buffer.offset
26/49 Test #26: fuzz_buffer.offset ................   Passed    5.42 sec
      Start 27: fuzz_buffer.module_name
27/49 Test #27: fuzz_buffer.module_name ...........   Passed    4.58 sec
      Start 28: fuzz_buffer.dictionary
28/49 Test #28: fuzz_buffer.dictionary ............   Passed    4.20 sec
      Start 29: fuzz_buffer.cpp
29/49 Test #29: fuzz_buffer.cpp ...................   Passed   17.77 sec
      Start 30: fuzz_custom_mutator
30/49 Test #30: fuzz_custom_mutator ...............   Passed    4.57 sec
      Start 31: drsyscall_test
31/49 Test #31: drsyscall_test ....................   Passed    0.22 sec
      Start 32: strace_test
32/49 Test #32: strace_test .......................   Passed    0.22 sec
      Start 33: drfuzz_test_empty
33/49 Test #33: drfuzz_test_empty .................   Passed    0.22 sec
      Start 34: drfuzz_test_mutator
34/49 Test #34: drfuzz_test_mutator ...............   Passed    2.38 sec
      Start 35: drfuzz_test_repeat
35/49 Test #35: drfuzz_test_repeat ................***Failed
      Start 36: drfuzz_test_segfault
36/49 Test #36: drfuzz_test_segfault ..............   Passed    0.20 sec
      Start 37: drfuzz_test_app_abort
37/49 Test #37: drfuzz_test_app_abort .............   Passed    0.22 sec
      Start 38: drfuzz_test_no_crash
38/49 Test #38: drfuzz_test_no_crash ..............   Passed    0.22 sec
      Start 39: umbra_test_empty
39/49 Test #39: umbra_test_empty ..................   Passed    0.22 sec
      Start 40: umbra_test_overlap
40/49 Test #40: umbra_test_overlap ................   Passed    0.23 sec
      Start 41: umbra_test_shadow_mem
41/49 Test #41: umbra_test_shadow_mem .............   Passed    0.30 sec
      Start 42: umbra_test_insert_app_to_shadow
42/49 Test #42: umbra_test_insert_app_to_shadow ...   Passed    0.29 sec
      Start 43: umbra_test_consistency
43/49 Test #43: umbra_test_consistency ............   Passed    0.30 sec
      Start 44: umbra_test_allscales
44/49 Test #44: umbra_test_allscales ..............   Passed    0.39 sec
      Start 45: drltrace
45/49 Test #45: drltrace ..........................   Passed    0.35 sec
      Start 46: drltrace_libcalls
46/49 Test #46: drltrace_libcalls .................   Passed    0.36 sec
      Start 47: drltrace_symargs
47/49 Test #47: drltrace_symargs ..................   Passed    0.36 sec
      Start 48: drltrace_libargs
48/49 Test #48: drltrace_libargs ..................   Passed    0.35 sec
      Start 49: strace_sample
49/49 Test #49: strace_sample .....................   Passed    0.22 sec

88% tests passed, 6 tests failed out of 49
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