Closed Bug 790504 Opened 13 years ago Closed 13 years ago

Signaling code should directly use malloc/free

Categories

(Core :: WebRTC: Signaling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ehugg, Assigned: ehugg)

Details

(Whiteboard: [WebRTC], [blocking-webrtc-], [qa-])

Attachments

(3 files, 7 obsolete files)

The signaling code currently has a bunch of memory handling code which should all be replaced by a FF standard like moz_xmalloc.
Assignee: nobody → ethanhugg
Comment on attachment 660304 [details] [diff] [review] Patch 1 - Signaling code changed to use moz_xmalloc Everything in signaling uses cpr_malloc which I def'd to moz_xmalloc, same with the calloc, realloc and free. I will make a second patch with the removal of all of the unused memory management code.
Attachment #660304 - Flags: feedback?(rjesup)
Attachment #660304 - Flags: feedback?(ekr)
Comment on attachment 660304 [details] [diff] [review] Patch 1 - Signaling code changed to use moz_xmalloc Review of attachment 660304 [details] [diff] [review]: ----------------------------------------------------------------- This all looks basically fine. The changes to VcmSIPCSBinding.cpp look to be cosmetic only (spaces, etc.) Maybe unnecessary?
Comment on attachment 660304 [details] [diff] [review] Patch 1 - Signaling code changed to use moz_xmalloc Review of attachment 660304 [details] [diff] [review]: ----------------------------------------------------------------- This all looks basically fine. The changes to VcmSIPCSBinding.cpp look to be cosmetic only (spaces, etc.) Maybe unnecessary?
Attachment #660304 - Flags: feedback?(ekr) → feedback+
>The changes to VcmSIPCSBinding.cpp look to be cosmetic only (spaces, etc.) >Maybe unnecessary? The VcmSIPCCBinding.cpp changes are changing malloc() to cpr_malloc(). I considered changing them directly to moz_xmalloc(), but I'm trying to keep it consistent with the rest of the signaling code so that the allocators could all be changed in one place if necessary.
Wow, my brain just seems to see cpr_malloc == malloc now.
Whiteboard: [WebRTC], [blocking-webrtc-]
Attachment #660304 - Attachment is obsolete: true
Attachment #660304 - Flags: feedback?(rjesup)
Attachment #660529 - Attachment is obsolete: true
moz_xmalloc is the wrong thing to use. Changing the patch to use malloc/calloc/realloc/free. Next patch will remove all memory management code from signaling.
Summary: Signaling code should use moz_xmalloc → Signaling code should directly use malloc/free
Attachment #660572 - Attachment is obsolete: true
Attachment #660609 - Attachment is obsolete: true
Comment on attachment 660617 [details] [diff] [review] Patch 1 - Signaling code changed to directly use malloc/free Review of attachment 660617 [details] [diff] [review]: ----------------------------------------------------------------- ::: media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c @@ +1478,5 @@ > result = sdp_attr_get_ice_attribute (sdp_p, level, 0, sdp_attr, (uint16_t) (i + 1), > &ice_attrib); > if (result != SDP_SUCCESS) { > GSM_ERR_MSG("Failed to retrieve ICE attribute\n"); > + cpr_free(*ice_attribs); Switching to free() and having -Werror made the Try builders pop out this little gem. Trying to free the function param.
Attachment #660617 - Attachment is obsolete: true
Attachment #660938 - Attachment is obsolete: true
Attachment #660987 - Flags: feedback?(rjesup)
Attachment #660987 - Flags: feedback?(ekr)
Attachment #660987 - Attachment is obsolete: true
Attachment #660987 - Flags: feedback?(rjesup)
Attachment #660987 - Flags: feedback?(ekr)
Attachment #661081 - Flags: feedback?(rjesup)
Attachment #661081 - Flags: feedback?(ekr)
Comment on attachment 661081 [details] [diff] [review] Patch 2 - remove unused memory management code from signaling. Pushed to Alder - http://hg.mozilla.org/projects/alder/rev/8b21741e7037
Attachment #661081 - Flags: feedback?(rjesup)
Attachment #661081 - Flags: feedback?(ekr)
Oh good, this gets rid of cpr_crashdump(), which I was about to flag.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Re-opening this one. We need to go back to trying moz_xmalloc which really is infallible.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #667112 - Flags: feedback?(rjesup)
Attachment #667112 - Flags: feedback?(rjesup) → feedback+
Comment on attachment 667112 [details] [diff] [review] Change to use moz_xmalloc moz_xmalloc patch pushed to Alder - https://hg.mozilla.org/projects/alder/rev/0a74f8743068
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Whiteboard: [WebRTC], [blocking-webrtc-] → [WebRTC], [blocking-webrtc-], [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: