Skip to content

RPC API Has host endianness #1795

Open
Open

Description

@peternewman
    > @yoe [91cb697](https://github.com/OpenLightingProject/ola/commit/91cb697912664d58317d001f1e7998ac556c9de6) should fix those test on Big Endian architecture, would you mind testing it somehow as I've only dummied it up by reversing stuff on an LE machine. @brucelowekamp care to take a look at it for any Python howlers I've introduced?

I don't know of any python concerns, but I do have to ask if this isn't a protocol error? It's sent out on the socket, so if you were to use the API across two endian machines, it wouldn't work? Looks like both the Python and C++ do the same thing, but still....

Bruce

Originally posted by @brucelowekamp in #1687 (comment)

Activity

  1. peternewman commented on Nov 12, 2022

    @peternewman
    MemberAuthor

    My original reply:

    I'd be tempted to agree with you @brucelowekamp and I did consider fixing it. However due to the limitations mentioned here:
    http://docs.openlighting.org/ola/doc/latest/rpc_system.html#rpc_OLA_RPC

    There won't/shouldn't be any inter-machine comms and hence any multi-endian issues. Whereas if we do fix it, then if someone runs an unfixed client against a fixed server, it won't work. Although given this is only on BE machines, I guess it's a fairly low risk. It will definitely be a breaking change though, so I'm not sure I'm personally convinced of the benefit apart from hypothetically. I guess we should at least flag the lines of code with a TODO and possibly consider making the change for 0.11.0 or similar.

    Unfortunately @yoe found it didn't entirely work:

    (10:52:23) wouter: PeterNewman4: your patches don't seem to resolve the issue
    (10:52:31) wouter: that is, it kind of works, but things seem to hang
    (10:52:58) wouter: and I also get a line saying "WARNING:root:Protocol mismatch: 3 != 1" when I run python/ola/RDMTest.py
    

    Having had a better look, that code is in our codebase:

    if version != self.PROTOCOL_VERSION:
    ola_logger.warning('Protocol mismatch: %d != %d', version,
    self.PROTOCOL_VERSION)
    self._skip_message = True
    self._expected_size = size

    Given it's the RDM ones, presumably it's of course going to be because they have responses too and I haven't mangled those responses on the way back out, so it can't read them on BE architectures/thinks they're corrupt!

    Originally posted by @peternewman in #1687 (comment)

  2. added this to the 0.future milestone on Nov 12, 2022
  3. modified the milestones: 0.future, Future on Nov 12, 2022
  4. peternewman commented on Nov 12, 2022

    @peternewman
    MemberAuthor

    In fact this would need to be for 1.0.0 given "MAJOR version when you make incompatible API changes".

  5. changed the title [-]RPC API Has fixed endianness[/-] [+]RPC API Has host endianness[/+] on Nov 12, 2022
  6. kripton commented on Feb 15, 2023

    @kripton
    Member

    If it helps: I do have a Big Endian machine here (iBook G4) that I can use to test stuff. Of course, qemu might do as well but I wanted to mention it anyways. Remote access can be arranged but beware, it's a slow machine

  7. DaAwesomeP commented on Feb 15, 2023

    @DaAwesomeP
    Member

    I'm going to attempt s390x in QEMU in the new GitHub Actions CI. For Python projects I have used cibuildwheel which uses QEMU for s390x very reliably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions