panda-re / panda

Platform for Architecture-Neutral Dynamic Analysis
https://panda.re
Other
2.48k stars 479 forks source link

pandadev:latest Docker image encounters 'serialized_options' error on protobuf #1019

Closed onionyst closed 3 years ago

onionyst commented 3 years ago

Docker image pandare/pandadev:latest (DIGEST 306eacc011ca) may have a conflict on default Protobuf versions between its base image Ubuntu 20.04 (protobuf 3.6.1 for focal) and Python 3.8 (protobuf 3.0.0 latest confirmed in ecfe828a302cdd99cf0858063d27624c49dcb3f1). The /panda/panda/scripts/install_ubuntu.sh script now ends up with a protobuf error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/panda/panda/python/core/pandare/__init__.py", line 15, in <module>
    from .plog_reader import PLogReader
  File "/panda/panda/python/core/pandare/plog_reader.py", line 8, in <module>
    import pandare.plog_pb2
  File "/panda/panda/python/core/pandare/plog_pb2.py", line 17, in <module>
    DESCRIPTOR = _descriptor.FileDescriptor(
TypeError: __init__() got an unexpected keyword argument 'serialized_options'

Reproduce steps:

  1. Execute docker run -it --rm pandare/pandadev:latest bash.
  2. Execute /panda/panda/scripts/install.sh inside the container.

Since it is not an easy job to downgrade protobuf-compiler version in the Ubuntu 20.04 Docker base image, is there any possibility for upgrading the globally installed protobuf version?

AndrewFasano commented 3 years ago

Thanks for pointing this out. I think we can upgrade the python version of protobuf to match the system version.

AndrewFasano commented 3 years ago

I believe I've fixed this with 943d4eb79a8ff7ae4edba29a1130a08d98791ccc - pypanda's setup.py now checks the system's version of protoc and just requires that version. This won't work if the protoc version number and the pip protobuf package ever get out of sync, but it seems like this is an improvement over pinning an old version.

I also added a test for the install_ubuntu.sh script to the CI.