[DONE] Porting GetLegitUsers from 3.2.x to 4.x

These are old archives. They are kept for historic purposes only.

Moderators: Gottem, Supporters

ivp
Posts: 24
Joined: Fri Sep 09, 2016 6:14 pm

[DONE] Porting GetLegitUsers from 3.2.x to 4.x

Post by ivp »

It would be of great help if someone could port this module (attached) to Unreal 4. Many thanks in advance.
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by Gottem »

If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
ivp
Posts: 24
Joined: Fri Sep 09, 2016 6:14 pm

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by ivp »

Awesome, many thanks Gottem!

I've added module and reloaded IRC. Is it possible that it has something to do with crash after 2 hours:

kernel: unrealircd[11298]: segfault at 9c48f0 ip 00000000009c48f0 sp 00007ffdc4a09f58 error 15

It was stable 3 days before this.
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by Gottem »

No, it shouldn't do that; my own IRCd has been running fine all day. And if you didn't execute /getlegitusers right before the crash, the module wasn't doing anything anyway. Do you have any other (third party) mods loaded?
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
ivp
Posts: 24
Joined: Fri Sep 09, 2016 6:14 pm

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by ivp »

Yes, using one custom module from Syzop.

Is it possible to dump core or find the cause different way next time it happens?
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by Gottem »

Well, you can probably fiddle around with GNU debugger (gdb). Just attach it to the unrealircd process (gdb -p <pid>) and use the "continue" command. Then when it crashes you should be able to get a backtrace with "bt". =]

Just out of curiosity: What were you/was the server doing at the time of the crash (and just before)? Any users present on the network (both people and services bots) besides you?
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
ivp
Posts: 24
Joined: Fri Sep 09, 2016 6:14 pm

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by ivp »

The server was full, I wasn't around.

Now it happened again when I was there, nobody did anything special:

Code: Select all

kernel: unrealircd[41776]: segfault at 4841e349 ip 000000004841e349 sp 00007ffe44191158 error 14 in 8EF21E.jointhrottle.so[7ff2ec4c3000+2000]
Two days ago:

Code: Select all

kernel: unrealircd[11298]: segfault at 9c48f0 ip 00000000009c48f0 sp 00007ffdc4a09f58 error 15
Tried now gdb -p <pid> and continue, then Ctrl+Z to send it to background, but after some time gdb process vanished from memory.
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by Gottem »

The latest segfault refers to jointhrottle, so at least it's not this module causing it. Not sure if you did, but you're supposed to attach gdb prior to the crash, otherwise it can't give you a backtrace anyways since it wasn't around when it happened. And I'm not certain if you're "allowed" to send gdb to background, don't think so tbh. =]

Also, apparently you can do "/home/<USER>/<unreal installation dir>/unrealircd backtrace" as well.
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
ivp
Posts: 24
Joined: Fri Sep 09, 2016 6:14 pm

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by ivp »

Right, but the crash happens every 2 days, so I need to launch it in background and log off somehow?

"unrealircd backtrace" doesn't seem to work, it just prints out "Usage: unrealircd [-f <config>] [-h <servername>] [-p <port>] [-x <loglevel>] [-t] [-F]"
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by Gottem »

Are you familiar with screen/tmux? They allow you to start a shell and detach from it while the process keeps running. May wanna check out: http://aperiodic.net/screen/quick_reference

And it seems you're calling the binary directly, not the wrapper script. You need the one you use to start, rehash and croncheck etc.

Alternatively, try forcing a crash by doing a bunch of /joins perhaps.
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
ivp
Posts: 24
Joined: Fri Sep 09, 2016 6:14 pm

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by ivp »

Many thanks Gottem, got it now with "unrealircd backtrace". Is such report different than the one gdb would create directly?

I've opened the bug report, hopefully Syszop will solve this issue.
Syzop
UnrealIRCd head coder
Posts: 2112
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by Syzop »

Just to confirm this has nothing to do with this module.

We're handling it now at Unreal..
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by Gottem »

You're welcome ivp. =] I think the backtrace from Unreal and gdb are pretty much the same, as Unreal just reads a core dump it makes after a crash.
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
Syzop
UnrealIRCd head coder
Posts: 2112
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by Syzop »

"unrealircd backtrace" doesn't seem to work, it just prints out "Usage: unrealircd [-f <config>] [-h <servername>] [-p <port>] [-x <loglevel>] [-t] [-F]"
You are running the wrong 'unrealircd' :)

Normally people have a setup like this:
/home/irc/unrealircd-4.0.6: this is where you compile UnrealIRCd from and this contains src, include, etc...
Then you install UnrealIRCd to somewhere, like:
/home/irc/unrealircd

Then /home/irc/unrealircd will have directories like 'bin', 'data', 'logs' etc and also a script called 'unrealircd'.
Then, to start UnrealIRCd:
cd /home/irc/unrealircd
./unrealircd start
To stop
./unrealircd stop
To backtrace
./unrealircd backtrace

This is a key difference between 3.2.x and 4.0.x (it was optional in 3.2.x and is mandatory in 4.0.x). I tried to mention it at several places such as the release notes and all email announcements, but I can't blame you overlooked if you are so used to 3.2.x :)

I always suggest to use the script. If you would have used the script it would also have seen UnrealIRCd has crashed and offered you to send the backtrace and core files to the UnrealIRCd team.. so much simpler.

***
As for the difference between a manual gdb session (just for reference):
UnrealIRCd will fix the (temporary) modules in tmp if you use ./unrealircd backtrace. If you don't do this and UnrealIRCd has been restarted after the crash and run gdb manually then your backtrace will be missing crucial information since it can't find the .so files and thus will output many ?????? instead of line numbers and function names. Best always to just run './unrealircd backtrace'
ivp
Posts: 24
Joined: Fri Sep 09, 2016 6:14 pm

Re: Porting GetLegitUsers from 3.2.x to 4.x

Post by ivp »

Of course we are using: ./unrealircd start

Also using ~/unrealircd croncheck in crontab and found that after the crash there is crond process hanging with postdrop trying to send some email.

Anyway, not sure how does UnrealIRCd "offers me" to send anything, since I am not always logged on ;)
Post Reply