-
Notifications
You must be signed in to change notification settings - Fork 1.7k
je_malloc_usable_size not found #9167
Comments
Hey, I think this is an issue with the heapsize crate crate because it assumes For further description see: servo/heapsize#80 I don't have any Mac machine to confirm this but may just try building it in release-mode: $ cargo build -p parity-clib --release @tomaka any thoughts on this? I guess this will also impact |
Shouldn't this also happen when compiling the parity binary? |
@niklasad1 unfortunately @tomaka a normal parity build with |
I think this only applies dynamically linked libraries i.e, with rust terms |
@niklasad1 yes, thats true. the static library is buildable, but im not very sure that this is usable - the symbol should be missing there too, am I right? |
Hmm.. after looking into |
I found a workaround for this, but I'm not sure whether this problem will also exist on ios / android. Those are the first rust lines I wrote :D However, I added the following function to #[no_mangle]
#[cfg(target_os = "macos")]
pub extern fn je_malloc_usable_size(_ptr: *const c_void) -> usize {
unsafe {
extern "C" {
fn malloc_usable_size(ptr: *const c_void) -> usize;
}
return malloc_usable_size(_ptr);
}
} I was able to compile & run the example with |
This is an extremely hazardous work-around. The code can break every time we upgrade Rust. Also it would need to be enabled only in debug if I understand correctly. |
@tomaka yeah that may be true. I guess thats really an issue within What I don't understand: why is the stuff working for the normal
I don't understand why this may break every time if Rust is upgraded - its just an issue with the exported symbols of |
I just created an issue here: servo/heapsize#97 |
Unfortunately I think they have been having a pretty long discussion about this already, and the conclusion is that |
Ah ok.. sounds not good.. However, I think it might be a good idea to add |
@tomaka please see servo/heapsize#97 (comment) |
@tomaka @niklasad1 I still don't really understand why there is no linking issue with the normal parity build - any ideas? |
@tomaka @niklasad1 I was able to understand what is happening here, but due to lack of rust & parity-ethereum codebase knowledge I will probably not yet be able to create fix for this issue. @tomaka you where right, my work-around is extremely hazardous. I just read https://doc.rust-lang.org/1.9.0/book/custom-allocators.html. That means at least for macos it looks like that I think the best solution is probably really to create a custom crate for |
With Rust 1.28, adding |
parity version: 4fec2f2 |
* Switch to non prefixed malloc_size_of on macos * Fix * Testing darwin build * Fix import * conflict * switch heapsize deps commit * switch heapsize commit * Rename branch * Restore gitlab ci to origin * test for mac * mac tests? * Switch of macos CI tests.
Build Ok , this issue should close. |
I having an issue building
parity-clib
. I get the following linker error, because of undefined symbols:I used
cargo build -p parity-clib
to buildparity-clib
.The text was updated successfully, but these errors were encountered: