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

Valgrind on PowerPC #15

Open
thomwiggers opened this issue Feb 5, 2019 · 6 comments
Open

Valgrind on PowerPC #15

thomwiggers opened this issue Feb 5, 2019 · 6 comments
Labels
enhancement New feature or request maybe someday Something that we may come back to at some point but will not invest much time in for now.

Comments

@thomwiggers
Copy link
Member

thomwiggers commented Feb 5, 2019

@joostrijneveld did some experiments showing that it's possible to emulate (classic) PowerPC on Travis CI. However, it is not possible to run all of our tests. After some investigating, I have reached the following conclusions.

  • QEMU has a "user" mode and a "system" mode of emulating architectures.
  • qemu-user-ppc segfaults valgrind, probably because both qemu-user and valgrind intercept system calls and do other weird things.
  • Everything works on the PowerBook G4 that we have, but we would need to integrate our own CI (and the typical containerisation solutions (Docker) aren't supported on 32-bit PowerPC).
  • qemu-system-ppc (full virtual machine) works for valgrind, but is hard to automate.
  • The MIPS-variant emulated by qemu-user-mips seems unsupposted by valgrind (and qemu-user would probably still not work).
  • I'm having a hard time getting qemu-user-ppc64 to work. Should not be confused with ppc64le or ppc64el which are little-endian! Likely to run into the same issues though.

The way forward seems to be to skip valgrind on PPC, like on OS X, though it would have been nice to perform the memory validations etc on the different architecture to make sure there are no endianness-assuming things that break memory somehow. Perhaps we can come back to it later – for now, the scripts we'll set up in #10 should skip qemu-ppc.

TL;DR: Emulating PPC in userspace breaks valgrind.

Possible solutions are:

  • Use full system virtualisation with qemu-system. Need to worry about networking, installing the VM (or download a disk image) and going to be annoying to set up on Travis.
  • Run CI runners on actual hardware. Isolation issues.

For now: just skip Valgrind on ppc. Fix maybe someday.

@thomwiggers thomwiggers added enhancement New feature or request maybe someday Something that we may come back to at some point but will not invest much time in for now. labels Feb 5, 2019
thomwiggers added a commit that referenced this issue Feb 5, 2019
This has the downside of not supporting running tests on Valgrind, see
the discussion in issue #15. However, this does test quite a lot
already.

This uses the docker container defined in
https://github.com/thomwiggers/debian-unstable-powerpc/.

Co-authored-by: Thom Wiggers <thom@thomwiggers.nl>
@dstebila
Copy link
Member

dstebila commented Feb 5, 2019

For now, just skip Valgrind on ppc. For "second-tier" systems I think our initial goal would just be that the code builds successfully.

@gkerde
Copy link

gkerde commented Feb 8, 2019

I've got a PowerPC Mac G5. Pretty fancy in it's day, but it still runs fine if you guys need some real hardware to test on

@thomwiggers
Copy link
Member Author

The issue is not so much the lack of hardware. The problem is more that there is no convenient build service that allows us to dynamically provision and tear down the build environment, much like how Travis does this. There are of course no service providers who do this. We tried (and do) emulating on Travis, as described above, but there are issues with Valgrind.

Because Linux on 32-bit PPC seems to be much more limited in terms of these isolation features (e.g. no Docker, Virtualbox), running our own CI stacks would be a bit annoying. We have the PowerBook G4, but I'd need to spend a significant amount of time to get this environment done. For now, running Valgrind on the powerbook manually once in a while seems a better way to spend time.

@barracuda156
Copy link

If there are any fixes for Valgrind on PPC (big endian), please update us.

@thomwiggers
Copy link
Member Author

@barracuda156 As ppc (old-fashioned, 32-bit ppc) is pretty much a dead architecture, I don't expect much development to still happen on this issue. I've once in a while ran everything on our old powerbook-on-a-shelf, but keeping its Debian stack up to date has been increasingly difficult as they've dropped mainline support as well.

Can you elaborate what you need with PowerPC?

@thomwiggers
Copy link
Member Author

Note that our problems in this issue were Valgrind on qemu user mode emulated ppc only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maybe someday Something that we may come back to at some point but will not invest much time in for now.
Projects
None yet
Development

No branches or pull requests

4 participants