Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • VILLASnode VILLASnode
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 28
    • Issues 28
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 6
    • Merge requests 6
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ACS
  • Public
  • VILLASframework
  • VILLASnodeVILLASnode
  • Issues
  • #154

Closed
Open
Created Jul 02, 2018 by Dennis Potter@dennis.potter

Deregistration of memory regions causes segmentation error

The ibv_dereg_mr function causes a segmentation fault in memory_ib_free. This is probably caused, by memory_ib_mr which returns the wrong pointer to the memory region.

Fix this problem and start using memory_ib_mr in other places where we are doing pointer wizardry right now as well.

struct ibv_mr * memory_ib_mr(void *ptr)
{
        struct ibv_mr *mr = (struct ibv_mr *) ptr;

        return (mr - 1);
}

int memory_ib_free(struct memtype *m, void *ptr, size_t len)
{
        struct memory_ib *mi = (struct memory_ib *) m->_vd;
        struct ibv_mr *mr = memory_ib_mr(ptr);

        ibv_dereg_mr(mr);

        ptr -= sizeof(struct ibv_mr *);
        len += sizeof(struct ibv_mr *);

        memory_free(mi->parent, ptr, len);

        return 0;
}
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking