You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting a segfault when calling to a C library but only when the call happens in a parapoly context. This is my first time trying this, so maybe I screwed something up.
Steps to Reproduce
On Linux:
git clone https://github.com/Drvi/blis-odin
cd blis-odin
./repro.sh
You might need to tweak the path to the generated library in bindings/blis.odin
Failure Information (for bugs)
This here is the meat of the reproducer:
N := 8
m := make([]f64, N*N)
deferdelete(m)
// works with a slice
fmt.println(m) // all zeroes
alpha := 1.0
blis.bli_dsetm( // the external call, that sets all the values in `m` to `alpha`
blis.conj.BLIS_NO_CONJUGATE,
blis.doff(0),
blis.diag.BLIS_NONUNIT_DIAG,
blis.uplo.BLIS_DENSE,
blis.dim(N),
blis.dim(N),
&alpha,
raw_data(m),
blis.inc(N),
blis.inc(1),
)
fmt.println(m) // all ones, as expected
fmt.println()
// Wrap the slice that we just used// Symmetric :: struct($T: typeid) { // defined in the blis module// data: []T,// m: int,// }
t: blis.Symmetric(f64)
t.data = m
t.m = N
fmt.println(t)
// setsym :: proc(s: Symmetric($E), alpha: E) { // defined in the blis module// alpha := alpha// bli_dsetm(// conj.BLIS_NO_CONJUGATE,// doff(0),// diag.BLIS_NONUNIT_DIAG,// uplo.BLIS_DENSE,// dim(s.m),// dim(s.m),// &alpha,// raw_data(s.data),// inc(s.m),// inc(1),// )// return// }
blis.setsym(t, 2.0) // segfaults
fmt.println(t)
I'm getting segfaults / SEGV with -sanitize:address in the setsym call, which just wraps a call that succeed earlier on the same allocated slice.
There was a bug in the program -- I used c.int (4 bytes) instead of an int (8 bytes) which caused a wrong value was passed in to the procedure. Not sure why this only happened when I used parapoly, but I think I can close this now. Sorry for the noise!
Context
odin report
I'm getting a segfault when calling to a C library but only when the call happens in a parapoly context. This is my first time trying this, so maybe I screwed something up.
Steps to Reproduce
On Linux:
git clone https://github.com/Drvi/blis-odin cd blis-odin ./repro.sh
You might need to tweak the path to the generated library in
bindings/blis.odin
Failure Information (for bugs)
This here is the meat of the reproducer:
I'm getting segfaults / SEGV with
-sanitize:address
in thesetsym
call, which just wraps a call that succeed earlier on the same allocated slice.Failure Logs
The text was updated successfully, but these errors were encountered: