(Mac OS X)Crash in FD_SET or FD_ISSET



9 years ago
2 years ago


(Reporter: peina, Unassigned)


Firefox Tracking Flags

(Not tracked)




9 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; zh-CN; rv: Gecko/20100202 Firefox/3.5.8
Build Identifier: 3.6

I met some crashes in my embedded xulrunner application on mac. This is the trace:

Thread 75 Crashed:
0   libnspr4.dylib                	0x39f0c45f poll + 655
1   libnspr4.dylib                	0x39f083b9 PR_Poll + 121
2   XUL                           	0x3a2fd04b nsSocketTransportService::Poll(int, unsigned int*) + 123
3   XUL                           	0x3a2fd5fb nsSocketTransportService::DoPollIteration(int) + 459
4   XUL                           	0x3a2fd913 nsSocketTransportService::OnProcessNextEvent(nsIThreadInternal*, int, unsigned int) + 51
5   XUL                           	0x3ac55b9c nsThread::ProcessNextEvent(int, int*) + 124
6   XUL                           	0x3ac178d7 NS_ProcessPendingEvents_P(nsIThread*, unsigned int) + 71
7   XUL                           	0x3a2fde9e nsSocketTransportService::Run() + 190
8   XUL                           	0x3ac55bfa nsThread::ProcessNextEvent(int, int*) + 218
9   XUL                           	0x3ac17803 NS_ProcessNextEvent_P(nsIThread*, int) + 35
10  XUL                           	0x3ac55d8c nsThread::ThreadFunc(void*) + 140
11  libnspr4.dylib                	0x39f09cb8 _pt_root + 152
12  libSystem.B.dylib             	0x96e33fbd _pthread_start + 345
13  libSystem.B.dylib             	0x96e33e42 thread_start + 34

I also saw some crash reports in mozilla with the same crash stack: (see http://crash-stats.mozilla.com/report/list?platform=mac&query_search=signature&query_type=exact&query=poll&date=&range_value=2&range_unit=weeks&process_type=all&plugin_field=&plugin_query_type=&plugin_query=&do_query=1&signature=poll)

most of them crashed in FD_SET or FD_ISSET calls in poll method. I guess the default size FD_SETSIZE (currently 1024) is not enough on Mac OS.

I saw some code in ptio.c which defines bigger FD_SETSIZE, can we do the simlar thing for Mac platform?

 #if defined(_PR_POLL_WITH_SELECT)
#if !(defined(HPUX) && defined(_USE_BIG_FDS))
/* set fd limit for select(), before including system header files */
#define FD_SETSIZE (16 * 1024)

Reproducible: Always

Comment 1

2 years ago
Mass change of bugs in the Embedding: Mac component in preparation for archiving it. I don't believe any of these are useful any more, as we don't have a mac embedding API. If they are relevant, they should be moved to an alternate component.
Last Resolved: 2 years ago
Resolution: --- → INCOMPLETE


2 years ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.