Closed Bug 1404169 Opened 7 years ago Closed 7 years ago

fsanitize=enum (ubsan) runtime errors in extensions/universalchardet/src/base/nsCodingStateMachine.h

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: arthur, Assigned: arthur)

References

(Blocks 1 open bug)

Details

(Whiteboard: [tor])

Attachments

(1 file)

I am working on tracking down and fixing ubsan errors reported in Mozilla's automated tests. When I use -fsanitize=enum, one of the errors I get is: > [task 2017-09-25T00:47:57.792Z] 00:47:57 INFO - TEST-START | extensions/universalchardet/tests/test_bug426271-utf-8.html > [task 2017-09-25T00:47:57.902Z] 00:47:57 INFO - GECKO(4261) | /builds/worker/workspace/build/src/extensions/universalchardet/src/base/nsCodingStateMachine.h:49:12: runtime error: load of value 5, which is not a valid value for type 'nsSMState' > [task 2017-09-25T00:47:57.903Z] 00:47:57 INFO - GECKO(4261) | /builds/worker/workspace/build/src/extensions/universalchardet/src/base/nsCodingStateMachine.h:39:9: runtime error: load of value 5, which is not a valid value for type 'nsSMState' > [task 2017-09-25T00:47:57.904Z] 00:47:57 INFO - GECKO(4261) | /builds/worker/workspace/build/src/extensions/universalchardet/src/base/nsCodingStateMachine.h:46:30: runtime error: load of value 5, which is not a valid value for type 'nsSMState' > [task 2017-09-25T00:47:57.906Z] 00:47:57 INFO - GECKO(4261) | /builds/worker/workspace/build/src/extensions/universalchardet/src/base/nsCodingStateMachine.h:46:30: runtime error: load of value 5, which is not a valid value for type 'nsSMState' the same error was reported here: https://bugs.freedesktop.org/show_bug.cgi?id=101032 where they replaced the nsSMState by an unsigned int. Here's the patch: https://cgit.freedesktop.org/uchardet/uchardet/commit/?id=53f7ad0e0b0894f11c948ee75f74595ab1b61405 Should we do the same thing?
Yes, nsSMState shouldn't use enum. It uses non-enum value too.
Priority: -- → P3
Thanks. Here's a version of the patch for mozilla-central.
Attachment #8913508 - Flags: review?(m_kato)
Attachment #8913508 - Flags: review?(m_kato) → review+
Thank you for the review. Try server results: https://treeherder.mozilla.org/#/jobs?repo=try&revision=be58c7cf95e9
Assignee: nobody → arthuredelstein
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/2e390724da6f Fix ubsan runtime error for nsSMState enum. r=m_kato
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Blocks: 1404547
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: