On Mon, Oct 10, 2016 at 06:24:33PM +0300, Henri Sivonen wrote:
> For benchmarking purposes, I'd like to call uconv from a Rust program.
> Since building uconv separately from Gecko hasn't really been
> maintained, I figured that I'd export a small number of C-linkage
> functions from libxul, dynamically link with libxul as built as part
> of Linux x86_64 Firefox and call NS_InitMinimalXPCOM() once before
> calling my exported test functions.
> 
> I can get Cargo to link my Rust program with libxul, but upon running
> the program, it crashes immediately with "signal: 11, SIGSEGV: invalid
> memory reference" even if I don't even try to call into libxul at all.

What is the stack trace for that crash?

> Is there some easily-addressable obvious reason for the process dying
> due to just dynamically linking with libxul without even calling into
> it? Related to jemalloc and/or static initializers maybe? (I'm
> expecting that if this was about duplicate symbols due to two copies
> of the Rust standard library or jemalloc, the linker would barf, but
> I'm not sure if that's a correct expectation.)

Build libxul with jemalloc disabled for starters. That being said, ISTR
there are or used to be uconv standalone tests that didn't require
linking libxul, so you could also try to link uconv + xpcom.

Mike
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to