#27274 closed defect (fixed)

ASan on OSX Travis is incompatible with Rust's santiziers

Reported by: alexcrichton Owned by:
Priority: High Milestone: Tor: 0.3.5.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: rust
Cc: Actual Points:
Parent ID: #25386 Points:
Reviewer: teor Sponsor:

Description

In helping to debug https://trac.torproject.org/projects/tor/ticket/25386 I've found that an unfortunate case is being hit where cargo test is using rustc's copy of the asan runtime instead of the system's copy, which causes problems due to presumably version mismatches between them.

The error looks like https://travis-ci.com/alexcrichton/tor/jobs/141409956 and only starts to show up after https://trac.torproject.org/projects/tor/ticket/27273 and https://trac.torproject.org/projects/tor/ticket/27272 are fixed.

AFAIK the only "fix" for this is to basically just delete the sanitizer runtimes in the Rust sysroot as they're not used anyway, but I'll try to keep thinking and see if there's a better solution!

Child Tickets

Change History (13)

comment:1 Changed 12 months ago by teor

Can we change the linker paths to put the system copy first?

comment:2 Changed 12 months ago by alexcrichton

Ah unfortunately I don't think so in this situation. The problem is mostly with cargo test itself. Cargo alters DYLD_LIBRARY_PATH to include the rustc sysroot libdir which contains the ASan dylib, and I think because it has the same name as the system one it ends up trumping it (and then causing problems because it's different).

Taking a look at Cargo it also looks like it prefixes DYLD_LIBRARY_PATH instead of suffixing it.

Geez this really is a mess with Cargo and rustc! You can probably tell that many other projects probably haven't gotten ASan C code + Rust working yet...

One of the better long-term fixes for this may be to rename rust's own copy of these dynamic libraries, ensuring that the don't clash with the system's perhaps

comment:3 Changed 12 months ago by gk

Component: - Select a componentCore Tor/Tor

comment:4 Changed 12 months ago by teor

Keywords: rust added
Milestone: Tor: 0.3.5.x-final

Geez this really is a mess with Cargo and rustc! You can probably tell that many other projects probably haven't gotten ASan C code + Rust working yet...

We seem to be doing ok disabling asan with rust, but it's not a long-term fix for mixed C-Rust projects.

comment:5 Changed 12 months ago by teor

Parent ID: #25386

comment:6 in reply to:  2 Changed 11 months ago by cypherpunks3

Replying to alexcrichton:

Geez this really is a mess with Cargo and rustc! You can probably tell that many other projects probably haven't gotten ASan C code + Rust working yet...

One of the better long-term fixes for this may be to rename rust's own copy of these dynamic libraries, ensuring that the don't clash with the system's perhaps

Do you have a link to the upstream github issue about this problem and the long-term solution?

comment:7 Changed 11 months ago by traumschule

No, but i had a path issue as well.

comment:8 Changed 11 months ago by alexcrichton

Oh sure! I've opened https://github.com/rust-lang/rust/issues/54134 to track this

comment:9 Changed 11 months ago by nickm

Priority: MediumHigh

comment:10 Changed 11 months ago by alexcrichton

I've sent a PR which I believe fixes this at https://github.com/torproject/tor/pull/381

comment:11 Changed 11 months ago by nickm

Status: newneeds_review

comment:12 Changed 10 months ago by dgoulet

Reviewer: teor

comment:13 Changed 10 months ago by nickm

Resolution: fixed
Status: needs_reviewclosed

I've merged the PR into 0.3.5! See #27273 for more commentary.

Note: See TracTickets for help on using tickets.