In ibrk and segattach there are two different expressions which check for expanding or newly created segments overlapping an existing segment. Neither version was general enough to catch all possible cases. Reference: /n/sources/patch/segment-overlap Date: Tue Apr 19 13:16:06 CES 2016 Signed-off-by: miller@hamnavoe.com --- /sys/src/9/port/segment.c Tue Apr 19 13:06:56 2016 +++ /sys/src/9/port/segment.c Tue Apr 19 13:06:53 2016 @@ -484,7 +486,7 @@ ns = up->seg[i]; if(ns == 0 || ns == s) continue; - if(newtop >= ns->base && newtop < ns->top) { + if(newtop > ns->base && s->base < ns->top) { qunlock(&s->lk); error(Esoverlap); } @@ -586,8 +588,7 @@ ns = p->seg[i]; if(ns == 0) continue; - if((newtop > ns->base && newtop <= ns->top) || - (va >= ns->base && va < ns->top)) + if(newtop > ns->base && va < ns->top) return ns; } return nil;