Error: A critical error occurred when registering ModData

If you hit any installation issues or cannot connect to your freshly installed UnrealIRCd then this forum is for you.

Moderator: Supporters

Post Reply
HeXiLeD
Posts: 25
Joined: Mon Jan 16, 2017 8:07 pm
Location: online

Error: A critical error occurred when registering ModData

Post by HeXiLeD » Wed May 03, 2017 9:04 pm

Problem:

Happens when X amount of custom modules are added:
Currently with me was after 17 extra modules.

Code: Select all

error: A critical error occurred when registering ModData for m_modname
No space available & error: Error loading m_modname: Mod_Init returned -1
Gottem wrote:Apparently that's caused when the available ModData slots are all used up. =] You can increase these if you want, but I'm not really sure if it's supported lel. You also have to do this on every server. Inside include/struct.h there are a few defines:


Solution seems to be found when increasing these values:

Code: Select all

#define MODDATA_MAX_CLIENT 8
#define MODDATA_MAX_CHANNEL 8
#define MODDATA_MAX_MEMBER 4
#define MODDATA_MAX_MEMBERSHIP 4
Complain:
Why are the values so low ? Why are there problems adding more extra modules after a certain amount ?

Expectations:
Fix on the next unrealircd release 4.0.12

Conclusion:
:mrgreen: If so, thumbs up
Constructive criticism leads to evolution and progress. Negative criticism leads to obsolescence. We should not be living in 1990s irc management & developing standards just because it was cool.

Syzop
UnrealIRCd head coder
Posts: 1777
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Re: Error: A critical error occurred when registering ModData

Post by Syzop » Wed May 10, 2017 6:16 pm

Which limitation are you hitting? Which of the 4?

The reason there is a limitation at all is because of the way the system works. It will waste space if the slots are unused. This was chosen above dynamically allocated space because a static slot system is a lot faster (same memory block, will be in L2 cache) and causes less memory fragmentation (=waste too). Anyway, tech talk :D

When the numbers were decided, nobody other than me was using the moddata system yet. In fact there were few 4.x third party modules at all. Now with Gottem and others this is changing, so it could well be that it needs some updating.. but I have to be careful with defaults for all 4.x users.

Oh and yes, you can safely change the values in struct.h yourself. Just be sure to recompile UnrealIRCd (make clean; make). Just would like to have the information from above so I can consider raising one of the limits for everyone or at least look if it's necessary ;)

Gottem
Posts: 133
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: Error: A critical error occurred when registering ModData

Post by Gottem » Sat May 13, 2017 12:28 pm

Well, if you're using enough of my modules, eventually you'll use 7 CLIENT slots (plus 1 for CHANNEL) and as far as I can tell you need all of them. There are 2 instances where MEMBERSHIP ones seem more logical, but they interfere with actual functionality (in case of m_kickjoindelay the moddata is destroyed after a kick, rendering the entire module useless). Figured that's by design so I went ahead and used CLIENT. =]
If you like my modules, pls consider donating (through PayPal) or becoming a monthly Patron ;];]

Syzop
UnrealIRCd head coder
Posts: 1777
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Re: Error: A critical error occurred when registering ModData

Post by Syzop » Wed Sep 06, 2017 2:31 pm

Just rememberd this one (next time best to use bugs.unrealircd.org :D), so committed:

Code: Select all

* Bump MODDATA_MAX_CLIENT from 8 to 12: needed if you have a lot of
  3rd party modules loaded. Also moved MODDATA_MAX_* to include/config.h
https://github.com/unrealircd/unrealirc ... a9734949a7
Will be in UnrealIRCd 4.0.14.

Gottem
Posts: 133
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: Error: A critical error occurred when registering ModData

Post by Gottem » Wed Sep 06, 2017 4:49 pm

Could've sworn I filed a bug for it too, but apparently not. :> But yeah, 12 slots should be enough for a while. =]
If you like my modules, pls consider donating (through PayPal) or becoming a monthly Patron ;];]

Post Reply