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

DIVISION-BY-ZERO following (import-module "numpy") (V 2.2.1) #19

Open
mirkov opened this issue Dec 31, 2024 · 1 comment
Open

DIVISION-BY-ZERO following (import-module "numpy") (V 2.2.1) #19

mirkov opened this issue Dec 31, 2024 · 1 comment

Comments

@mirkov
Copy link

mirkov commented Dec 31, 2024

Hello,

This is on MacBook Air M2, SBCL 2.5.0

After I issue an (import-module "numpy") I am dropped into the debugger with the "DIVISION-BY-ZERO" error

I suspect this is because I am on numpy V2.2.1 (which is not yet supported as per the documentation).

I am posting to confirm that this is the expected behavior at this time, and not me doing something incorrect. I installed this library only yesterday and these are my first steps in it (as in Python).

Looking forward to the numpy V2 support :-)

Full debug message:

  arithmetic error DIVISION-BY-ZERO signalled
     [Condition of type DIVISION-BY-ZERO]

  Restarts:
   0: [RETRY] Retry SLY mREPL evaluation request.
   1: [*ABORT] Return to SLY's top level.
   2: [ABORT] abort thread (#<THREAD tid=6147 "sly-channel-1-mrepl-remote-1" RUNNING {7005724033}>)

  Backtrace:
   0: ((FLET SB-UNIX::RUN-HANDLER :IN SB-UNIX::%INSTALL-HANDLER) 8 #.(SB-SYS:INT-SAP #X104FFF0C0) #.(SB-SYS:INT-SAP #X104FFF128))
   1: ("bogus stack frame")
   2: (IMPORT-MODULE "numpy" :AS NIL)
   3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (IMPORT-MODULE "numpy") #<NULL-LEXENV>)
   4: (EVAL (IMPORT-MODULE "numpy"))
   5: ((LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1))
@digikar99
Copy link
Owner

The division by zero error occurs even with numpy 1 :/.

As a temporary solution, you can use (float-features:with-float-traps-masked t (import-module "numpy")).

As a permanent solution, we need to look into how the float traps are handled in numpy vs lisp and potentially wrap module imports in float-features:with-float-traps-masked.

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

No branches or pull requests

2 participants