aMule Bug Tracker - aMule
View Issue Details
0001585aMuleExternal Connpublic2010-02-01 14:082016-05-06 22:30
marcelpb 
GonoszTopi 
normalcrashalways
closedwon't fix 
2.2.6 
2.3.1 
10582
Linux
0001585: Problem with Max TCP Connections [Solved]
When you are running amuled and your settings for max connections are very high (MaxConnections = 1000), amuled crashes. I'm developer (in C++ in fact) and I guess I've solved the problem. The main problem here is the use of 'select' instead of 'poll'. 'Select' only works for a maximum of 1024 connections, but 'poll' have the system maximum connections.

I've attached the modified files for your review. I'm testing the changes and it seems that works fine.

If you have any question, please send me a mail.

Regards.
Changes
-------
- In 'amule.h'
  * Row 387 -> 'm_set' instead of 'm_in_set' and 'm_out_set'.
- In 'amuled.cpp'
  * Class CSocketSet
  * Functions in class CAmuledGSocketFuncTable:
    + CAmuledGSocketFuncTable()
    + AddSocket
    + RemoveSocket
    + RunSelect

No more changes are needed in the original sources.
No tags attached.
tgz changes_poll.tgz (9,789) 2010-02-01 14:08
http://bugs.amule.org/file_download.php?file_id=325&type=bug
txt amule backtrace.txt (14,262) 2011-07-06 23:55
http://bugs.amule.org/file_download.php?file_id=344&type=bug
Issue History
2010-02-01 14:08marcelpbNew Issue
2010-02-01 14:08marcelpbFile Added: changes_poll.tgz
2010-02-01 14:08marcelpbOperating System => Linux
2010-02-01 14:59marcelpbNote Added: 0003377
2010-02-01 14:59marcelpbTag Attached: amuled
2010-02-01 14:59marcelpbTag Attached: connection
2010-02-01 14:59marcelpbTag Attached: max
2010-02-01 14:59marcelpbTag Attached: tcp
2010-02-01 21:07sturedmanNote Added: 0003378
2010-02-02 00:43marcelpbNote Added: 0003382
2010-02-02 22:10sturedmanNote Added: 0003383
2010-02-03 17:45GonoszTopiTag Detached: tcp
2010-02-03 17:45GonoszTopiTag Detached: amuled
2010-02-03 17:45GonoszTopiTag Detached: connection
2010-02-03 17:45GonoszTopiTag Detached: max
2010-05-16 17:22GonoszTopiStatusnew => assigned
2010-05-16 17:22GonoszTopiAssigned To => GonoszTopi
2011-06-13 08:46GonoszTopiTarget Version => 2.3.1
2011-06-15 20:51GonoszTopiFixed in Revision => 10582
2011-06-15 20:51GonoszTopiStatusassigned => resolved
2011-06-15 20:51GonoszTopiResolutionopen => fixed
2011-06-15 20:51GonoszTopiFixed in Version => 2.3.1
2011-06-22 12:38sturedmanNote Added: 0003583
2011-06-22 12:38sturedmanStatusresolved => feedback
2011-06-22 12:38sturedmanResolutionfixed => reopened
2011-07-06 23:55miguelssmFile Added: amule backtrace.txt
2011-07-06 23:57miguelssmNote Added: 0003585
2011-07-07 22:45sturedmanNote Added: 0003588
2011-07-07 23:49miguelssmNote Added: 0003589
2011-07-08 21:19sturedmanNote Added: 0003590
2016-05-06 22:30GonoszTopiStatusfeedback => closed
2016-05-06 22:30GonoszTopiResolutionreopened => won't fix
2016-05-06 22:30GonoszTopiFixed in Version2.3.1 =>

Notes
(0003377)
marcelpb   
2010-02-01 14:59   
Sorry, I'm new and I don't know if this is the best category (maybe Servers is better, I don't know).
(0003378)
sturedman   
2010-02-01 21:07   
Please make patches based on current SVN and not on 2.2 .
Also notice that the issue is already solved when using wxWidgets 2.9, so I'm not sure it's still worth digging in this place.
(0003382)
marcelpb   
2010-02-02 00:43   
I guess you are wrong. This problem is not in wxWidget, is in amuled source. It's because the use of 'select'. This function only can work with a maximum of 1024 connections, and it cames with kernel, no in wxWidgets. My solution proposes the use of 'poll' insted, and can be applied to the SVN source code (I've downloaded this version, and it is exactly the same than 2.2 version).
(0003383)
sturedman   
2010-02-02 22:10   
Don't guess, look at the source.
And what do you mean, SVN source is the same as 2.2 ?
(0003583)
sturedman   
2011-06-22 12:38   
This is causing problems.

http://forum.amule.org/index.php?topic=18982.0 [^]

(And why do I have to "request feedback" and can't simply reset it to open?)
(0003585)
miguelssm   
2011-07-06 23:57   
I've tried this solution but it doesn't work with me.
You can see the backtrace in the attached file.
amule_backtrace.txt
Thanks in advance.

MiguelSSM
(0003588)
sturedman   
2011-07-07 22:45   
This "fix" is broken, so don't try it.
(0003589)
miguelssm   
2011-07-07 23:49   
So, what can I do?
I'm not sure if this bugs is related to mine:

http://bugs.amule.org/view.php?id=1678 [^]

Do you recommend me to compile 2.2.6 or SVN?
Is this bug fixed in SVN version?
(0003590)
sturedman   
2011-07-08 21:19   
At the moment you can
a) use less connections in amuled (2.2.6 or SVN < 10582)
b) use amuled SVN with wxWidgets 2.9 SVN
As I said, the fix is broken, and so are currently all SVN version >= 10582 (unless compiled with wx 2.9).