Skip to content

perftools-2.0.0 fails to build on Linux debian 2.6.32-5-amd64 VM on Vagrant. #64

Open

Description

@weiser

I'm running a bundled project (bundler 1.8.25) which is using perftools.rb v2.0.0. I'm running it on a debian VM (2.6.32-5-amd64) within Vagrant

When I run bundle, it fails when installing perftools.rb (2.0.0)

gem_make.out contains:

    /home/vagrant/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
(I'm about to compile google-perftools.. this will definitely take a while)
  -- tar zpxvf gperftools-2.0.tar.gz
  -- patch -p1 < ../../../patches/perftools.patch
  -- patch -p1 < ../../../patches/perftools-notests.patch
  -- patch -p1 < ../../../patches/perftools-pprof.patch
  -- patch -p1 < ../../../patches/perftools-gc.patch
  -- patch -p1 < ../../../patches/perftools-debug.patch
  -- patch -p1 < ../../../patches/perftools-objects.patch
  -- patch -p1 < ../../../patches/perftools-frames.patch
  -- patch -p1 < ../../../patches/perftools-realtime.patch
  -- sed -i -e 's,SpinLock,ISpinLock,g' src/*.cc src/*.h src/base/*.cc src/base/*.h
  -- ./configure --disable-heap-profiler --disable-heap-checker --disable-debugalloc --disable-shared
  -- make
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/vagrant/.rvm/rubies/ruby-1.9.2-p320/bin/ruby
extconf.rb:6:in `sys': make failed, please report to https://github.com/tmm1/perfools.rb/issues/new with /silo/bundle/ruby/1.9.1/gems/perftools.rb-2.0.0/ext/src/mkmf.log and /silo/bundle/ruby/1.9.1/gems/perftools.rb-2.0.0/ext/src/gperftools-2.0/config.log (RuntimeError)
        from extconf.rb:77:in `block (2 levels) in <main>'
        from extconf.rb:72:in `chdir'
        from extconf.rb:72:in `block in <main>'
        from extconf.rb:36:in `chdir'
        from extconf.rb:36:in `<main>'

I've attached the mkmf.log and the config.log. It looks like HAVE_MMAP is not set, but it is unclear to me how to go about fixing that.

The mkmf.log: https://gist.github.com/davidann/5919666
The config.log: https://gist.github.com/davidann/5919641

Activity

  1. tmm1 commented on Jul 8, 2013

    @tmm1
    Owner

    Very strange. I'm using perftools on debian lenny and squeeze machines without issue.

    Maybe you can try the mmap test program to see why its failing:

    configure:15430: checking for working mmap
    configure:15577: gcc -o conftest -g -O2   conftest.c  >&5
    configure:15577: $? = 0
    configure:15577: ./conftest
    configure:15577: $? = 6
    configure: program exited with status 6
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME "gperftools"
    | #define PACKAGE_TARNAME "gperftools"
    | #define PACKAGE_VERSION "2.0"
    | #define PACKAGE_STRING "gperftools 2.0"
    | #define PACKAGE_BUGREPORT "google-perftools@googlegroups.com"
    | #define PACKAGE_URL ""
    | #define PACKAGE "gperftools"
    | #define VERSION "2.0"
    | #define STDC_HEADERS 1
    | #define HAVE_SYS_TYPES_H 1
    | #define HAVE_SYS_STAT_H 1
    | #define HAVE_STDLIB_H 1
    | #define HAVE_STRING_H 1
    | #define HAVE_MEMORY_H 1
    | #define HAVE_STRINGS_H 1
    | #define HAVE_INTTYPES_H 1
    | #define HAVE_STDINT_H 1
    | #define HAVE_UNISTD_H 1
    | #define HAVE_DLFCN_H 1
    | #define LT_OBJDIR ".libs/"
    | #define HAVE___ATTRIBUTE__ 1
    | #define STDC_HEADERS 1
    | #define HAVE_STRUCT_MALLINFO 1
    | #define HAVE_ELF32_VERSYM 1
    | #define HAVE_SBRK 1
    | #define HAVE_GETEUID 1
    | #define HAVE_FEATURES_H 1
    | #define HAVE_MALLOC_H 1
    | #define HAVE_GLOB_H 1
    | #define HAVE_EXECINFO_H 1
    | #define HAVE_UNWIND_H 1
    | #define HAVE_SCHED_H 1
    | #define HAVE_SYS_PRCTL_H 1
    | #define HAVE_LINUX_PTRACE_H 1
    | #define HAVE_SYS_SYSCALL_H 1
    | #define HAVE_SYS_SOCKET_H 1
    | #define HAVE_SYS_WAIT_H 1
    | #define HAVE_POLL_H 1
    | #define HAVE_FCNTL_H 1
    | #define HAVE_GRP_H 1
    | #define HAVE_PWD_H 1
    | #define HAVE_SYS_RESOURCE_H 1
    | #define HAVE_SYS_CDEFS_H 1
    | #define HAVE_FEATURES_H 1
    | #define HAVE_DECL_CFREE 1
    | #define HAVE_DECL_POSIX_MEMALIGN 1
    | #define HAVE_DECL_MEMALIGN 1
    | #define HAVE_DECL_VALLOC 1
    | #define HAVE_DECL_PVALLOC 1
    | #define HAVE_STDLIB_H 1
    | #define HAVE_UNISTD_H 1
    | #define HAVE_SYS_PARAM_H 1
    | #define HAVE_GETPAGESIZE 1
    | /* end confdefs.h.  */
    | #include <stdio.h>
    | #ifdef HAVE_SYS_TYPES_H
    | # include <sys/types.h>
    | #endif
    | #ifdef HAVE_SYS_STAT_H
    | # include <sys/stat.h>
    | #endif
    | #ifdef STDC_HEADERS
    | # include <stdlib.h>
    | # include <stddef.h>
    | #else
    | # ifdef HAVE_STDLIB_H
    | #  include <stdlib.h>
    | # endif
    | #endif
    | #ifdef HAVE_STRING_H
    | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
    | #  include <memory.h>
    | # endif
    | # include <string.h>
    | #endif
    | #ifdef HAVE_STRINGS_H
    | # include <strings.h>
    | #endif
    | #ifdef HAVE_INTTYPES_H
    | # include <inttypes.h>
    | #endif
    | #ifdef HAVE_STDINT_H
    | # include <stdint.h>
    | #endif
    | #ifdef HAVE_UNISTD_H
    | # include <unistd.h>
    | #endif
    | /* malloc might have been renamed as rpl_malloc. */
    | #undef malloc
    | 
    | /* Thanks to Mike Haertel and Jim Avera for this test.
    |    Here is a matrix of mmap possibilities:
    |   mmap private not fixed
    |   mmap private fixed at somewhere currently unmapped
    |   mmap private fixed at somewhere already mapped
    |   mmap shared not fixed
    |   mmap shared fixed at somewhere currently unmapped
    |   mmap shared fixed at somewhere already mapped
    |    For private mappings, we should verify that changes cannot be read()
    |    back from the file, nor mmap's back from the file at a different
    |    address.  (There have been systems where private was not correctly
    |    implemented like the infamous i386 svr4.0, and systems where the
    |    VM page cache was not coherent with the file system buffer cache
    |    like early versions of FreeBSD and possibly contemporary NetBSD.)
    |    For shared mappings, we should conversely verify that changes get
    |    propagated back to all the places they're supposed to be.
    | 
    |    Grep wants private fixed already mapped.
    |    The main things grep needs to know about mmap are:
    |    * does it exist and is it safe to write into the mmap'd area
    |    * how to use it (BSD variants)  */
    | 
    | #include <fcntl.h>
    | #include <sys/mman.h>
    | 
    | #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
    | char *malloc ();
    | #endif
    | 
    | /* This mess was copied from the GNU getpagesize.h.  */
    | #ifndef HAVE_GETPAGESIZE
    | # ifdef _SC_PAGESIZE
    | #  define getpagesize() sysconf(_SC_PAGESIZE)
    | # else /* no _SC_PAGESIZE */
    | #  ifdef HAVE_SYS_PARAM_H
    | #   include <sys/param.h>
    | #   ifdef EXEC_PAGESIZE
    | #    define getpagesize() EXEC_PAGESIZE
    | #   else /* no EXEC_PAGESIZE */
    | #    ifdef NBPG
    | #     define getpagesize() NBPG * CLSIZE
    | #     ifndef CLSIZE
    | #      define CLSIZE 1
    | #     endif /* no CLSIZE */
    | #    else /* no NBPG */
    | #     ifdef NBPC
    | #      define getpagesize() NBPC
    | #     else /* no NBPC */
    | #      ifdef PAGESIZE
    | #       define getpagesize() PAGESIZE
    | #      endif /* PAGESIZE */
    | #     endif /* no NBPC */
    | #    endif /* no NBPG */
    | #   endif /* no EXEC_PAGESIZE */
    | #  else /* no HAVE_SYS_PARAM_H */
    | #   define getpagesize() 8192 /* punt totally */
    | #  endif /* no HAVE_SYS_PARAM_H */
    | # endif /* no _SC_PAGESIZE */
    | 
    | #endif /* no HAVE_GETPAGESIZE */
    | 
    | int
    | main ()
    | {
    |   char *data, *data2, *data3;
    |   const char *cdata2;
    |   int i, pagesize;
    |   int fd, fd2;
    | 
    |   pagesize = getpagesize ();
    | 
    |   /* First, make a file with some known garbage in it. */
    |   data = (char *) malloc (pagesize);
    |   if (!data)
    |     return 1;
    |   for (i = 0; i < pagesize; ++i)
    |     *(data + i) = rand ();
    |   umask (0);
    |   fd = creat ("conftest.mmap", 0600);
    |   if (fd < 0)
    |     return 2;
    |   if (write (fd, data, pagesize) != pagesize)
    |     return 3;
    |   close (fd);
    | 
    |   /* Next, check that the tail of a page is zero-filled.  File must have
    |      non-zero length, otherwise we risk SIGBUS for entire page.  */
    |   fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
    |   if (fd2 < 0)
    |     return 4;
    |   cdata2 = "";
    |   if (write (fd2, cdata2, 1) != 1)
    |     return 5;
    |   data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
    |   if (data2 == MAP_FAILED)
    |     return 6;
    |   for (i = 0; i < pagesize; ++i)
    |     if (*(data2 + i))
    |       return 7;
    |   close (fd2);
    |   if (munmap (data2, pagesize))
    |     return 8;
    | 
    |   /* Next, try to mmap the file at a fixed address which already has
    |      something else allocated at it.  If we can, also make sure that
    |      we see the same garbage.  */
    |   fd = open ("conftest.mmap", O_RDWR);
    |   if (fd < 0)
    |     return 9;
    |   if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
    |            MAP_PRIVATE | MAP_FIXED, fd, 0L))
    |     return 10;
    |   for (i = 0; i < pagesize; ++i)
    |     if (*(data + i) != *(data2 + i))
    |       return 11;
    | 
    |   /* Finally, make sure that changes to the mapped area do not
    |      percolate back to the file as seen by read().  (This is a bug on
    |      some variants of i386 svr4.0.)  */
    |   for (i = 0; i < pagesize; ++i)
    |     *(data2 + i) = *(data2 + i) + 1;
    |   data3 = (char *) malloc (pagesize);
    |   if (!data3)
    |     return 12;
    |   if (read (fd, data3, pagesize) != pagesize)
    |     return 13;
    |   for (i = 0; i < pagesize; ++i)
    |     if (*(data + i) != *(data3 + i))
    |       return 14;
    |   close (fd);
    |   return 0;
    | }
    configure:15587: result: no
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions