You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Masakazu Kitajo (JIRA)" <ji...@apache.org> on 2016/05/21 15:23:12 UTC

[jira] [Created] (TS-4467) Assert fails due to a wrong condition

Masakazu Kitajo created TS-4467:
-----------------------------------

             Summary: Assert fails due to a wrong condition
                 Key: TS-4467
                 URL: https://issues.apache.org/jira/browse/TS-4467
             Project: Traffic Server
          Issue Type: Bug
          Components: Network
            Reporter: Masakazu Kitajo


{noformat}
FATAL: UnixNetVConnection.cc:995: failed assertion `niov < countof(tiovec)`
Process 4432 stopped
* thread #4: tid = 0x208fe8, 0x00007fff969e1f06 libsystem_kernel.dylib`__pthread_kill + 10, name = '[ET_NET 2]', stop reason = signal SIGABRT
    frame #0: 0x00007fff969e1f06 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff969e1f06 <+10>: jae    0x7fff969e1f10            ; <+20>
    0x7fff969e1f08 <+12>: movq   %rax, %rdi
    0x7fff969e1f0b <+15>: jmp    0x7fff969dc7cd            ; cerror_nocancel
    0x7fff969e1f10 <+20>: retq   
(lldb) bt
* thread #4: tid = 0x208fe8, 0x00007fff969e1f06 libsystem_kernel.dylib`__pthread_kill + 10, name = '[ET_NET 2]', stop reason = signal SIGABRT
  * frame #0: 0x00007fff969e1f06 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff94c394ec libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff8cf116e7 libsystem_c.dylib`abort + 129
    frame #3: 0x000000010159cb27 libtsutil.7.dylib`ink_abort(message_format="%s:%d: failed assertion `%s`") + 519 at ink_error.cc:79
    frame #4: 0x0000000101593b97 libtsutil.7.dylib`::_ink_assert(expression="niov < countof(tiovec)", file="UnixNetVConnection.cc", line=995) + 71 at ink_assert.cc:37
    frame #5: 0x00000001007a2286 traffic_server`UnixNetVConnection::load_buffer_and_write(this=0x000061800002fc80, towrite=8859, wattempted=0x0000700000285e30, total_written=0x0000700000285e10, buf=0x000061800002fe30, needs=0x0000700000285e50) + 1622 at UnixNetVConnection.cc:995
    frame #6: 0x00000001007996b2 traffic_server`write_to_net_io(nh=0x0000000105353480, vc=0x000061800002fc80, thread=0x000000010534f800) + 4002 at UnixNetVConnection.cc:515
    frame #7: 0x0000000100798701 traffic_server`write_to_net(nh=0x0000000105353480, vc=0x000061800002fc80, thread=0x000000010534f800) + 337 at UnixNetVConnection.cc:424
    frame #8: 0x000000010077adac traffic_server`NetHandler::mainNetEvent(this=0x0000000105353480, event=5, e=0x000060900000d280) + 9324 at UnixNet.cc:531
    frame #9: 0x0000000100059abb traffic_server`Continuation::handleEvent(this=0x0000000105353480, event=5, data=0x000060900000d280) + 267 at I_Continuation.h:153
    frame #10: 0x00000001007fe316 traffic_server`EThread::process_event(this=0x000000010534f800, e=0x000060900000d280, calling_code=5) + 1350 at UnixEThread.cc:148
    frame #11: 0x00000001007ff9a9 traffic_server`EThread::execute(this=0x000000010534f800) + 3993 at UnixEThread.cc:275
    frame #12: 0x00000001007fc7c8 traffic_server`spawn_thread_internal(a=0x00006040000110d0) + 456 at Thread.cc:84
    frame #13: 0x00007fff94c3699d libsystem_pthread.dylib`_pthread_body + 131
    frame #14: 0x00007fff94c3691a libsystem_pthread.dylib`_pthread_start + 168
    frame #15: 0x00007fff94c34351 libsystem_pthread.dylib`thread_start + 13
(lldb) f 5
frame #5: 0x00000001007a2286 traffic_server`UnixNetVConnection::load_buffer_and_write(this=0x000061800002fc80, towrite=8859, wattempted=0x0000700000285e30, total_written=0x0000700000285e10, buf=0x000061800002fe30, needs=0x0000700000285e50) + 1622 at UnixNetVConnection.cc:995
   992      wattempted = total_written - total_written_last;
   993  
   994      ink_assert(niov > 0);
-> 995      ink_assert(niov < countof(tiovec));
   996      r = socketManager.writev(con.fd, &tiovec[0], niov);
   997  
   998      if (origin_trace) {
(lldb) p niov
(unsigned int) $1 = 16
{noformat}

SocketManager::writev
{code}
SocketManager::writev(int fd, struct iovec *vector, size_t count)
{
  int64_t r;
  do {
    if (likely((r = ::writev(fd, vector, count)) >= 0))
      break;
    r = -errno;
  } while (transient_error());
  return r;
}
{code}

man writev
{quote}
ssize_t writev(int fildes, const struct iovec *iov, int iovcnt);

writev() performs the same action, but gathers the output data from the iovcnt buffers specified by the members of the iov array: iov\[0], iov\[1], ..., iov\[iovcnt-1].
{quote}

These conditions should be {{niov <= countof(tiovec)}}.

{noformat}
$ grep -Ir "niov < countof(tiovec)" iocore/
iocore//net/SSLNetVConnection.cc:      ink_assert(niov < countof(tiovec));
iocore//net/UnixNetVConnection.cc:      ink_assert(niov < countof(tiovec));
iocore//net/UnixNetVConnection.cc:    ink_assert(niov < countof(tiovec));
{noformat}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)