Closed Bug 1405139 Opened 7 years ago Closed 7 years ago

fsanitize=enum (ubsan) runtime errors for TrackInfo::TrackType

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: arthur, Assigned: arthur)

References

Details

(Whiteboard: [tor])

Attachments

(1 file)

With clang -fsanitize=enum, I see the following runtime errors in automated testing on linux64-asan. Seems to be caused by loading of stagefright_MPEG4Metadata.test_case_mp4:

 dom/media/MediaInfo.cpp:14:11 	 1 	 load of value 4294967295, which is not a valid value for type 'TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:278:35 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:281:28 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:296:7 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:300:14 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:371:32 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:374:25 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:517:13 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:544:25 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:559:13 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:582:25 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:800:11 	 1 	 load of value 4294967295, which is not a valid value for type 'TrackI
nfo::TrackType'
 media/libstagefright/binding/MP4Metadata.cpp:834:24 	 1 	 load of value 4294967295, which is not a valid value for type 'mozill
a::TrackInfo::TrackType'
Component: Audio/Video → Audio/Video: Playback
Hi Gerald, I'm proposing removing these lines because I'm planning to add -fsanitize=enum in the debug build, and it disallows values outside the enum range. (See bug 1404547.) So those tests will be superfluous.
Assignee: nobody → arthuredelstein
Attachment #8914833 - Flags: review?(gsquelart)
Comment on attachment 8914833 [details] [diff] [review]
0001-Bug-1405139-Fix-ubsan-runtime-error-for-TrackInfo-Tr.patch

Review of attachment 8914833 [details] [diff] [review]:
-----------------------------------------------------------------

I think at the time I may have been worried that these calls could be made with a TrackType coming from the (externally-sourced) media itself, and therefore could potentially be unexpected values.
But in fact, in all instances I can see, this TrackType is explicitly specified as one of the enum constants in our code. So it should be safe not to worry about handling non-compliant enum values, as they should never happen; and these tests are indeed not necessary.

Thank you for submitting this patch.
Attachment #8914833 - Flags: review?(gsquelart) → review+
Thanks for the review!
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6783b6208ea6
Fix ubsan runtime error for TrackInfo::TrackType. r=gerald
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/6783b6208ea6
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: