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.

help, my module is crashing eggdrop!

Old posts that have not been replied to for several years.
Locked
w
wonko

help, my module is crashing eggdrop!

Post by wonko »

I've just started writing eggdrop modules, and i must say, i'm having a blast. the first one went very well (quite a simple one, so very easy to do) but the second one is not going so well.

i have a binding setup to pubm that catches everything that is said by anyone on the channel. it takes what they say and when they say it and sticks it in a linked list.

yes, it's a seen program. but none of the others did exactly what i wanted, and i thought this would be a good place to start before i got into some of the heavier ones i wanted to write.

at first everything lived in the function that was called by the binding for H_pubm. but i wanted to have joins and leaves effect this as well, so i put all the linked list updating into it's own function, and call that from the bound functions.

this works perfectly fine for the function that is bound to H_pubm. everytime someone says something, their list entry gets updated (or created if they hadn't spoken before)

when this function is called from the function bound to H_join, it segfaults the bot. it doesn't even get to execute the first line of the function that it's calling, it just flat out dies.

what could i possibly be doing wrong that a function called from one place works, but from another place it kills things? does some funkiness go on in regard to join binds that i am unaware of?

thanks!

-brian
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Do you have the arguments right?

Do you add the binds correctly? (is the list null terminated?)

That's somewhere to start anyway. If you haven't already done so, I'd recommend you use gdb to analyze the core file it produces and find out exactly what line makes it crash.
G
Galadhrim
Op
Posts: 123
Joined: Fri Apr 11, 2003 8:38 am
Location: Netherlands, Enschede

Post by Galadhrim »

Compile your bot with the DEBUG argument ('make debug').

When the bot crashes lookup a file called core (or core.<number>) and run 'gdb eggdrop core' (or 'gdb eggdrop core.<number>')

The program gdb uses the source files and the program to lookup where it crashed (last line). Sometimes it may look like a library crashed but then you used that library's function incorrectly.
Locked