View Issue Details

IDProjectCategoryView StatusLast Update
0003911unrealircdpublic2010-06-21 18:47
Reportermykro Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version3.2.8 
Summary0003911: ircd does not start with MAXCONNECTIONS > 1024
DescriptionHello,

the ircd does not start when MAXCONNECTIONS is set to a value higher than 1024 in the ./Config script. The ulimit hard and soft value are correctly set but FD_SETSIZE is limited to 1024.

Actually, ./configure tries to set FD_SETSIZE via the gcc -D switch which failes because the macros defined via -D are set before the code is preprocessed so that any later #define's in the source code or in any header overwrites the value given with -D.

The solution (rather a dirty hack) proposed in the FAQs (see http://www.unrealircd.com/faq.php#46) is not acceptable because it requires to change a central header file that is managed normally with the system's package system (e.g. apt-get).


SOLUTION:
=========
I solved the problem by first undefining the FD_SETSIZE macro (which is being set by the system's header files) and then redefine it within a properly selected unrealircd header file. I've chosen setup.h because it is included quite late so that the preprocessor commands are executed after the system's defaults:

#undef FD_SETSIZE
#define FD_SETSIZE 8192

I recommend to change the ./configure script:
- remove the -D FD_SETSIZE switch which is completely useless
- add the undef and the define to setup.h (or any other suitable header file) if MAXCONNECTIONS is bigger than the system's FD_SETSIZE default value


Regards
mykro (irc.paranode.net)
3rd party modules

Activities

syzop

2010-06-06 19:32

administrator   ~0016113

The solution you propose is not valid.
Basically, you redefine FD_SETSIZE to some value so the warning goes away, but the fd_set struct itself stays 1024 bits (if 1024 is what the system header uses) no matter what you define later on. The result is stack and/or heap corruption.

Unfortunately the way proposed in the FAQ is the only solution on Linux.
It can only go away by 0001245 / 0003361 (which are not for 3.2*, by the way).

mykro

2010-06-21 14:05

reporter   ~0016123

Hello,

I started a discussion on the glibc mailing list (http://www.cygwin.com/ml/libc-help/2010-06/) about the idea to add a possibility to raise __FD_SETSIZE. I also opened a glibc enhancement request (http://sources.redhat.com/bugzilla/show_bug.cgi?id=11687). My proposal would finally resolve the unrealircd maxconnections problem without the need of modifying system headers.

There is a living discussion about this issue with supporters and opponents. Please follow up the discussion on the mailing list and in bugzilla.

What we need to explain is that a #ifndef __FD_SETSIZE would not create any API or ABI issues.

Thank you.


mykro (irc.paranode.net)

syzop

2010-06-21 18:47

administrator   ~0016127

thanks for the info & effort :). Though I don't think it will help much, but we'll see.

other than that, this is a dup of (or very related to) 0001245

Issue History

Date Modified Username Field Change
2010-06-06 17:34 mykro New Issue
2010-06-06 19:32 syzop QA => Not touched yet by developer
2010-06-06 19:32 syzop U4: Need for upstream patch => No need for upstream InspIRCd patch
2010-06-06 19:32 syzop Note Added: 0016113
2010-06-06 19:32 syzop Status new => closed
2010-06-06 19:32 syzop Resolution open => not fixable
2010-06-21 14:05 mykro Note Added: 0016123
2010-06-21 14:05 mykro Status closed => feedback
2010-06-21 14:05 mykro Resolution not fixable => reopened
2010-06-21 18:47 syzop Note Added: 0016127
2010-06-21 18:47 syzop Status feedback => closed
2010-06-21 18:47 syzop Resolution reopened => duplicate