WS_Assert_Allocated failing in backref() also with a339f63q #4

Closed
opened 2017-05-17 09:23:31 +00:00 by slink · 2 comments
slink commented 2017-05-17 09:23:31 +00:00 (Migrated from code.uplex.de)

Follow-up #3

If we don't copy the terminating NULL, we can't use strlen() for the check. We should probably use ov->ovector[1]

(gdb) bt
#0  0x00007fd1387271d7 in raise () from /lib64/libc.so.6
#1  0x00007fd1387288c8 in abort () from /lib64/libc.so.6
#2  0x00000000004424c2 in pan_ic (func=0x4e2650 <__func__.7406> "WS_Assert_Allocated", file=0x4e23a2 "cache/cache_ws.c", line=84, 
    cond=0x4e2490 "p >= ws->s && (p + len) <= ws->f", kind=VAS_ASSERT) at cache/cache_panic.c:665
#3  0x0000000000463836 in WS_Assert_Allocated (ws=0x7fd0ce226208, ptr=0x7fd0ce228ac0, len=82) at cache/cache_ws.c:84
#4  0x00007fd11d3e89e6 in backref (ctx=0x7fd0f51291b0, refnum=1, fallback=0x7fd138465bb2 <Address 0x7fd138465bb2 out of bounds>, 
    task=0x7fd0dc00e758) at vmod_re.c:220
#5  0x00007fd11d3e8d89 in vmod_regex_backref (ctx=0x7fd0f51291b0, re=0x7fd137c0fce0, refnum=1, 
    fallback=0x7fd138465bb2 <Address 0x7fd138465bb2 out of bounds>) at vmod_re.c:263
(gdb) frame 4
#4  0x00007fd11d3e89e6 in backref (ctx=0x7fd0f51291b0, refnum=1, fallback=0x7fd138465bb2 <Address 0x7fd138465bb2 out of bounds>, 
    task=0x7fd0dc00e758) at vmod_re.c:220
(gdb) print *ctx->ws
$1 = {magic = 905626964, id = "req", s = 0x7fd0ce228008 "GET", f = 0x7fd0ce228ae8 "5476*REDACTED*", 
  r = 0x0, e = 0x7fd0ce245ff8 "\025"}
(gdb) print *(ov_t *)task->priv
$3 = {magic = 2219571769, 
  subject = 0x7fd0ce228ac0 "X-Forwarded-Proto,Accept-Encoding=1495015476*REDACTED*", ovector = {0, 33, 
    -1, -1, -1, -1, 17, 18, 18, 33, -1 <repeats 12 times>}}

Follow-up #3 If we don't copy the terminating NULL, we can't use `strlen()` for the check. We should probably use `ov->ovector[1]` ``` (gdb) bt #0 0x00007fd1387271d7 in raise () from /lib64/libc.so.6 #1 0x00007fd1387288c8 in abort () from /lib64/libc.so.6 #2 0x00000000004424c2 in pan_ic (func=0x4e2650 <__func__.7406> "WS_Assert_Allocated", file=0x4e23a2 "cache/cache_ws.c", line=84, cond=0x4e2490 "p >= ws->s && (p + len) <= ws->f", kind=VAS_ASSERT) at cache/cache_panic.c:665 #3 0x0000000000463836 in WS_Assert_Allocated (ws=0x7fd0ce226208, ptr=0x7fd0ce228ac0, len=82) at cache/cache_ws.c:84 #4 0x00007fd11d3e89e6 in backref (ctx=0x7fd0f51291b0, refnum=1, fallback=0x7fd138465bb2 <Address 0x7fd138465bb2 out of bounds>, task=0x7fd0dc00e758) at vmod_re.c:220 #5 0x00007fd11d3e8d89 in vmod_regex_backref (ctx=0x7fd0f51291b0, re=0x7fd137c0fce0, refnum=1, fallback=0x7fd138465bb2 <Address 0x7fd138465bb2 out of bounds>) at vmod_re.c:263 (gdb) frame 4 #4 0x00007fd11d3e89e6 in backref (ctx=0x7fd0f51291b0, refnum=1, fallback=0x7fd138465bb2 <Address 0x7fd138465bb2 out of bounds>, task=0x7fd0dc00e758) at vmod_re.c:220 (gdb) print *ctx->ws $1 = {magic = 905626964, id = "req", s = 0x7fd0ce228008 "GET", f = 0x7fd0ce228ae8 "5476*REDACTED*", r = 0x0, e = 0x7fd0ce245ff8 "\025"} (gdb) print *(ov_t *)task->priv $3 = {magic = 2219571769, subject = 0x7fd0ce228ac0 "X-Forwarded-Proto,Accept-Encoding=1495015476*REDACTED*", ovector = {0, 33, -1, -1, -1, -1, 17, 18, 18, 33, -1 <repeats 12 times>}} ```
slink commented 2017-05-17 09:59:23 +00:00 (Migrated from code.uplex.de)

mentioned in merge request !1

mentioned in merge request !1
slink commented 2017-07-21 09:55:15 +00:00 (Migrated from code.uplex.de)

Status changed to closed by commit fe39c7dabd

Status changed to closed by commit fe39c7dabd82e1621cb120f3f2244b7f7e62dacf
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
uplex-varnish/libvmod-re#4
No description provided.