Closed Bug 1345609 Opened 7 years ago Closed 7 years ago

enable -Wformat for libstagefright

Categories

(Core :: Audio/Video: Playback, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: tromey, Assigned: tromey)

References

Details

Attachments

(1 file)

After a discussion on irc about a missing warning for an invalid printf
format in libstagefright, we found:

https://dxr.mozilla.org/mozilla-central/source/media/libstagefright/moz.build#164

These lines can be removed now, and then the fallout fixed up.
I looked and this seems to be the only remaining moz.build that disables this.
This worked locally but only a try will really tell.
Assignee: nobody → ttromey
Comment on attachment 8845124 [details]
Bug 1345609 - add -Werror=format to libstagefright;

https://reviewboard.mozilla.org/r/118342/#review120194

Thank you for this.
Attachment #8845124 - Flags: review?(gsquelart) → review+
Something is fishy here because if there are real format string errors in libstagefright,
I would have expected this patch to catch them, but it didn't:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5de0c2e5e3e3a8608508cf7debe23ee41f509d10
How did you find those failures?
Flags: needinfo?(gsquelart)
Not sure what you mean...
In the Try you're linking, open a build log and search "warning: format" to find them.
(Or were you expecting them to appear as errors?)

When working on bug 1345671, I just applied your patch locally, and did a build&fix loop until clean.
In my own Try, Stagefright warnings are all gone:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3b76ca7bd01713a5c780315a1915597e44098893
Flags: needinfo?(gsquelart)
> (Or were you expecting them to appear as errors?)

Yes, I was.
I was under the impression that try runs were done with warnings as errors,
but looking at the log I see this only seems to be the case for js/.
I think we probably need -Werror=format in build/moz.configure/warnings.configure
Doing that found some more errors (on top of bug 1345671) locally.
Pushing this through try again, though, reminds me of why we didn't
do this -- webrtc build problems.

Try run here:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=693e1e7ef42cec919c022d981591ef5c31a56417

There's some discussion starting here: https://bugzilla.mozilla.org/show_bug.cgi?id=1060419#c396
I am trying the more localized approach of enabling -Werror=format just for
libstagefright.  Presumably though I should go through most of the tree, adding this
to various moz.build files.
This one built "ok"; I am hoping those build failures are not my fault.
The logs say:
   MOZ_BUILD_DATE must be provided as an environment var on Taskcluster
... which doesn't mean anything to me.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=6150900d1b525e21c589211d5c357d172d297a41

I'll attach the updated patch momentarily.
Comment on attachment 8845124 [details]
Bug 1345609 - add -Werror=format to libstagefright;

I don't remember how to get mozreview to re-request a review,
so I'm tinkering with the flags here.
Attachment #8845124 - Flags: review+ → review?(gsquelart)
A try push without my patch also shows those build failures.
I will try to either rebase next week or see if there's something else
to do about these.  I wouldn't want to land anything like this without
a clean build.
Comment on attachment 8845124 [details]
Bug 1345609 - add -Werror=format to libstagefright;

https://reviewboard.mozilla.org/r/118342/#review121182

Strange that I didn't see these issues. Thank you for fixing them.
Attachment #8845124 - Flags: review?(gsquelart) → review+
I'll attach a rebased version in a sec.
Running through try again to verify that the build issues from last week were transient.
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8f8c4fb52e61
add -Werror=format to libstagefright; r=gerald
https://hg.mozilla.org/mozilla-central/rev/8f8c4fb52e61
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: