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

rust agent cgroups crate ftbfs on ARM #770

Closed
jodh-intel opened this issue Sep 21, 2020 · 7 comments · Fixed by #779
Closed

rust agent cgroups crate ftbfs on ARM #770

jodh-intel opened this issue Sep 21, 2020 · 7 comments · Fixed by #779
Assignees

Comments

@jodh-intel
Copy link
Contributor

Seen on Jenkins ARM CI for #735 (http://jenkins.katacontainers.io/job/kata-containers-2.0-ubuntu-ARM-PR/305/console):

   Compiling cgroups v0.1.1-alpha.0 (https://github.com/kata-containers/cgroups-rs?tag=0.1.1#3852d7c1)
error[E0308]: mismatched types
   --> /home/jenkins/.cargo/git/checkouts/cgroups-rs-1340950e7d819bfb/3852d7c/src/lib.rs:769:34
    |
769 |     let _ = unsafe { libc::rmdir(p.as_ptr() as *const i8) };
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `cgroups`.

/cc @lifupan, @jongwu, @justin-he

@jodh-intel jodh-intel added this to To do in Issue backlog Sep 21, 2020
@lifupan lifupan self-assigned this Sep 22, 2020
@gnawux
Copy link
Member

gnawux commented Sep 22, 2020

@jodh-intel Are you a DD? I missed abbreviations like "FTBFS" for a long time since I hadn't played with Debian.

@Kvasscn
Copy link
Contributor

Kvasscn commented Sep 22, 2020

A related issue: kata-containers/cgroups-rs#9

@jongwu
Copy link
Contributor

jongwu commented Sep 22, 2020

@jodh-intel @Kvasscn maybe I find the root cause. the parameter of libc:rmdir can be i8 in x86 and u8 in aarch64.
the definition of rmdir see https://github.com/cloud-hypervisor/cloud-hypervisor/blob/7c346c38448a8486353266b23c32273fa4884667/Cargo.toml#L18
The self-defined type c_char can be different type varying with arch, os and lib. see https://github.com/rust-lang/libc/search?p=3&q=pub+type+c_char+%3D.
So I think that it is a bug from cgroup-rs. Maybe we should set different type depending on arch in the definition of libc_rmdir.
see https://github.com/kata-containers/cgroups-rs/blob/8717524f2c95aacd30768b6f0f7d7f2fddef5cac/src/lib.rs#L769
WDYT?

@jodh-intel
Copy link
Contributor Author

@gnawux - alas, no :) I was a DM for a few packages but also used to work with doko, so fbtfs was mentioned a lot around him ;)

@jongwu - nice work! @lifupan - could you tal at this and update https://github.com/kata-containers/cgroups-rs maybe?

@lifupan
Copy link
Member

lifupan commented Sep 22, 2020

Hi @jodh-intel @jongwu

Yeah, the root cause was just as jongwu said, there was difference between x86 and aarch64 on c_char's definition. And the PR kata-containers/cgroups-rs#10 had fixed, I'll send a PR to update the cgroup-rs crate in agent to fix it.

@jodh-intel
Copy link
Contributor Author

Thanks @lifupan!

lifupan added a commit to lifupan/kata-containers that referenced this issue Sep 22, 2020
Update cgroups crate to fix the building issue
on Aarch64.

Fixes: kata-containers#770

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
@jodh-intel jodh-intel moved this from To do to In progress in Issue backlog Sep 22, 2020
@Amulyam24
Copy link
Contributor

FYI, this error is encountered on ppc64le as well. Thanks @jodh-intel, @jongwu and @lifupan for fixing it.

lifupan added a commit to lifupan/kata-containers that referenced this issue Sep 22, 2020
Update cgroups crate to fix the building issue
on Aarch64.

Fixes: kata-containers#770

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
Issue backlog automation moved this from In progress to Done Sep 23, 2020
egernst pushed a commit to egernst/kata-containers that referenced this issue Oct 2, 2020
Update cgroups crate to fix the building issue
on Aarch64.

Fixes: kata-containers#770

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
@jodh-intel jodh-intel moved this from Done to In progress in Issue backlog Oct 2, 2020
egernst pushed a commit that referenced this issue Oct 7, 2020
Update cgroups crate to fix the building issue
on Aarch64.

Fixes: #770

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Issue backlog
  
In progress
Development

Successfully merging a pull request may close this issue.

6 participants