Closed Bug 1627768 Opened 5 years ago Closed 5 years ago

rust asan fails the check_networking test for getsockname

Categories

(Firefox Build System :: General, defect, P3)

defect

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: away, Assigned: away)

References

Details

Attachments

(1 file)

Using nightly-2020-04-04:

TEST-UNEXPECTED-FAIL | check_networking | libgkrust.a | Identified 1 networking function(s) being imported in the rust static library (getsockname)

At this point, we should probably just remove this check and work on Bug 1620045.

In lieu of removing the check, we can remove the function from the list of functions to check.

It would be good to understand why rust is now including this function though.

Oh, I just realized that this only happens when I enable asan on rust, so it must be something in the sanitizer runtime. I'm guessing https://github.com/llvm/llvm-project/blob/fad47d222561f0672223b0b3304ff1c739cb3288/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc#L2616-L2630.

I wonder why this wasn't a problem for "regular" (c++) asan? I guess the check_networking only looks at rust things?

(In reply to :dmajor from comment #2)

I guess the check_networking only looks at rust things?

Correct.

Maybe we should just turn this bug into "add ifndef MOZ_ASAN", if the bigger rewrite doesn't happen in time.

Blocks: 1563019
Summary: rustc 1.44 nightly fails the check_networking test for getsockname → rust asan fails the check_networking test for getsockname

decoder pointed out to me that we already have such an ifndef for MOZ_TSAN: https://searchfox.org/mozilla-central/rev/4d2a9d5dc8f0e65807ee66e2b04c64596c643b7a/config/makefiles/rust.mk#303. So asan will be an easy extension of that.

Priority: -- → P3

They all fail for the same reason: the sanitizer runtime in compiler-rt installs an interceptor for getsockname which then contains a call to the real implementation.

Assignee: nobody → dmajor
Status: NEW → ASSIGNED
Attachment #9140478 - Attachment description: Expand check_networking exemption to TSan and UBSan builds → Expand check_networking exemption to ASan and UBSan builds
Pushed by dmajor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9bf6c841e1d7 Expand check_networking exemption to ASan and UBSan builds r=rstewart
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: