FS#75242 - [python-pytorch] rebuild required after protobuf update

Attached to Project: Community Packages
Opened by Adria Arrufat (swiftscythe) - Tuesday, 05 July 2022, 03:02 GMT
Last edited by Antonio Rojas (arojas) - Tuesday, 05 July 2022, 09:45 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Lukas Fleischer (lfleischer)
Antonio Rojas (arojas)
Konstantin Gizdov (kgizdov)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
PyTorch needs to be rebuilt with protobuf 21.2.
Trying to run it with protobuf 21.2 gives this error:

`ImportError: /usr/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: _ZN6google8protobuf8internal15ThreadSafeArena13thread_cache_E`

Rolling back to protobuf 21.1 solves the problem

Steps to reproduce:

Run any python file that tries to import Pytorch 1.12, while having protobuf 21.2 installed.
This task depends upon

Closed by  Antonio Rojas (arojas)
Tuesday, 05 July 2022, 09:45 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-pytorch 1.12.0-2
Comment by Chih-Hsuan Yen (yan12125) - Tuesday, 05 July 2022, 04:52 GMT
PKGBUILD is switched from autotools to cmake in [1], and somehow ABI is different. If I rebuild protobuf with attached PKGBUILD, `python -c 'import torch'` works fine.

I'll add the maintainer and the last packager of protobuf for further investigation.

[1] https://github.com/archlinux/svntogit-packages/commit/cec4f14eea009bff56e0ed8ad63b77e3c4ef6ee7
   PKGBUILD (2.4 KiB)
Comment by Antonio Rojas (arojas) - Tuesday, 05 July 2022, 06:57 GMT
Relevant code is at https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/arena.cc#L211

cmake defines PROTOBUF_USE_DLLS when building shared libs, and then exports ThreadSafeArena::thread_cache() instead of ThreadSafeArena::thread_cache_

Seems to me that the cmake behavior is the right one, the other one looks like an internal symbol not meant to be exported. I'll rebuild pytorch for now and schedule a full rebuild if something else comes up that uses this symbol.

Loading...