This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Eggdrop 1.6.17 + SSL Patch on X86_64 Problems

General support and discussion of Eggdrop bots.
Post Reply
t
turbo0O
Voice
Posts: 4
Joined: Sat Dec 31, 2005 3:19 am

Eggdrop 1.6.17 + SSL Patch on X86_64 Problems

Post by turbo0O »

I am trying to get an eggdrop 1.6.17 with the SSL patch (found on this site in the download area) to compile. The machine is X86_64 (Suse 10.0 64-bit).

I have tried installing both openssl 0.9.7i as well as 0.9.8a.

I can get the bot to compile, if i go and do some of the compilation by hand. Let me show you what I've been trying...

./configure --with-ssl=/usr/local/ssl (happily exits)

make config (again, no problems yet)

make (<--has problems)

This is the result of make:

Code: Select all

linux:~/src/eggdrop1.6.17 # make
make[1]: Entering directory `/root/src/eggdrop1.6.17/src'
This may take a while. Go get some runts.

gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H   -c bg.c
gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H   -c botcmd.c
gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H   -c botmsg.c
gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H   -c botnet.c
gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H   -c chanprog.c
gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H   -c cmds.c
gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H   -c dcc.c
dcc.c:38:25: error: openssl/md5.h: No such file or directory
dcc.c: In function âdcc_bot_digestâ:
dcc.c:302: error: âMD5_CTXâ undeclared (first use in this function)
dcc.c:302: error: (Each undeclared identifier is reported only once
dcc.c:302: error: for each function it appears in.)
dcc.c:302: error: syntax error before âmd5contextâ
dcc.c:307: warning: implicit declaration of function âMD5_Initâ
dcc.c:307: error: âmd5contextâ undeclared (first use in this function)
dcc.c:308: warning: implicit declaration of function âMD5_Updateâ
dcc.c:310: warning: implicit declaration of function âMD5_Finalâ
dcc.c: In function âdcc_bot_check_digestâ:
dcc.c:508: error: âMD5_CTXâ undeclared (first use in this function)
dcc.c:508: error: syntax error before âmd5contextâ
dcc.c:517: error: âmd5contextâ undeclared (first use in this function)
make[1]: *** [dcc.o] Error 1
make[1]: Leaving directory `/root/src/eggdrop1.6.17/src'
make: *** [modegg] Error 2
Not pretty. However, I have found that if i go into the eggdrop1.6.17/src directory and execute the following:

gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H -c dcc.c -I/usr/local/ssl/include

then it will compile. Then I can do `make` again and it will spit out another error, but it will stop complaining if i execute the same statement as above with the different *.c filename. If I do that about +/- 7 times, then it will say it has compiled happily. Obviously, this is a ghetto way to compile an eggdrop, so I'm not really that surprised when I do the install and run it, and get the following:

Code: Select all

turbo0O@linux:~/egg2> ./eggdrop eggdrop.conf -n

Eggdrop v1.6.17+SSL (C) 1997 Robey Pointer (C) 2004 Eggheads
[23:29] Allocated bind table unld (flags 1)
[23:29] Allocated bind table time (flags 1)
[23:29] Allocated bind table note (flags 0)
[23:29] Allocated bind table nkch (flags 1)
[23:29] Allocated bind table load (flags 1)
[23:29] Allocated bind table link (flags 1)
[23:29] Allocated bind table filt (flags 1)
[23:29] Allocated bind table disc (flags 1)
[23:29] Allocated bind table dcc (flags 0)
[23:29] Allocated bind table chpt (flags 1)
[23:29] Allocated bind table chon (flags 1)
[23:29] Allocated bind table chof (flags 1)
[23:29] Allocated bind table chjn (flags 1)
[23:29] Allocated bind table chat (flags 1)
[23:29] Allocated bind table bot (flags 0)
[23:29] Allocated bind table bcst (flags 1)
[23:29] Allocated bind table away (flags 1)
[23:29] Allocated bind table act (flags 1)
[23:29] Allocated bind table evnt (flags 1)
[23:29] --- Loading eggdrop v1.6.17+SSL (Fri Dec 30 2005)
[23:29] Module loaded: dns
[23:29] Module loaded: channels
[23:29] Allocated bind table wall (flags 1)
[23:29] Allocated bind table raw (flags 1)
[23:29] Allocated bind table notc (flags 1)
[23:29] Allocated bind table msgm (flags 1)
[23:29] Allocated bind table msg (flags 0)
[23:29] Allocated bind table flud (flags 1)
[23:29] Allocated bind table ctcr (flags 1)
[23:29] Allocated bind table ctcp (flags 1)
[23:29] Module loaded: server
[23:29] Module loaded: ctcp
[23:29] Allocated bind table topc (flags 1)
[23:29] Allocated bind table splt (flags 1)
[23:29] Allocated bind table sign (flags 1)
[23:29] Allocated bind table rejn (flags 1)
[23:29] Allocated bind table part (flags 1)
[23:29] Allocated bind table nick (flags 1)
[23:29] Allocated bind table mode (flags 1)
[23:29] Allocated bind table kick (flags 1)
[23:29] Allocated bind table join (flags 1)
[23:29] Allocated bind table pubm (flags 1)
[23:29] Allocated bind table pub (flags 0)
[23:29] Allocated bind table need (flags 1)
[23:29] Module loaded: irc
...etc...
[23:29] Userfile loaded, unpacking...
[23:29] === lamestbot: 0 channels, 2 users.
[23:29] main: entering loop
[23:29] net: eof!(read) socket 9
[23:29] net: eof!(read) socket 9
[23:29] net: connect! sock 6
[23:29] Trying server irc.thedome.us:7000
[23:29] DNS resolved irc.thedome.us to 69.64.50.61
[23:29] net_switch_to_ssl()
*** glibc detected *** free(): invalid next size (normal): 0x00000000008ea320 ***
Aborted (core dumped)
Again, I'm not saying that I'm surprised that it doesn't work right after I have compiled it in such a strange way. I think the problem is that it is not finding the SSL libraries/header files that it needs, but I have no more ideas on how to resolve the issue. I went to #egghelp on efnet and some guy told me that I had not "installed openssl well enough" .. but the only way that I know how to install it is by using the instructions from the INSTALL document that comes with it.

If any of you could help me out on this I would really appreciate it. I've already spent hours trying to fix this and I would not ask for any of your time unless it truly was my last resort.

Thanks,

turbo0O
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

OpenSSL detection is obviously broken in that patch

in your Makefile, add -I/usr/local/ssl/include to CFLGS and -L/usr/local/lib -lcrypto -lssl to XLIBS, then run make again
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
t
turbo0O
Voice
Posts: 4
Joined: Sat Dec 31, 2005 3:19 am

Post by turbo0O »

Thanks for your quick reply!

That helped; It does half of the make now and then stalls when it tries to do the linking. I did `make -d` to show debugging/verbose information. The relevant output was:

Code: Select all

---------- Yeah! That's the compiling, now the linking! ----------
Got a SIGCHLD; 1 unreaped children.
Reaping winning child 0x00549c10 PID 20101
Live child 0x00549c10 (compatability) PID 20102

Got a SIGCHLD; 1 unreaped children.
Reaping winning child 0x00549c10 PID 20102
Removing child 0x00549c10 PID 20102 from chain.
    Successfully remade target file `compatability'.
   Finished prerequisites of target file `../eggdrop'.
  Must remake target `../eggdrop'.
Putting child 0x0054a0c0 (../eggdrop) PID 20103 on the chain.
Live child 0x0054a0c0 (../eggdrop) PID 20103
Linking eggdrop .
Got a SIGCHLD; 1 unreaped children.
Reaping winning child 0x0054a0c0 PID 20103
Live child 0x0054a0c0 (../eggdrop) PID 20104

Got a SIGCHLD; 1 unreaped children.
Reaping winning child 0x0054a0c0 PID 20104
Live child 0x0054a0c0 (../eggdrop) PID 20105
Got a SIGCHLD; 1 unreaped children.
Reaping winning child 0x0054a0c0 PID 20105
gcc -pipe -o ../eggdrop bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o modules.o net.o rfc1459.o tcl.o tcldcc.o tclhash.o tclmisc.o tcluser.o userent.o userrec.o users.o  -L/usr/local/lib -lcrypto -lssl -L/usr/local/lib -ltcl8.4 -lm -lpthread -ldl -lnsl  md5/md5c.o compat/*.o `cat mod/mod.xlibs` -lssl -lcrypto -L/usr/local/ssl/lib -L/usr/local/ssl/lib -I/usr/local/ssl/include
Live child 0x0054a0c0 (../eggdrop) PID 20106
md5/md5c.o: In function `MD5_Init':
/root/src/eggdrop1.6.17/src/md5/md5c.c:194: multiple definition of `MD5_Init'
/usr/local/ssl/lib/libcrypto.a(md5_dgst.o):md5_dgst.c:(.text+0x510): first defined here
/usr/lib64/gcc/x86_64-suse-linux/4.0.2/../../../../x86_64-suse-linux/bin/ld: Warning: size of symbol `MD5_Init' changed from 54 in /usr/local/ssl/lib/libcrypto.a(md5_dgst.o) to 50 in md5/md5c.o
md5/md5c.o: In function `MD5_Update':
/root/src/eggdrop1.6.17/src/md5/md5c.c:203: multiple definition of `MD5_Update'
/usr/local/ssl/lib/libcrypto.a(md5_dgst.o):md5_dgst.c:(.text+0x0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/4.0.2/../../../../x86_64-suse-linux/bin/ld: Warning: size of symbol `MD5_Update' changed from 884 in /usr/local/ssl/lib/libcrypto.a(md5_dgst.o) to 266 in md5/md5c.o
md5/md5c.o: In function `MD5_Final':
/root/src/eggdrop1.6.17/src/md5/md5c.c:237: multiple definition of `MD5_Final'
/usr/local/ssl/lib/libcrypto.a(md5_dgst.o):md5_dgst.c:(.text+0x390): first defined here
/usr/lib64/gcc/x86_64-suse-linux/4.0.2/../../../../x86_64-suse-linux/bin/ld: Warning: size of symbol `MD5_Final' changed from 372 in /usr/local/ssl/lib/libcrypto.a(md5_dgst.o) to 354 in md5/md5c.o
collect2: ld returned 1 exit status
Got a SIGCHLD; 1 unreaped children.
Reaping losing child 0x0054a0c0 PID 20106
make[1]: *** [../eggdrop] Error 1
Removing child 0x0054a0c0 PID 20106 from chain.
make[1]: Leaving directory `/root/src/eggdrop1.6.17/src'
Got a SIGCHLD; 1 unreaped children.
Reaping losing child 0x005436c0 PID 20092
make: *** [modegg] Error 2
Removing child 0x005436c0 PID 20092 from chain.
Which is confusing to me, but perhaps you can make sense of it?

Thanks again!
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

remove multiple definitions of MD5 functions

if you are not programmer, don't bother
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
t
turbo0O
Voice
Posts: 4
Joined: Sat Dec 31, 2005 3:19 am

Post by turbo0O »

Alright, I finally got it working and it runs fine with SSL enabled. Thanks for your help! I got it working by adding an additional -L/usr/local/ssl/lib to the XLIBS line in the makefile, as well as commenting out the following functions in eggdrop1.6.17/src/md5/*

//extern void MD5_Init(MD5_CTX *ctx);
//extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size);
//extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);

(in the .h and .c files)

Here is the top part of my makefile where all the paths get set. Perhaps it will be of use to someone in the future.

Code: Select all

#
#  This is the Makefile for EGGDROP (the IRC bot)
#  You should never need to edit this.
#
# $Id: Makefile.in,v 1.39 2004/07/25 11:17:33 wcc Exp $

SHELL = /bin/sh
top_srcdir = .
srcdir = .



prefix = /root/egg3
DEST = ${prefix}
EGGEXEC = eggdrop
EGGVERSION = 1.6.17

# things you can put here:
#   -Wall            if you're using gcc and it supports it
#                    (configure usually detects this anyway now)
#
#   -DDEBUG_ASSERT   to enable assert debugging
#   -DDEBUG_MEM      to be able to debug memory allocation (.debug)
#                    These can both be set by using 'make debug'
#                    or 'make sdebug'
CFLGS = -I/usr/local/ssl/include

# ./configure SHOULD set these; however you may need to tweak them to
# get modules to compile. If you do, PLEASE let the development team know,
# so we can incorporate needed changes into the next release. You can
# contact us at eggdev@eggheads.org, as always.

# Compiler
CC = gcc -pipe
MOD_CC = gcc -pipe
SHLIB_CC = gcc -pipe -fPIC

# Linker
LD = gcc -pipe
MOD_LD = gcc -pipe
SHLIB_LD = gcc -pipe -shared -nostartfiles

# Stripping
# To turn STRIP off, use 'STRIP = touch' not 'STRIP ='.
STRIP = touch
MOD_STRIP = touch
SHLIB_STRIP = touch

# Programs make install uses
LN_S = ln -s
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL}

# Misc
RANLIB = ranlib
MOD_EXT = so
XREQS = /usr/local/lib/libtcl8.4.so
XSSL_LIBS = -lssl -lcrypto -L/usr/local/ssl/lib -L/usr/local/ssl/lib
XSSL_INCLUDE = -I/usr/local/ssl/include
TCLLIB = /usr/local/lib
TCLLIBFN = tcl8.4.so

# Extra libraries
# XLIBS will be linked with everything; MODULE_XLIBS will only be linked with
# the actual module objects.
XLIBS = -L/usr/local/lib -L/usr/local/ssl/lib -lcrypto -lssl -L/usr/local/lib -ltcl8.4 -lm -lpthread -ldl -lnsl
MODULE_XLIBS =

# Shouldn't need to touch anything below here.
DEBCFLAGS = -DDEBUG_ASSERT -DDEBUG_MEM

modconf = $(top_srcdir)/misc/modconfig --top_srcdir=$(top_srcdir)

egg_test_run = EGG_LANGDIR=$(top_srcdir)/language ./$(EGGEXEC) -v

post_config  =  echo "" && \
                echo "You can now compile the bot, using \"make\"." && \
                echo ""

post_iconfig =  $(modconf) update-depends && \
                $(modconf) Makefile && \
                (cd src/mod && $(MAKE_CONFIG) config) && \
                $(modconf) Makefile

egg_install_msg =  echo "" && \
                   echo "Now run \"make install\" to install your bot." && \
                   echo ""

MAKE_MODEGG = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(MOD_CC)' 'LD=$(MOD_LD)' \
'STRIP=$(MOD_STRIP)' 'RANLIB=$(RANLIB)' 'CFLGS=$(CFLGS)' \
'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \
'XSSL_LIBS=$(XSSL_LIBS)' 'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' \
'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'EGGBUILD=' 'MODOBJS='

MAKE_MODULES = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(SHLIB_CC)' 'LD=$(SHLIB_LD)' \
'STRIP=$(SHLIB_STRIP)' 'CFLGS=$(CFLGS)' 'XLIBS=$(XLIBS)' 'MOD_EXT=$(MOD_EXT)' \
'MODULE_XLIBS=$(MODULE_XLIBS)'

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(XSSL_LIBS)' 'EGGEXEC=$(EGGEXEC)' \
'EGGBUILD=(static and debug version)' 'MODOBJS=mod/*.o'

MAKE_DEPEND = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD)' \
'STRIP=$(STRIP)' 'CFLGS=$(CFLGS)'

MAKE_CONFIG = $(MAKE) 'MAKE=$(MAKE)'

MAKE_INSTALL = $(MAKE) 'MAKE=$(MAKE)' 'DEST=$(DEST)'
I would also like to help get the SSL patch working better. I am not sure where to start though.

Thanks again for your help!

turbo
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you can help by making this patch detect OpenSSL better; add your paths to the configuration part (don't ask me how to do that :) I haven't used and haven't seen the patch)
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
t
tmartens
Voice
Posts: 1
Joined: Sat Nov 01, 2008 6:32 am

Post by tmartens »

I really hope some can help me there, i have same problem here...


when im doing the make part

Linking eggdrop (standard build).

gcc -pipe -o ../eggdrop bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o modules.o net.o rfc1459.o tcl.o tcldcc.o tclhash.o tclmisc.o tcluser.o userent.o userrec.o users.o -L/usr/local/lib -L/usr/local/ssl/lib -lcrypto -lssl -L/usr/local/lib -ltcl8.5 -lm -lpthread -ldl -lnsl md5/md5c.o compat/*.o `cat mod/mod.xlibs`
md5/md5c.o: In function `MD5_Init':
/root/eggdrop1.6.18/src/md5/md5c.c:178: multiple definition of `MD5_Init'
/usr/local/ssl/lib/libcrypto.a(md5_dgst.o):md5_dgst.c:(.text+0x0): first defined here
/usr/bin/ld: Warning: size of symbol `MD5_Init' changed from 58 in /usr/local/ssl/lib/libcrypto.a(md5_dgst.o) to 49 in md5/md5c.o
md5/md5c.o: In function `MD5_Final':
/root/eggdrop1.6.18/src/md5/md5c.c:223: multiple definition of `MD5_Final'
/usr/local/ssl/lib/libcrypto.a(md5_dgst.o):md5_dgst.c:(.text+0x40): first defined here
/usr/bin/ld: Warning: size of symbol `MD5_Final' changed from 177 in /usr/local/ssl/lib/libcrypto.a(md5_dgst.o) to 313 in md5/md5c.o
md5/md5c.o: In function `MD5_Update':
/root/eggdrop1.6.18/src/md5/md5c.c:189: multiple definition of `MD5_Update'
/usr/local/ssl/lib/libcrypto.a(md5_dgst.o):md5_dgst.c:(.text+0x120): first defined here
/usr/bin/ld: Warning: size of symbol `MD5_Update' changed from 279 in /usr/local/ssl/lib/libcrypto.a(md5_dgst.o) to 198 in md5/md5c.o
collect2: ld returned 1 exit status
make[1]: *** [../eggdrop] Error 1
make[1]: Leaving directory `/root/eggdrop1.6.18/src'
make: *** [modegg] Error 2



demond says i need to remove multiple definitions of MD5 functions ?

but the problem is i dont know where to do that :/ ? and i dont understand what turbo0O did.

hope someone can help me so i can get the ssl patch working :)

thanks in advance...
Post Reply