Skip to content

Poly segfault #690

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

Open
KMIJPH opened this issue Mar 12, 2025 · 1 comment
Open

Poly segfault #690

KMIJPH opened this issue Mar 12, 2025 · 1 comment

Comments

@KMIJPH
Copy link

KMIJPH commented Mar 12, 2025

let test_poly () =
  let x = Mat.(uniform 100 1 *$ 9.) in
  let y = Mat.(sin x + (gaussian ~sigma:0.1 100 1)) in
  let n = 4 in
  let p = Regression.D.poly x y n in
  let z = Array.init (n + 1) (fun i -> Mat.(pow_scalar x (float_of_int i)))
    |> Mat.concatenate ~axis:1
  in
  Mat.(z *@ p)

Running this example always leads to a segfault for me if I increase n any higher than 2.
I took this example from the examples directory in this repo.
I am runnning owl 1.2.

@KMIJPH
Copy link
Author

KMIJPH commented Mar 13, 2025

I tried running it in utop and on one occasion I got:

Fatal glibc error: malloc.c:4376 (_int_malloc): assertion failed: (unsigned long) (size) >= (unsigned long) (nb)

The other times it just segfaulted without any further message.

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

1 participant