Closed
Bug 794240
Opened 12 years ago
Closed 12 years ago
Signaling doesn't clean up message queues in /tmp (seen on linux+mac)
Categories
(Core :: WebRTC: Signaling, defect)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: jesup, Assigned: jib)
References
Details
(Whiteboard: [WebRTC], [blocking-webrtc-] [qa-])
Attachments
(3 files, 6 obsolete files)
We're leaking SIPCC message queues: $ ls -l /tmp | grep SIP-MsgQ | wc 78 702 6144 Note that it goes up even if I exit "cleanly" via close.
Updated•12 years ago
|
Whiteboard: [WebRTC], [blocking-webrtc-]
Comment 1•12 years ago
|
||
Adding to this that EKR has requested the tmp files be attributed 700 instead of 755 per m-c landing review.
Reporter | ||
Comment 2•12 years ago
|
||
Jan-Ivar - this may be a good next bug; it's in the signaling code
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → jib
Status: NEW → ASSIGNED
Assignee | ||
Updated•12 years ago
|
Summary: Signaling doesn't clean up message queues in /tmp on linux → Signaling doesn't clean up message queues in /tmp on linux+mac
Assignee | ||
Updated•12 years ago
|
Summary: Signaling doesn't clean up message queues in /tmp on linux+mac → Signaling doesn't clean up message queues in /tmp (seen on linux+mac)
Assignee | ||
Comment 3•12 years ago
|
||
I've fixed the SIP-* sockets. It's now closing and deleting those cleanly. Moving on to: 2. the CprTmr* sockets. Same problem, but cpr_timer_de_init() is never called. 3. Fix permissions in /tmp on all four sockets. I plan to chmod 700 on a mkstemp() dir and put sockets inside so they'll inherit the right permissions.
Assignee | ||
Updated•12 years ago
|
Attachment #689908 -
Attachment is patch: true
Assignee | ||
Comment 4•12 years ago
|
||
I have a shutdown question: cpr_timer_de_init() @ http://mxr.mozilla.org/mozilla-central/source/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c#935 isn't called anywhere. Do we think it was meant to be called on the timer thread itself or on the main thread after the timer thread is gone? Should I pass an unload msg, or is that overkill for a timer thread?
Assignee | ||
Comment 5•12 years ago
|
||
ehugg and crypt think no-one uses the cpr timers, so I'll test commenting them out.
Assignee | ||
Comment 6•12 years ago
|
||
Assignee | ||
Comment 7•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #691395 -
Attachment is obsolete: true
Assignee | ||
Comment 8•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #691401 -
Attachment is obsolete: true
Assignee | ||
Comment 9•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #692166 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #692372 -
Flags: review?(rjesup)
Reporter | ||
Comment 10•12 years ago
|
||
Comment on attachment 692372 [details] [diff] [review] bug--fix: Disable timerthread + close sockets + cleanup tmp-files on shutdown + file permissions Review of attachment 692372 [details] [diff] [review]: ----------------------------------------------------------------- r+ with nits fixed ::: media/webrtc/signaling/signaling.gyp @@ +583,5 @@ > > 'defines' : [ > + # CPR timers are needed by SIP, but are disabled for now > + # to avoid the extra timer thread and stale cleanup code > + # 'CPR_TIMERS_ENABLED', trailing whitespace ::: media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.c @@ +773,5 @@ > { > /* Bind to the local socket */ > memset(addr, 0, sizeof(cpr_sockaddr_un_t)); > addr->sun_family = AF_UNIX; > + PR_snprintf(addr->sun_path, sizeof(addr->sun_path), name, pid); snprintf - this is mac-only code where it exists and is safe ::: media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c @@ +226,5 @@ > */ > static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data) > { > + static const char fname[] = "addTimerToList"; > + remove @@ +270,5 @@ > API_RETURN(tmr_rsp.u.result); > } > +#else > + cprAssert(FALSE, CPR_FAILURE); > + CPR_ERROR("CPR Timers are disabled! %s\n", fname); __FUNCTION__ ::: media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c @@ +748,5 @@ > { > /* Bind to the local socket */ > memset(addr, 0, sizeof(cpr_sockaddr_un_t)); > addr->sun_family = AF_LOCAL; > + PR_snprintf(addr->sun_path, sizeof(addr->sun_path), name, pid); snprintf - exists and is safe in linux ::: media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.c @@ +741,5 @@ > char hostAndPort[HOST_AND_PORT_SIZE]; > > cprAssert(host != NULL, CPR_FAILURE); > cprAssert(localPort != NULL, CPR_FAILURE); > + PR_snprintf(hostAndPort, HOST_AND_PORT_SIZE, "%s:%d", host, port); snprintf - defined somewhere in signaling as safe @@ +1083,5 @@ > /* COPIED FROM OTHER PLATFORM AS A PLACE HOLDER */ > /* Bind to the local socket */ > memset(addr, 0, sizeof(cpr_sockaddr_un_t)); > addr->sun_family = AF_INET; > + PR_snprintf(addr->sun_path, sizeof(addr->sun_path), name, pid); ditto
Attachment #692372 -
Flags: review?(rjesup) → review+
Assignee | ||
Comment 12•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #692372 -
Attachment is obsolete: true
Assignee | ||
Comment 13•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #692423 -
Attachment is obsolete: true
Assignee | ||
Comment 14•12 years ago
|
||
Comment on attachment 692437 [details] [diff] [review] Disable timerthread + close sockets + cleanup tmp-files on shutdown + file permissions. Carrying forward r+ from Randell.
Attachment #692437 -
Flags: review+
Attachment #692437 -
Flags: checkin?(rjesup)
Reporter | ||
Comment 15•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/5c073841902c
Target Milestone: --- → mozilla20
Reporter | ||
Updated•12 years ago
|
Attachment #692437 -
Flags: checkin?(rjesup) → checkin+
Comment 16•12 years ago
|
||
I'm getting link bustage. I bisected it to this patch. The exact output is attached. The problem seems to be with PR_snprintf and/or mkdir. I'm on Ubuntu 12.04, using clang 3.2 and gold 1.11.
Comment 17•12 years ago
|
||
The problem doesn't happen unless --enable-tests is specified, so it's a problem with the unit tests.
Comment 18•12 years ago
|
||
Actually, it might be --enable-debug that's causing the problem... not sure yet.
Comment 19•12 years ago
|
||
Missing includes in media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_task.c are the reason for Nicholas' build failure. #include <sys/stat.h> #include "prprf.h"
Updated•12 years ago
|
Depends on: Wimplicit-function-declaration
Assignee | ||
Comment 20•12 years ago
|
||
Thanks Nick and Mike! Sorry, I'm a newbie. I'll add another patch to this bug and get it reviewed and checked in asap. Odd, inbound is still showing as green and it doesn't appear to have been backed out. Did this break the tree? Mike, I see you added a dependency, do I need to hold off making a fix?
Comment 21•12 years ago
|
||
(In reply to Jan-Ivar Bruaroey [:jib] from comment #20) > Thanks Nick and Mike! Sorry, I'm a newbie. I'll add another patch to this > bug and get it reviewed and checked in asap. Odd, inbound is still showing > as green and it doesn't appear to have been backed out. Did this break the > tree? It breaks the tree for some people, not on build bots. > Mike, I see you added a dependency, do I need to hold off making a fix? No, the dependency is just not in the right direction.
Blocks: Wimplicit-function-declaration
No longer depends on: Wimplicit-function-declaration
Assignee | ||
Comment 22•12 years ago
|
||
This adds the missing includes that broke linkage + also, dmose pointed out that not all changes were applied symmetrically (to android, darwin, linux and win32), now fixed.
Attachment #693939 -
Flags: review?(rjesup)
Assignee | ||
Comment 23•12 years ago
|
||
Note that the last patch is a follow-up, to be applied on-top of the first patch that has already landed on inbound.
Assignee | ||
Updated•12 years ago
|
Attachment #689908 -
Attachment is obsolete: true
Reporter | ||
Updated•12 years ago
|
Attachment #693939 -
Flags: review?(rjesup) → review+
Comment 24•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5c073841902c
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•12 years ago
|
Attachment #693939 -
Flags: checkin?(ethanhugg)
Assignee | ||
Updated•12 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 25•12 years ago
|
||
Comment on attachment 693939 [details] [diff] [review] Followup: Fixes implicit function warning that broke linkage + symmetric fixes http://hg.mozilla.org/integration/mozilla-inbound/rev/bafbc8d9c6b8
Attachment #693939 -
Flags: checkin?(ethanhugg) → checkin+
Comment 26•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/bafbc8d9c6b8
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Whiteboard: [WebRTC], [blocking-webrtc-] → [WebRTC], [blocking-webrtc-] [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•