Closed Bug 1216769 Opened 4 years ago Closed 4 years ago

getUserMedia trunk logging bugs (illegal mem access on B2G) with NSPR_LOG_MODULES=MediaManager:5

Categories

(Core :: WebRTC, defect, P1)

42 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed
Blocking Flags:

People

(Reporter: jib, Assigned: jib)

References

Details

Attachments

(1 file)

Caused by int64 argument to %ld in a printf in LOGFRAME macro, in two places, one potentially crashing in B2G debug-only (same problem as Bug 1216758 but for B2G-only code which unlike that bug is still in the tree).
Bug 1216769 - change %ld to %lld to fix logging problems in trunk and B2G
Attachment #8676510 - Flags: review?(rjesup)
Comment on attachment 8676510 [details]
MozReview Request: Bug 1216769 - change %ld to %lld to fix logging problems in trunk and B2G

https://reviewboard.mozilla.org/r/22737/#review20247

::: dom/media/webrtc/MediaEngineGonkVideoSource.cpp:82
(Diff revision 1)
> -  LOGFRAME(("NotifyPull, desired = %ld, delta = %ld %s", (int64_t) aDesiredTime,
> +  LOGFRAME(("NotifyPull, desired = %lld, delta = %lld %s", (int64_t) aDesiredTime,

Let's try PRIi64 instead of lld

::: dom/media/webrtc/MediaEngineRemoteVideoSource.cpp:322
(Diff revision 1)
> -  LOGFRAME(("frame %d (%dx%d); timestamp %u, ntp_time %lu, render_time %lu", frame_num++,
> +  LOGFRAME(("frame %d (%dx%d); timestamp %u, ntp_time %llu, render_time %llu",

...%" PRIu64 "..."
Attachment #8676510 - Flags: review?(rjesup) → review+
PRIi64 and PRIu64 require including "inttypes.h". OK to stick with %lld and %llu? They're quite common in the tree (PRIi64 less so).
Flags: needinfo?(rjesup)
(In reply to Jan-Ivar Bruaroey [:jib] from comment #3)
> PRIi64 and PRIu64 require including "inttypes.h". OK to stick with %lld and
> %llu? They're quite common in the tree (PRIi64 less so).

If %lld/u it should be cast to long long or long long unsigned -- i.e. match the format spec.
Flags: needinfo?(rjesup)
Comment on attachment 8676510 [details]
MozReview Request: Bug 1216769 - change %ld to %lld to fix logging problems in trunk and B2G

Bug 1216769 - change %ld to %lld to fix logging problems in trunk and B2G
backlog: --- → webrtc/webaudio+
Rank: 19
Priority: -- → P1
https://hg.mozilla.org/mozilla-central/rev/687ef79303f3
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.