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

Arraymancer is bugged with gc:arc #423

Closed
Clonkk opened this issue Mar 5, 2020 · 3 comments
Closed

Arraymancer is bugged with gc:arc #423

Clonkk opened this issue Mar 5, 2020 · 3 comments

Comments

@Clonkk
Copy link
Contributor

Clonkk commented Mar 5, 2020

Arraymancer seems to be bugged with --gc:arc.

I encouter blocking code / segfault on Tensor operation.
The following code allows to reproduce with --gc:arc:

import arraymancer

proc doubleMe(data : Tensor[float]): Tensor[float]=
  result = data*2

proc squareMe(data : Tensor[float]): Tensor[float]=
  result = data*.data

let A : seq[float] = @[0.11, 0.12, 0.13, 0.14]
echo A.type
echo A
var B : Tensor[float] = A.toTensor
echo B
# Blocking
var C = doubleMe(B)
echo C
#Segfault
var D = squareMe(C)
echo D

It works fine with any other gc.

I installed arraymancer with nimble install arraymancer@#head

Nim version is latest devel :
Nim Compiler Version 1.1.1 [Linux: amd64]
Compiled at 2020-03-05
Copyright (c) 2006-2019 by Andreas Rumpf

@mratsim
Copy link
Owner

mratsim commented Mar 5, 2020

This might change (for the better or maybe for worse) with #420 as non-string tensors would not be backed by sequences anymore but raw memory buffers.

Vindaar added a commit to Vindaar/ggplotnim that referenced this issue Jul 8, 2020
However, arc is still broken, because:
- arraymancer doesn't work with it
  mratsim/Arraymancer#423
- if we compile tests/testDf with `--gc:arc`, we get a:
```sh
/home/basti/src/nim/arraymancer/src/laser/cpuinfo_x86.nim(11, 5) Error: internal error: cannot inject destructors to node kind: nkAsmStmt
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
```
Vindaar added a commit to Vindaar/ggplotnim that referenced this issue Jul 10, 2020
However, arc is still broken, because:
- arraymancer doesn't work with it
  mratsim/Arraymancer#423
- if we compile tests/testDf with `--gc:arc`, we get a:
```sh
/home/basti/src/nim/arraymancer/src/laser/cpuinfo_x86.nim(11, 5) Error: internal error: cannot inject destructors to node kind: nkAsmStmt
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
```
@Clonkk
Copy link
Contributor Author

Clonkk commented Dec 14, 2020

With #477 merged, should this be closed ?

@Vindaar
Copy link
Collaborator

Vindaar commented Dec 14, 2020

Yes, I agree. To be certain I just verified that your example now works fine.

Closing this (with the caveat that self assignment of certain operations under ARC is still broken):

@Vindaar Vindaar closed this as completed Dec 14, 2020
Vindaar added a commit to SciNim/Datamancer that referenced this issue Jun 16, 2021
However, arc is still broken, because:
- arraymancer doesn't work with it
  mratsim/Arraymancer#423
- if we compile tests/testDf with `--gc:arc`, we get a:
```sh
/home/basti/src/nim/arraymancer/src/laser/cpuinfo_x86.nim(11, 5) Error: internal error: cannot inject destructors to node kind: nkAsmStmt
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants