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

fix for endian mismatch issue per boostorg/python PR #218 #292

Closed
wants to merge 1 commit into from

Conversation

jwhendy
Copy link

@jwhendy jwhendy commented Sep 28, 2019

Greetings,

I'm on a team maintanining arch linux packages for ROS and someone just ran into this issue. Namely, upon import the user gets:

RuntimeError: FATAL: module compiled as little endian, but detected different endianness at runtime

In googling around, I found this and this which were handled by PRs boostorg/python 218 and python-pni 74. Both were the same, and appear based on this explanation.

I grepped for import_array, added the return NULL statement, rebuilt, and I no longer get the import error.

@jwhendy jwhendy changed the title fix for endian mismatch issue per boostorg/python PR #128 fix for endian mismatch issue per boostorg/python PR #218 Sep 28, 2019
@hgaiser
Copy link
Contributor

hgaiser commented Dec 5, 2019

I can confirm that this fixes the message of the RuntimeError. That error has been there for a while but I always ignored it, but recently with the switch to python3.8 the error got more severe:

RuntimeError: FATAL: module compiled as little endian, but detected different endianness at runtime
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/hgaiser/dev/fizyr/ros/cv_bridge/devel_isolated/cv_bridge/lib/python3.8/site-packages/cv_bridge/__init__.py", line 35, in <module>
    exec(__fh.read())
  File "<string>", line 6, in <module>
SystemError: initialization of cv_bridge_boost raised unreported exception

So now it was actually crashing code. The proposed change fixes this issue for me.

2maz added a commit to rock-simulation/mars that referenced this pull request Apr 30, 2020
RuntimeError: FATAL: module compiled as little endian, but detected different endianness at runtime

see also ros-perception/vision_opencv#292
and ros-melodic-arch/ros-melodic-cv-bridge#2
2maz added a commit to rock-simulation/mars that referenced this pull request Apr 30, 2020
RuntimeError: FATAL: module compiled as little endian, but detected different endianness at runtime

see also ros-perception/vision_opencv#292
and ros-melodic-arch/ros-melodic-cv-bridge#2
@mjcarroll mjcarroll changed the base branch from melodic to noetic June 26, 2020 18:24
@@ -37,6 +37,7 @@ PyObject* pyopencv_from(const cv::Mat& m);
static int do_numpy_import( )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update the signature to void *? This is what I'm proposing in the equivalent ros2 patch (#346).

@ijnek
Copy link
Member

ijnek commented Sep 7, 2022

Closing, as this has been superceded by #323

@ijnek ijnek closed this Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants