Corrupted installation?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Corrupted installation?

Tom Cook
I have a remote sensing platform that uses Numpy on a raspberry pi.  There are about a dozen of these installed.  Three days ago, the Python part of the software started crashing during startup, with this exception message:

Traceback (most recent call last):
  File "/home/azi/board/sensor_logger.py", line 16, in <module>
    from board.measurement.data import Expression, MeasurementData
  File "/home/azi/board/measurement/data.py", line 2, in <module>
    import numpy as np
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 153, in <module>
    from . import add_newdocs
  File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 7, in <module>
    from . import umath
SystemError: initialization of umath raised unreported exception

I'm running numpy 1.8.2 on python 3.4.2 on a Raspberry Pi running Raspbian Jessie.  I realise these are somewhat old, but as the software is running in the field (and I mean literally in a field - on another continent) I'm not in a great position to update them.

Can anyone give me a pointer on how to debug this?  As far as I can tell, umath.cpython-34m-arm-linux-gnueabihf.so has not changed recently.  In fact, as far as I can tell, nothing changed around the time this stopped working.  But I guess something must have!

Regards,
Tom

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Corrupted installation?

Charles R Harris


On Tue, Jul 3, 2018 at 5:59 AM, Tom Cook <[hidden email]> wrote:
I have a remote sensing platform that uses Numpy on a raspberry pi.  There are about a dozen of these installed.  Three days ago, the Python part of the software started crashing during startup, with this exception message:

Traceback (most recent call last):
  File "/home/azi/board/sensor_logger.py", line 16, in <module>
    from board.measurement.data import Expression, MeasurementData
  File "/home/azi/board/measurement/data.py", line 2, in <module>
    import numpy as np
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 153, in <module>
    from . import add_newdocs
  File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 7, in <module>
    from . import umath
SystemError: initialization of umath raised unreported exception

I'm running numpy 1.8.2 on python 3.4.2 on a Raspberry Pi running Raspbian Jessie.  I realise these are somewhat old, but as the software is running in the field (and I mean literally in a field - on another continent) I'm not in a great position to update them.

Can anyone give me a pointer on how to debug this?  As far as I can tell, umath.cpython-34m-arm-linux-gnueabihf.so has not changed recently.  In fact, as far as I can tell, nothing changed around the time this stopped working.  But I guess something must have!

Well, that numpy is quite old, so we have not touched it for many years. Did all your boards go down or just one or two? Did you update your own software?

Chuck 

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Corrupted installation?

Nathaniel Smith
In reply to this post by Tom Cook
On Tue, Jul 3, 2018, 05:01 Tom Cook <[hidden email]> wrote:
I have a remote sensing platform that uses Numpy on a raspberry pi.  There are about a dozen of these installed.  Three days ago, the Python part of the software started crashing during startup, with this exception message:

Traceback (most recent call last):
  File "/home/azi/board/sensor_logger.py", line 16, in <module>
    from board.measurement.data import Expression, MeasurementData
  File "/home/azi/board/measurement/data.py", line 2, in <module>
    import numpy as np
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 153, in <module>
    from . import add_newdocs
  File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 7, in <module>
    from . import umath
SystemError: initialization of umath raised unreported exception

And the C level, reporting an exception to the python interpreter involves two steps: (1) stashing the exception object in a special global variable where the interpreter knows to look for it, (2) returning a special value (usually -1 or NULL) that tells the interpreter an exception has been raised and it should go look at that global variable for more details.

I *think* that error means that the umath initialization routine did step (1), but not step (2), and the interpreter is cranky because it doesn't know how to interpret this. (Unfortunately I don't have a copy of py34 on my phone to confirm...)

If that's correct, though, then probably the next thing you want to do is figure out what exception is being set, since that's likely to be the real error. It's annoying that python doesn't tell you. It should be possible to dig around with gdb and figure it out, but will require some knowledge of the python C API and gdb and I don't know the recipe offhand.

Are you having the same problem on all the installations?

-n

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion