Open Bug 996026 Opened 10 years ago Updated 1 year ago

Use UndefinedBehaviorSanitizer (ubsan) in ASAN builds

Categories

(Core :: General, defect)

defect

Tracking

()

People

(Reporter: ehsan.akhgari, Unassigned)

Details

Attachments

(1 file)

(See -fsanitize=undefined in http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation)

This should enable us to catch things like signed integer overflow.
OS: Mac OS X → All
Hardware: x86 → All
I've tried introducing UBSan a few times before already. In short: People don't seem to be interested in the results. Even for more severe things like signed integer overflows, we have subsystems (e.g. layout) where this behavior is desired and the developers insist on keeping it that way. To work around this, we would have to create huge blacklists and a custom system to ignore all errors that people don't want to fix.

For signed integer overflow in particular, also see bug 919486.
Hello.

I tried to test latest Firefox with UBSAN enabled in GCC and I get a lot of issues. Understand that
some of them all fine, however some worth for fixing:

+ runtime error: left shift of negative value 
+ runtime error: load of value 4294967295, which is not a valid value for type 'JSGCParamKey'
+ runtime error: member access within misaligned address 0x7fb9dc0097bc for type 'struct region_type_t', which requires 8 byte alignment

I can create a new issue for subsystems, if you want?

Thanks,
Martin
Attached file FF UBSAN errors
Thanks Martin! It would be best to file separate new bugs for each of the errors reported, if possible :)
Oh, and mention them here after they're created, please.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: