Error when trying to install vine 1.0 on Ubuntu 14.04

116 views
Skip to first unread message

L M Rojas Aguilera

unread,
Apr 11, 2016, 3:34:54 PM4/11/16
to BitBlaze User Discussion group
Hi, i would like to use Vine but after completing the instructions for installation here: http://bitblaze.cs.berkeley.edu/release/vine-1.0/howto.html  i get this errors: Thanks in advance.

In file included from ./disasm/asm_program.cpp:16:0:
/usr/include/libiberty/libiberty.h:110:38: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
                                      ^
/usr/include/libiberty/libiberty.h:121:45: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern const char *lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
                                             ^
/usr/include/libiberty/libiberty.h:126:49: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern const char *dos_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
                                                 ^
/usr/include/libiberty/libiberty.h:132:50: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern const char *unix_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
                                                  ^
/usr/include/libiberty/libiberty.h:142:58: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *concat (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
                                                          ^
/usr/include/libiberty/libiberty.h:151:68: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *reconcat (char *, const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
                                                                    ^
/usr/include/libiberty/libiberty.h:164:54: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
                                                      ^
/usr/include/libiberty/libiberty.h:171:47: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *concat_copy2 (const char *, ...) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
                                               ^
/usr/include/libiberty/libiberty.h:229:55: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *choose_temp_base (void) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
                                                       ^
/usr/include/libiberty/libiberty.h:259:30: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *xstrerror (int) ATTRIBUTE_RETURNS_NONNULL;
                              ^
/usr/include/libiberty/libiberty.h:301:48: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern void *xmalloc (size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
                                                ^
/usr/include/libiberty/libiberty.h:307:40: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern void *xrealloc (void *, size_t) ATTRIBUTE_RETURNS_NONNULL;
                                        ^
/usr/include/libiberty/libiberty.h:312:56: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern void *xcalloc (size_t, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
                                                        ^
/usr/include/libiberty/libiberty.h:316:54: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *xstrdup (const char *) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
                                                      ^
/usr/include/libiberty/libiberty.h:320:63: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern char *xstrndup (const char *, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
                                                               ^
/usr/include/libiberty/libiberty.h:324:70: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
 extern void *xmemdup (const void *, size_t, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
                                                                      ^
/usr/include/libiberty/libiberty.h:402:28: error: expected initializer before ‘ATTRIBUTE_RETURNS_NONNULL’
      const char *tempbase) ATTRIBUTE_RETURNS_NONNULL;
                            ^
./disasm/asm_program.cpp: In function ‘bfd_byte* get_ptr_to_instr(asm_program_t*, bfd_vma)’:
./disasm/asm_program.cpp:76:57: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘bfd_vma {aka long unsigned int}’ [-Wformat=]
     fprintf(stderr, "Segment for %llx not found\n", addr);
                                                         ^
./disasm/asm_program.cpp: In function ‘std::map<long unsigned int, asm_function*> identify_functions(std::map<long unsigned int, _segment*>, bfd*)’:
./disasm/asm_program.cpp:336:47: error: ‘xmalloc’ was not declared in this scope
   symtbl = (asymbol **) xmalloc(storage_needed);
                                               ^
./disasm/asm_program.cpp: In function ‘bfd* initialize_bfd(const char*)’:
./disasm/asm_program.cpp:520:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
   char *target = "i686-pc-linux-gnu";
                  ^
./disasm/asm_program.cpp: In function ‘vine_symbols_t* get_symbols_of_file(const char*)’:
./disasm/asm_program.cpp:570:40: error: ‘xmalloc’ was not declared in this scope
      syms = (asymbol**) xmalloc(storage);
                                        ^
./disasm/asm_program.cpp:590:39: error: ‘xmalloc’ was not declared in this scope
  dynsyms = (asymbol**) xmalloc(storage);
                                       ^
./disasm/asm_program.cpp: In function ‘dyn_functions_t* get_synthetic_symbols(const char*)’:
./disasm/asm_program.cpp:670:40: error: ‘xmalloc’ was not declared in this scope
      syms = (asymbol**) xmalloc(storage);
                                        ^
./disasm/asm_program.cpp:678:39: error: ‘xmalloc’ was not declared in this scope
  dynsyms = (asymbol**) xmalloc(storage);
                                       ^
make[3]: *** [asm_program.o] Error 1

Stephen McCamant

unread,
Aug 30, 2016, 2:22:30 PM8/30/16
to bitblaz...@googlegroups.com
>>>>> "LMRA" == L M Rojas Aguilera <L> writes:

LMRA> Hi, i would like to use Vine but after completing the
LMRA> instructions for installation here:
LMRA> http://bitblaze.cs.berkeley.edu/release/vine-1.0/howto.html i get this
LMRA> errors: Thanks in advance.

LMRA> In file included from ./disasm/asm_program.cpp:16:0:
LMRA> /usr/include/libiberty/libiberty.h:110:38: error: expected initializer
LMRA> before `ATTRIBUTE_RETURNS_NONNULL'
[...]
LMRA> ./disasm/asm_program.cpp: In function `std::map<long unsigned int,
LMRA> asm_function*> identify_functions(std::map<long unsigned int, _segment*>,
LMRA> bfd*)':
LMRA> ./disasm/asm_program.cpp:336:47: error: `xmalloc' was not declared in this
LMRA> scope
[...]

Since Vine 1.0 was originally tested with a 5-years older version of
Ubuntu, it isn't really surprising that some incompatibilities arise
if you try to compile it with much newer versions of the prerequisite
software. If you got a chance to check the mailing list archives, you
might see that there was someone else back in 2014 who tried this same
combination, and got stuck at the same point. At the time I replied
with some general suggestions, but I don't recall hearing at the time
whether the user managed to figure things out.

Since several months have passed since your email, I'm guessing you've
either fixed the problems yourself or given up by now, but I noticed
your question again in the archives recently, and had time to test
Vine 1.0 on an Ubuntu 14.04 VM. (In fact my desktop machine also
currently runs 14.04 as the host OS, but some things work differently
because we compile a lot of our own software there instead of using
Ubuntu packages.)

All the error messages you quote here are related to not bringing in
the libiberty include files correctly. I think to get this far you
already changed

#include "libiberty.h"

to

#include <libliberty/libiberty.h>

to get the version installed by the libiberty-dev Ubuntu package, but
these further error messages arise because of ordering interaction
problems between the various header files, which can be alleviated by
move the libiberty include file earlier. Some further fatal compile
errors arise because of an incompatibility in the declaration of
basename(), an incompatibility between VEX's traditional definition of
offsetof() and standards enforcement in recent GCC, a missing feature
of Vine's CFG data type needed by newer OCamlGraph versions, and a
warning caught by recent OCaml compilers that the Makefile was making
fatal. I've attached a patch that contains enough fixes for these
problems to get Vine 1.0 to compile on my 14.04 VM.

Of course the fact that there haven't been any newer complete releases
than Vine 1.0 is a sign that Vine itself is not currently being very
actively developed. If your only goal is say to reproduce some
behavior or results from the old code that may not be a problem, but
depending on your ultimate goal you might also want to look into one
of its successor systems. For instance:

* FuzzBALL is a binary-level symbolic execution system built on top of
Vine, which now embeds a copy of the parts of Vine it uses for
translating and representing machine instructions. My research group
has made some enhancements to these parts of Vine as needed by
FuzzBALL, probably most notably better ARM and x86-64 support. You
can find it in GitHub at:

https://github.com/bitblaze-fuzzball/fuzzball

* BAP is another OCaml library for binary code analysis which was
originally inspired by Vine's capabilities, but has diverged more in
its feature set. It's being developed largely by David Brumley's
research group at CMU, and is also on GitHub:

https://github.com/BinaryAnalysisPlatform

Hope this helps (you or someone else),

-- Stephen

vine-1.0-1404.patch
Reply all
Reply to author
Forward
0 new messages