Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'dlopen(null pointer)' does not work on the android #10356

Closed
jaeminMoon opened this issue Nov 8, 2013 · 6 comments · Fixed by #71537
Closed

'dlopen(null pointer)' does not work on the android #10356

jaeminMoon opened this issue Nov 8, 2013 · 6 comments · Fixed by #71537
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. O-android Operating system: Android T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@jaeminMoon
Copy link
Contributor

see rust/src/auxiliary/linkage-visibility.rs

#[no_mangle]
pub fn foo() { bar(); }

pub fn foo2<T>() {
    fn bar2() {
        bar();
    }
    bar2();
}

#[no_mangle]
fn bar() { }

#[no_mangle]
fn baz() { }

pub fn test() {
    let lib = DynamicLibrary::open(None).unwrap();
    unsafe {
        assert!(lib.symbol::<int>("foo").is_ok());
        assert!(lib.symbol::<int>("baz").is_err());
        assert!(lib.symbol::<int>("bar").is_err());
    }
}

This test code is success on linux, but fail on android.

 failed at 'assertion failed: lib.symbol::<int>("foo").is_ok()'

I think dlopen(null pointer, RTLD_LAZY) have to return 'main program Handle', but do not run on android.

@alexcrichton
Copy link
Member

I'm curious why DynamicLibrary::open didn't fail, but the later symbol lookups failed. Could you check to make sure that the symbols are actually present in the library? You should see that foo and test show up, along with possibly some other weirder ones.

@flaper87
Copy link
Contributor

flaper87 commented Apr 1, 2014

Triage bump.

I don't have a way to test this but the test in dynamic_lib is still disabled for android.

@jaeminMoon Do you have any input on this?

tamird added a commit to tamird/rust that referenced this issue Apr 22, 2015
tamird added a commit to tamird/rust that referenced this issue Apr 22, 2015
tamird added a commit to tamird/rust that referenced this issue Apr 22, 2015
tamird added a commit to tamird/rust that referenced this issue Apr 22, 2015
tamird added a commit to tamird/rust that referenced this issue Apr 22, 2015
tamird added a commit to tamird/rust that referenced this issue Apr 23, 2015
tamird added a commit to tamird/rust that referenced this issue Apr 24, 2015
@tamird
Copy link
Contributor

tamird commented Apr 24, 2015

This is confirmed still broken on Android :(

EDIT: at least on the buildbots

@steveklabnik
Copy link
Member

Triage: said test is here: https://github.com/rust-lang/rust/blob/f50dbd580f3d5d88a300da540db3c85164bfd0de/src/test/run-pass-fulldeps/auxiliary/linkage-visibility.rs

I don't see anything disabled on android by what @flaper87 suggested.

@tamird suggests this is broken on the bots, but I don't know enough about them to make the same evaluation.

@sfackler
Copy link
Member

That's the auxiliary file - the test itself is disabled:

// ignore-android: FIXME(#10356)

@Mark-Simulacrum Mark-Simulacrum added A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 19, 2017
@steveklabnik
Copy link
Member

Triage: no change

@bors bors closed this as completed in 4199ef1 Apr 26, 2020
Jarcho pushed a commit to Jarcho/rust that referenced this issue Feb 26, 2023
…logiq

Add `let_underscore_untyped`

Fixes rust-lang#6842

This adds a new pedantic `let_underscore_untyped` lint which checks for `let _ = <expr>`, and suggests to either provide a type annotation, or to remove the `let` keyword. That way the author is forced to specify the type they intended to ignore, and thus get forced to re-visit the decision should the type of `<expr>` change. Alternatively, they can drop the `let` keyword to truly just ignore the value no matter what.

r? `@llogiq`

changelog: New lint: [let_underscore_untyped]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. O-android Operating system: Android T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants