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

runtime-c-api tests fail with singlepass-backend #811

Closed
ethanfrey opened this issue Sep 18, 2019 · 5 comments
Closed

runtime-c-api tests fail with singlepass-backend #811

ethanfrey opened this issue Sep 18, 2019 · 5 comments
Assignees
Labels
bug Something isn't working 📦 lib-c-api About wasmer-c-api

Comments

@ethanfrey
Copy link
Contributor

ethanfrey commented Sep 18, 2019

Describe the bug

echo "`wasmer -V` | `rustc -V` | `uname -m`"
wasmer: command not found
 | rustc 1.38.0-nightly (c43d03a19 2019-08-14) | x86_64

git log -1 provides:

commit 6d351b514ccc15fa2f344de4ed68506a6d3baa23 (HEAD -> master)
Merge: 569d0386 91b199fe
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Thu Aug 29 20:48:53 2019 +0000

I realized this was an old commit.

I then updated to current master, fixed a typo, and while cargo test passes,
cargo test --features singlepass-backend --no-default-features returns a linking error:

   Compiling wasmer-runtime-c-api v0.7.0 (/home/ethan/IdeaProjects/wasmer/lib/runtime-c-api)
error: linking with `cc` failed: exit code: 1
  |
...
note: /usr/bin/ld: /home/ethan/IdeaProjects/wasmer/target/debug/deps/libwasmer_runtime_core-dcfea6f3cbfc5444.rlib(image-loading-linux-x86-64.o): relocation R_X86_64_PC32 against symbol `get_boundary_register_preservation' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/ld: final link failed: Bad value
          collect2: error: ld returned 1 exit status

from:

commit 0ea5b1b2bd87a704e2963bb92b9c0d96e2bf66ba (HEAD -> master, origin/staging, origin/master)
Merge: 174cc9f0 71b865aa
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Wed Sep 18 16:59:37 2019 +0000

Steps to reproduce

cd lib/c-runtime-api
cargo test --features singlepass-backend --no-default-features

fails on current master

Note that I had to use --no-default-features flags so this compiles at all.

Expected behavior

Tests pass, as with cranelift or llvm

Actual behavior

Result:

test 11
      Start 11: test-module-serialize

11: Test command: /home/ethan/IdeaProjects/wasmer/lib/runtime-c-api/tests/test-module-serialize
11: Test timeout computed to be: 9.99988e+06
11: test-module-serialize: /home/ethan/IdeaProjects/wasmer/lib/runtime-c-api/tests/test-module-serialize.c:25: main: Assertion `serialize_result == WASMER_OK' failed.
11/15 Test #11: test-module-serialize ............***Exception: Child aborted  0.17 sec

Additional context

@ethanfrey ethanfrey added the bug Something isn't working label Sep 18, 2019
@Hywan Hywan self-assigned this Sep 19, 2019
@Hywan Hywan added the 📦 lib-c-api About wasmer-c-api label Sep 19, 2019
@Hywan
Copy link
Contributor

Hywan commented Sep 19, 2019

Thanks for the bug report!

@losfair Can you take a look at this bug please?

@ethanfrey
Copy link
Contributor Author

I had a long discussion on this with @nlewycky outside of github. And resolved some parts of this.

The linkage error for single-pass has been fixed with #814 I don't really understand the meaning of the change, but Nick debugged it and I verified it worked on my machine. (He had a different, unsupported, version of ld and it failed with a different error earlier).

The other error was tracked down to the fact that singlepass compiler never had support for serialization. This just was never tested before. In the end, I managed to get out this message (why test-module-serialize fails with singlepass backend): the singlepass backend doesn't support caching yet.

And found the smoking gun:

"the singlepass backend doesn't support caching yet".to_string(),

Handling this - either implementing it or documenting it as the wasmer team decides - can be another issue when you figure out your approach. I would be fine with closing this when #814 is merged, and linking to the new focused issue on how to handle the now known serialization issue.

@syrusakbary
Copy link
Member

We have now caching in singlepass. I'll do a quick check to see if the runtime-c-api tests pass with it :)

@ethanfrey
Copy link
Contributor Author

Amazing. Can you link the pr that added caching to singlepass? I'm definitely excited about the 0.12 release now.

@syrusakbary
Copy link
Member

Here's the PR adding caching to singlepass: #1022

We also just merged this PR which tests the capi with all the backends (singlepass, cranelift and llvm): #1060

So we should be good closing this issue now since caching is implemented for singlepass and the capi works with it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-c-api About wasmer-c-api
Projects
None yet
Development

No branches or pull requests

3 participants