Skip to content

PtrAttribute always returns nil (and might segfault) #75

Description

@hsjsstn

addressing.go passes p instead of &p to cuPointerGetAttribute:

var p unsafe.Pointer
C.cuPointerGetAttribute(p, a, devPtr)  // p is nil here
return p, nil                          // so this is always nil

The API writes the result into the address you give it, so passing nil means nothing gets written
and on some drivers it'll segfault.

Fix is just:

C.cuPointerGetAttribute(unsafe.Pointer(&p), a, devPtr)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions