Corrupt/incompatible binaries

Use this forum to report bugs and to check for bugfixes and new releases of OpenEMM

Moderator: moderator

WDS_Rob
Posts: 3
Joined: Mon Sep 08, 2008 10:45 pm

Corrupt/incompatible binaries

Post by WDS_Rob »

Hi,

I am having an issue that is across multiple versions of EMM (5.5.1, 5.5.0, 5.4.0), all involving binaries like xmlback and bavwrap.

My OS is CentOS 4.0:
Linux version 2.6.16i586 (root@localhost.localdomain) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 Mon Mar 19 16:42:24 GMT 200


Both give this error when run standalone or via OpenEMM:
[root@emm scripts]# ./bavwrap
Illegal instruction

I am currently using the xmlback binary from EMM 5.4.0 without issue, any newer version results in the error (illegal instruction). I was attempting to setup bounce management, and ran into the same problem with bavwrap -- but I can't find a working copy between any of the three available versions on the site.


Everything else works great, is there any way I can compile the binaries on my system locally to prevent this, without manualy compiling/installing EMM?



Thanks in advance!
Rob
ud
Posts: 154
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Post by ud »

This looks like some incompatibilities between the binaries and your libraries or startup code. The most simple solution (and perhaps the only solution that makes sense in this scenario) is to compile these binaries by yourself.

To do this just install the binary package (as you already did), grab the source code, change to .../src/c and start make in each subdirectory (start with lib as this will create an internal library which will be used by the other components.)

Copy the created binaries to the place where you find them in the original package (mostly /home/openemm/bin and /home/openemm/bin/scripts) and ensure that owner and permissions are preserved.

-- ud
WDS_Rob
Posts: 3
Joined: Mon Sep 08, 2008 10:45 pm

Post by WDS_Rob »

Thanks for your reply.

I have downloaded the source for 5.5.1 and extracted.

The tools and lib folders were successfully compiled, the xmlback and bav folders both gave errors regarding missing files.

Missing libraries that I saw right off (make errors):
libxml, libmilter, slang.h, SA lib (OSSP SA)

So...
Installed OSSP SA v1.2.6
Installed libxml2, libxml2-python, libxml2-devel 2.6.16
Installed libmilter (found in sendmail-devel 8.13.1-3)
Installed slang and slang-devel 1.4.9-8

Then I did a make clean on each folder and re-attempted the compile.

This is the error that remains with BAV:

Code: Select all

[root@emm bav]# make
gcc -I../lib -I/usr/local/include -pthread   -c -o bav.o bav.c
gcc -I../lib -I/usr/local/include -pthread   -c -o cfg.o cfg.c
gcc -L../lib -L/usr/local/lib -pthread bav.o cfg.o -o bav -lagn -lmilter -lsa
cfg.o(.text+0x6f): In function `parse_config':
: undefined reference to `set_alloc'
cfg.o(.text+0x18d): In function `parse_config':
: undefined reference to `set_add'
cfg.o(.text+0x365): In function `cfg_free':
: undefined reference to `set_free'
cfg.o(.text+0x4c7): In function `cfg_valid_address':
: undefined reference to `set_find'
../lib/libagn.a(map.o)(.text+0x24b): In function `map_alloc':
: undefined reference to `hash_size'
../lib/libagn.a(map.o)(.text+0x3b8): In function `map_gadd':
: undefined reference to `hash_value'
../lib/libagn.a(map.o)(.text+0x4be): In function `map_add':
: undefined reference to `hash_value'
../lib/libagn.a(map.o)(.text+0x687): In function `map_delete':
: undefined reference to `hash_value'
../lib/libagn.a(map.o)(.text+0x735): In function `map_gfind':
: undefined reference to `hash_value'
../lib/libagn.a(map.o)(.text+0x788): In function `map_find':
: undefined reference to `hash_value'
collect2: ld returned 1 exit status
make: *** [bav] Error 1

This is the remaining error(s) regaring xmlback:

Code: Select all

[root@emm xmlback]# make
( echo "# ifndef        __VERSION_H" ;                  \
  echo "# define        __VERSION_H             1" ;    \
  echo "# define        XML_VERSION             \"`grep 'ATTLIST version current' | cut -d\\\" -f2 -s`\"" ; \
  echo "# endif         /* __VERSION_H */" ;    \
) < blockmail.dtd > version.h
make[1]: Entering directory `/root/source/OpenEMM-5.5.1/src/c/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/source/OpenEMM-5.5.1/src/c/lib'
make -C grammer all
make[1]: Entering directory `/root/source/OpenEMM-5.5.1/src/c/xmlback/grammer'
gcc lemon.c -o lemon
./lemon -c -s parse.y
Parser statistics: 35 terminals, 5 nonterminals, 41 rules
                   113 states, 0 parser table entries, 0 conflicts
gcc -I.. -I../../lib -I/usr/include/libxml2   -c -o transform.o transform.c
gcc -I.. -I../../lib -I/usr/include/libxml2   -c -o parse.o parse.c
rm -f libgrammer.a
ar rc libgrammer.a transform.o parse.o
ranlib libgrammer.a
make[1]: Leaving directory `/root/source/OpenEMM-5.5.1/src/c/xmlback/grammer'
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o append.o append.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o block.o block.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o blockmail.o blockmail.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o blockspec.o blockspec.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o codec.o codec.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o convert.o convert.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o count.o count.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o counter.o counter.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o create.o create.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o data.o data.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o dcache.o dcache.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o dyn.o dyn.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o eval.o eval.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o field.o field.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o fix.o fix.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o generate.o generate.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o links.o links.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o mailtype.o mailtype.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o media.o media.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o misc.o misc.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o modify.o modify.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o none.o none.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o parse.o parse.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o plugin.o plugin.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o postfix.o postfix.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o receiver.o receiver.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o replace.o replace.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o sqllike.o sqllike.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o tag.o tag.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o tagpos.o tagpos.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o url.o url.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o xmlback.o xmlback.c
( echo "# include       \"xmlback.h\"" ;                \
  echo "" ;                                             \
  echo "char    dtd[] = " ;                             \
  sed -e 's/"/\\"/g' -e 's/\(.*\)/        "\1\\n"/g' ;  \
  echo "        \"\\n\";" ) < blockmail.dtd >dtd.c
gcc -I. -I../lib -I/usr/include/libxml2 -I/usr/include/slang   -c -o dtd.o dtd.c
gcc -rdynamic append.o block.o blockmail.o blockspec.o codec.o convert.o count.o counter.o create.o data.o dcache.o dyn.o eval.o field.o fix.o generate.o links.o mailtype.o media.o misc.o modify.o none.o parse.o plugin.o postfix.o receiver.o replace.o sqllike.o tag.o tagpos.o url.o xmlback.o dtd.o -o xmlback grammer/libgrammer.a -lslang -L../lib -lagn -L/usr/lib -lxml2 -lz -lpthread -lm -ldl
blockmail.o(.text+0x920): In function `blockmail_free':
: undefined reference to `rblock_free_all'
create.o(.text+0x95a): In function `create_mail':
: undefined reference to `rblock_alloc'
create.o(.text+0xc4b): In function `create_mail':
: undefined reference to `rblock_retreive_content'
create.o(.text+0xcc8): In function `create_output':
: undefined reference to `rblock_free_all'
xmlback.o(.data+0x44): undefined reference to `preview_oinit'
xmlback.o(.data+0x48): undefined reference to `preview_odeinit'
xmlback.o(.data+0x4c): undefined reference to `preview_owrite'
collect2: ld returned 1 exit status
make: *** [xmlback] Error 1

I can't see any obvious missing libraries/files in the output, any ideas?


Thanks in advance for your assistance!


Rob
ud
Posts: 154
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Post by ud »

My fault, sorry. I did not update the Makefile in the source distribution. For a quick fix, make these changes in the GNUmakefile in the named directories :
* in lib/ add hash.c and set.c to the list of source files
* in xmlback/ add preview.c and rblock.c to the list of source files

-- ud
WDS_Rob
Posts: 3
Joined: Mon Sep 08, 2008 10:45 pm

Post by WDS_Rob »

That worked beautifully.

Thanks for all of your help!
Post Reply