egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MegaHAL - crash on startup

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming
View previous topic :: View next topic  
Author Message
surgeon
Voice


Joined: 01 Jun 2010
Posts: 4
Location: Poland

PostPosted: Tue Jun 01, 2010 11:44 am    Post subject: MegaHAL - crash on startup Reply with quote

x64 Freebsd 8.0
Quote:

Eggdrop v1.6.19+ctcpfix (C) 1997 Robey Pointer (C) 2008 Eggheads
[17:32] --- Loading eggdrop v1.6.19+ctcpfix (Tue Jun 1 2010)
[17:32] Listening at telnet port xxxxx (bots).
[17:32] Listening at telnet port xxxxx (users).
[17:32] Module loaded: blowfish
[17:32] Module loaded: dns
[17:32] Module loaded: channels
[17:32] Module loaded: server
[17:32] Module loaded: ctcp
[17:32] Module loaded: irc
[17:32] Module loaded: transfer (with lang support)
[17:32] Module loaded: share
[17:32] Module loaded: compress
[17:32] Module loaded: notes (with lang support)
[17:32] Module loaded: console (with lang support)
[17:32] Module loaded: uptime
[17:32] .

[17:32] * Last context: tclhash.c/238 []
[17:32] * Please REPORT this BUG!
[17:32] * Check doc/BUG-REPORT on how to do so.
[17:32] * Wrote DEBUG
[17:32] * SEGMENT VIOLATION -- CRASHING!
Memory protection violation: 11 (core dumped)


Back trace:
Quote:

This GDB was configured as "amd64-marcel-freebsd"...

warning: core file may not match specified executable file.
Core was generated by `eggdrop-1.6.19'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libtcl84.so.1...done.
Loaded symbols for /usr/local/lib/libtcl84.so.1
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/home/surgeon/bot/modules/blowfish.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/blowfish.so
Reading symbols from /usr/home/surgeon/bot/modules/dns.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/dns.so
Reading symbols from /usr/home/surgeon/bot/modules/channels.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/channels.so
Reading symbols from /usr/home/surgeon/bot/modules/server.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/server.so
Reading symbols from /usr/home/surgeon/bot/modules/ctcp.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/ctcp.so
Reading symbols from /usr/home/surgeon/bot/modules/irc.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/irc.so
Reading symbols from /usr/home/surgeon/bot/modules/share.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/share.so
Reading symbols from /usr/home/surgeon/bot/modules/transfer.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/transfer.so
Reading symbols from /usr/home/surgeon/bot/modules/compress.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/compress.so
Reading symbols from /lib/libz.so.5...done.
Loaded symbols for /lib/libz.so.5
Reading symbols from /usr/home/surgeon/bot/modules/notes.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/notes.so
Reading symbols from /usr/home/surgeon/bot/modules/console.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/console.so
Reading symbols from /usr/home/surgeon/bot/modules/uptime.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/uptime.so
Reading symbols from /usr/home/surgeon/bot/modules/megahal.so...done.
Loaded symbols for /usr/home/surgeon/bot/modules/megahal.so
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x0000000800a5b386 in strlen () from /lib/libc.so.7
(gdb) bt
#0 0x0000000800a5b386 in strlen () from /lib/libc.so.7
#1 0x0000000801accedb in megahal_start (global_funcs=Variable "global_funcs" is not available.
) at .././megahal.mod/megahal.c:2566
#2 0x000000000042ada3 in module_load (name=0x800c03900 "megahal") at modules.c:784
#3 0x0000000000435a3f in tcl_loadmodule (cd=Variable "cd" is not available.
) at tclmisc.c:527
#4 0x000000000042eec8 in utf_converter (cdata=0x800c89a70, myinterp=0x800c6c300, objc=2, objv=Variable "objv" is not available.
) at tcl.c:352
#5 0x00000008006bd6d6 in TclEvalObjvInternal () from /usr/local/lib/libtcl84.so.1
#6 0x00000008006bdbd1 in Tcl_EvalEx () from /usr/local/lib/libtcl84.so.1
#7 0x0000000800700467 in Tcl_FSEvalFile () from /usr/local/lib/libtcl84.so.1
#8 0x000000080070052f in Tcl_EvalFile () from /usr/local/lib/libtcl84.so.1
#9 0x000000000042e7df in readtclprog (fname=0x54aec0 "bot") at tcl.c:739
#10 0x0000000000410099 in chanprog () at chanprog.c:447
#11 0x000000000042553f in main (argc=3, argv=0x7fffffffea68) at ./main.c:814


I also tried older versions of eggdrop, tcls, even linux. Same effect.
Of course, I had to replace the stdlib malloc in megahal.c under fBSD.
Back to top
View user's profile Send private message
pseudo
Halfop


Joined: 23 Nov 2009
Posts: 88
Location: Bulgaria

PostPosted: Thu Jun 03, 2010 2:31 pm    Post subject: Reply with quote

There is a known problem with some 64-bit BSDs and eggdrop. Please look at this: http://trac.eggheads.org/ticket/2

Try the hack there and if it works, consider giving the current CVS a try.
Back to top
View user's profile Send private message Visit poster's website
surgeon
Voice


Joined: 01 Jun 2010
Posts: 4
Location: Poland

PostPosted: Thu Jun 03, 2010 3:51 pm    Post subject: Reply with quote

I do not understand something.

Quote:
env MALLOC_OPTIONS='Dm' ./eggdrop

This means that variable MALLOC_OPTIONS should be set to 'Dm' ./eggdrop or only Dm?
Firtst option does not make sense. Second does not help for megahal malloc.

Patch created the following files on 1.6.19:
./src/mod/server.mod/servmsg.c.rej
./src/mod/module.h.rej
./src/cmds.c.rej
./configure.rej


and on current 1.6(.20):
./config.h.in.rej
./configure.rej
Back to top
View user's profile Send private message
pseudo
Halfop


Joined: 23 Nov 2009
Posts: 88
Location: Bulgaria

PostPosted: Thu Jun 03, 2010 4:38 pm    Post subject: Reply with quote

The patch is for cvs, it won't apply cleanly to 1.6.19. As for the environment variable, it clearly makes sense, otherwise I wouldn't bother writting short essays about it.

Code:
env MALLOC_OPTIONS='Dm' ./eggdrop


The whole line sets MALLOC_OPTIONS to Dm and runs eggdrop. You're supposed to copy & paste it in your shell to run the bot. I won't go into details, but changing the memory allocation technique helps a purely 32-bit eggdrop to deal with a 64-bit addressing environment.

If you want to try out the cvs, download the snapshot instead of the 1.6.19 source: ftp://ftp.eggheads.org/pub/eggdrop/source/snapshot/eggdrop1.6-snapshot.tar.gz
It already contains the aforementioned patch, so there's no need to reapply it.
Back to top
View user's profile Send private message Visit poster's website
surgeon
Voice


Joined: 01 Jun 2010
Posts: 4
Location: Poland

PostPosted: Thu Jun 03, 2010 5:07 pm    Post subject: Reply with quote

As I understand it I still need to replace malloc.h to stdlib.h in megahal.c file to compile mod?

In this way, built and run eggdrop, still crashes while loading megahal.mod.
Back to top
View user's profile Send private message
surgeon
Voice


Joined: 01 Jun 2010
Posts: 4
Location: Poland

PostPosted: Tue Apr 05, 2011 2:55 pm    Post subject: Reply with quote

I think that I have found the cause of crash. It seems that it was a blank line at end of file megahal.swp.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber