{"action":"created","issue":{"url":"https://api.github.com/repos/warmcat/libwebsockets/issues/979","repository_url":"https://api.github.com/repos/warmcat/libwebsockets","labels_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/979/labels{/name}","comments_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/979/comments","events_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/979/events","html_url":"https://github.com/warmcat/libwebsockets/issues/979","id":245321105,"number":979,"title":"Segfault fetching static files with HTTP2/SSL","user":{"login":"stlawrance","id":685010,"avatar_url":"https://avatars1.githubusercontent.com/u/685010?v=4","gravatar_id":"","url":"https://api.github.com/users/stlawrance","html_url":"https://github.com/stlawrance","followers_url":"https://api.github.com/users/stlawrance/followers","following_url":"https://api.github.com/users/stlawrance/following{/other_user}","gists_url":"https://api.github.com/users/stlawrance/gists{/gist_id}","starred_url":"https://api.github.com/users/stlawrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stlawrance/subscriptions","organizations_url":"https://api.github.com/users/stlawrance/orgs","repos_url":"https://api.github.com/users/stlawrance/repos","events_url":"https://api.github.com/users/stlawrance/events{/privacy}","received_events_url":"https://api.github.com/users/stlawrance/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-25T08:19:29Z","updated_at":"2017-07-25T13:01:21Z","closed_at":"2017-07-25T09:40:18Z","body":"The following crash occurs fetching static files from lwsws using Firefox (wget works fine) and SSL:\r\n\r\n```\r\nProgram received signal SIGSEGV, Segmentation fault.\r\nlws_http2_parser (wsi=0x80281dc00, c=0 '\\0') at lib/http2.c:237\r\n237\t\t\t\twsi->u.http2.stream_wsi->u.http2.count = wsi->u.http2.count;\r\nCurrent language:  auto; currently minimal\r\n(gdb) bt\r\n#0  lws_http2_parser (wsi=0x80281dc00, c=0 '\\0') at lib/http2.c:237\r\n#1  0x000000080082d1d6 in lws_read (wsi=0x80281dc00, buf=0x8028857e9 \"\", len=101) at lib/handshake.c:90\r\n#2  0x00000008008357a1 in lws_service_fd_tsi (context=0x802841340, pollfd=0x7fffffff67d0, tsi=0) at lib/service.c:1205\r\n#3  0x0000000800835a8f in lws_service_fd (context=0x802841340, pollfd=0x7fffffff67d0) at lib/service.c:1328\r\n#4  0x000000080085ab63 in lws_io_cb (watcher=0x80281de00, status=0, revents=2) at lib/libuv.c:101\r\n#5  0x000000080149029f in uv__io_poll () from /usr/local/lib/libuv.so.1\r\n#6  0x0000000801481b18 in uv_run () from /usr/local/lib/libuv.so.1\r\n#7  0x000000080085acb2 in lws_libuv_run (context=0x802841340, tsi=0) at lib/libuv.c:414\r\n#8  0x0000000000401a4b in main (argc=1, argv=0x7fffffffea88) at lwsws/main.c:299\r\n(gdb) print *wsi\r\n$3 = {\r\n  u = {\r\n    http = {\r\n      ah = 0x0, \r\n      ah_wait_list = 0x0, \r\n      preamble_rx = 0x0, \r\n      stash = 0x0, \r\n      preamble_rx_len = 0, \r\n      new_wsi_list = 0x0, \r\n      filepos = 0, \r\n      filelen = 0, \r\n      fop_fd = 0x0, \r\n      range = {\r\n        start = 0, \r\n        end = 0, \r\n        extent = 0, \r\n        agg = 0, \r\n        budget = 0, \r\n        buf = 0x80281dc70 \"\", \r\n        pos = 0, \r\n        state = LWSRS_NO_ACTIVE_RANGE, \r\n        start_valid = 0 '\\0', \r\n        end_valid = 0 '\\0', \r\n        ctr = 0 '\\0', \r\n        count_ranges = 0 '\\0', \r\n        did_try = 0 '\\0', \r\n        inside = 0 '\\0', \r\n        send_ctr = 0 '\\0'\r\n      }, \r\n      multipart_content_type = 0x80281dd00 \"\", \r\n      request_version = HTTP_VERSION_1_0, \r\n      connection_type = HTTP_CONNECTION_CLOSE, \r\n      content_length = 0, \r\n      content_remain = 0\r\n    }, \r\n    http2 = {\r\n      http = {\r\n        ah = 0x0, \r\n        ah_wait_list = 0x0, \r\n        preamble_rx = 0x0, \r\n        stash = 0x0, \r\n        preamble_rx_len = 0, \r\n        new_wsi_list = 0x0, \r\n        filepos = 0, \r\n        filelen = 0, \r\n        fop_fd = 0x0, \r\n        range = {\r\n          start = 0, \r\n          end = 0, \r\n          extent = 0, \r\n          agg = 0, \r\n          budget = 0, \r\n          buf = 0x80281dc70 \"\", \r\n          pos = 0, \r\n          state = LWSRS_NO_ACTIVE_RANGE, \r\n          start_valid = 0 '\\0', \r\n          end_valid = 0 '\\0', \r\n          ctr = 0 '\\0', \r\n          count_ranges = 0 '\\0', \r\n          did_try = 0 '\\0', \r\n          inside = 0 '\\0', \r\n          send_ctr = 0 '\\0'\r\n        }, \r\n        multipart_content_type = 0x80281dd00 \"\", \r\n        request_version = HTTP_VERSION_1_0, \r\n        connection_type = HTTP_CONNECTION_CLOSE, \r\n        content_length = 0, \r\n        content_remain = 0\r\n      }, \r\n      my_settings = {\r\n        setting = 0x80281dd50\r\n      }, \r\n      peer_settings = {\r\n        setting = 0x80281dd6c\r\n      }, \r\n      parent_wsi = 0x0, \r\n      next_child_wsi = 0x0, \r\n      hpack_dyn_table = 0x0, \r\n      stream_wsi = 0x0, \r\n      ping_payload = 0x80281dda8 \"\", \r\n      one_setting = 0x80281ddb0 \"\", \r\n      count = 1, \r\n      length = 5, \r\n      stream_id = 3, \r\n      hpack = HPKS_OPT_PADDING, \r\n      hpack_type = HPKT_INDEXED_HDR_7, \r\n      header_index = 0, \r\n      hpack_len = 0, \r\n      hpack_e_dep = 12517377, \r\n      tx_credit = 12582912, \r\n      my_stream_id = 0, \r\n      child_count = 0, \r\n      my_priority = 0, \r\n      END_STREAM = 0, \r\n      END_HEADERS = 0, \r\n      send_END_STREAM = 0, \r\n      GOING_AWAY = 0, \r\n      requested_POLLOUT = 1, \r\n      waiting_tx_credit = 0, \r\n      huff = 0, \r\n      value = 0, \r\n      round_robin_POLLOUT = 0, \r\n      count_POLLOUT_children = 0, \r\n      hpack_pos = 0, \r\n      type = 2 '\\002', \r\n      flags = 0 '\\0', \r\n      frame_state = 9 '\\t', \r\n      padding = 0 '\\0', \r\n      hpack_m = 0 '\\0', \r\n      initialized = 1 '\\001'\r\n    }, \r\n    hdr = {\r\n      ah = 0x0, \r\n      ah_wait_list = 0x0, \r\n      preamble_rx = 0x0, \r\n      stash = 0x0, \r\n      preamble_rx_len = 0, \r\n      ups = URIPS_IDLE, \r\n      ues = URIES_IDLE, \r\n      lextable_pos = 0, \r\n      current_token_limit = 0, \r\n      esc_stash = 0 '\\0', \r\n      post_literal_equal = 0 '\\0', \r\n      parser_state = 0 '\\0'\r\n    }, \r\n    ws = {\r\n      hdr = {\r\n        ah = 0x0, \r\n        ah_wait_list = 0x0, \r\n        preamble_rx = 0x0, \r\n        stash = 0x0, \r\n        preamble_rx_len = 0, \r\n        ups = URIPS_IDLE, \r\n        ues = URIES_IDLE, \r\n        lextable_pos = 0, \r\n        current_token_limit = 0, \r\n        esc_stash = 0 '\\0', \r\n        post_literal_equal = 0 '\\0', \r\n        parser_state = 0 '\\0'\r\n      }, \r\n      rx_ubuf = 0x0, \r\n      rx_ubuf_alloc = 0, \r\n      rx_draining_ext_list = 0x0, \r\n      tx_draining_ext_list = 0x0, \r\n      time_next_ping_check = 0, \r\n      rx_packet_length = 0, \r\n      rx_ubuf_head = 0, \r\n      mask = 0x80281dc6c \"\", \r\n      ping_payload_buf = 0x80281dc70 \"\", \r\n      ping_payload_len = 0 '\\0', \r\n      mask_idx = 0 '\\0', \r\n      opcode = 0 '\\0', \r\n      rsv = 0 '\\0', \r\n      rsv_first_msg = 0 '\\0', \r\n      close_in_ping_buffer_len = 0 '\\0', \r\n      utf8 = 0 '\\0', \r\n      stashed_write_type = 0 '\\0', \r\n      tx_draining_stashed_wp = 0 '\\0', \r\n      final = 0, \r\n      frame_is_binary = 0, \r\n      all_zero_nonce = 0, \r\n      this_frame_masked = 0, \r\n      inside_frame = 0, \r\n      clean_buffer = 0, \r\n      payload_is_close = 0, \r\n      ping_pending_flag = 0, \r\n      continuation_possible = 0, \r\n      owed_a_fin = 0, \r\n      check_utf8 = 0, \r\n      defeat_check_utf8 = 0, \r\n      pmce_compressed_message = 0, \r\n      stashed_write_pending = 0, \r\n      rx_draining_ext = 0, \r\n      tx_draining_ext = 0, \r\n      send_check_ping = 0\r\n    }\r\n  }, \r\n  w_read = {\r\n    uv_watcher = {\r\n      data = 0x0, \r\n      loop = 0x602880, \r\n      type = UV_POLL, \r\n      close_cb = 0, \r\n      handle_queue = 0x80281de20, \r\n      u = {\r\n        fd = 0, \r\n        reserved = 0x80281de30\r\n      }, \r\n      next_closing = 0x0, \r\n      flags = 24576, \r\n      poll_cb = 0x80085aa70 <lws_io_cb>, \r\n      io_watcher = {\r\n        cb = 0x801487a90 <uv_poll_init+176>, \r\n        pending_queue = 0x80281de70, \r\n        watcher_queue = 0x80281de80, \r\n        pevents = 5, \r\n        events = 5, \r\n        fd = 18, \r\n        rcount = 239, \r\n        wcount = 48994\r\n      }\r\n    }, \r\n    context = 0x802841340\r\n  }, \r\n  pending_timeout_limit = 1500905098, \r\n  context = 0x802841340, \r\n  vhost = 0x802879000, \r\n  parent = 0x0, \r\n  child_list = 0x0, \r\n  sibling_list = 0x0, \r\n  protocol = 0x802823180, \r\n  same_vh_protocol_prev = 0x0, \r\n  same_vh_protocol_next = 0x0, \r\n  timeout_list = 0x0, \r\n  timeout_list_prev = 0x802841440, \r\n  access_log = {\r\n    header_log = 0x0, \r\n    user_agent = 0x0, \r\n    sent = 0, \r\n    response = 0\r\n  }, \r\n  user_space = 0x0, \r\n  rxflow_buffer = 0x8028857e0 \"\", \r\n  trunc_alloc = 0x0, \r\n  active_extensions = 0x80281df40, \r\n  act_ext_user = 0x80281df50, \r\n  ssl = 0x8028ba500, \r\n  client_bio = 0x0, \r\n  pending_read_list_prev = 0x0, \r\n  pending_read_list_next = 0x0, \r\n  desc = {\r\n    sockfd = 18, \r\n    filefd = 18\r\n  }, \r\n  position_in_fds_table = 1, \r\n  rxflow_len = 110, \r\n  rxflow_pos = 50, \r\n  trunc_alloc_len = 0, \r\n  trunc_offset = 0, \r\n  trunc_len = 0, \r\n  chunk_remaining = 0, \r\n  cache_secs = 0, \r\n  hdr_parsing_completed = 0, \r\n  http2_substream = 0, \r\n  listener = 0, \r\n  user_space_externally_allocated = 0, \r\n  socket_is_permanently_unusable = 0, \r\n  rxflow_change_to = 3, \r\n  more_rx_waiting = 0, \r\n  conn_stat_done = 0, \r\n  cache_reuse = 0, \r\n  cache_revalidate = 0, \r\n  cache_intermediaries = 0, \r\n  favoured_pollin = 0, \r\n  sending_chunked = 0, \r\n  already_did_cce = 0, \r\n  told_user_closed = 0, \r\n  access_log_pending = 0, \r\n  do_ws = 0, \r\n  chunked = 0, \r\n  client_rx_avail = 0, \r\n  client_http_body_pending = 0, \r\n  extension_data_pending = 0, \r\n  use_ssl = 1, \r\n  redirect_to_https = 0, \r\n  handling_pollout = 0, \r\n  leave_pollout_active = 0, \r\n  c_port = 0, \r\n  count_act_ext = 0 '\\0', \r\n  ietf_spec_revision = 0 '\\0', \r\n  mode = 5 '\\005', \r\n  state = 14 '\\016', \r\n  state_pre_close = 0 '\\0', \r\n  lws_rx_parse_state = 0 '\\0', \r\n  rx_frame_type = 0 '\\0', \r\n  pending_timeout = 3 '\\003', \r\n  pps = 0 '\\0', \r\n  tsi = 0 '\\0', \r\n  protocol_interpret_idx = 0 '\\0', \r\n  redirects = 0 '\\0', \r\n  chunk_parser = 0 '\\0', \r\n  reason_bf = 0 '\\0'\r\n}\r\n\r\n(gdb) print wsi->state\r\n$4 = 14 '\\016'\r\n== LWSS_HTTP2_ESTABLISHED\r\n\r\n(gdb) print wsi->u.http2.type\r\n$5 = 2 '\\002'\r\n== LWS_HTTP2_FRAME_TYPE_PRIORITY\r\n\r\n(gdb) print wsi->u.http2.count\r\n$6 = 1\r\n```"},"comment":{"url":"https://api.github.com/repos/warmcat/libwebsockets/issues/comments/317729856","html_url":"https://github.com/warmcat/libwebsockets/issues/979#issuecomment-317729856","issue_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/979","id":317729856,"user":{"login":"stlawrance","id":685010,"avatar_url":"https://avatars1.githubusercontent.com/u/685010?v=4","gravatar_id":"","url":"https://api.github.com/users/stlawrance","html_url":"https://github.com/stlawrance","followers_url":"https://api.github.com/users/stlawrance/followers","following_url":"https://api.github.com/users/stlawrance/following{/other_user}","gists_url":"https://api.github.com/users/stlawrance/gists{/gist_id}","starred_url":"https://api.github.com/users/stlawrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stlawrance/subscriptions","organizations_url":"https://api.github.com/users/stlawrance/orgs","repos_url":"https://api.github.com/users/stlawrance/repos","events_url":"https://api.github.com/users/stlawrance/events{/privacy}","received_events_url":"https://api.github.com/users/stlawrance/received_events","type":"User","site_admin":false},"created_at":"2017-07-25T13:01:21Z","updated_at":"2017-07-25T13:01:21Z","body":"Thanks for the detailed answer; I wasn't aware of the situation with WS and HTTP/2 at all.  I didn't have any good reason to enable the option other than to just try it out anyway..."}}
{"actor":{"display_login":"stlawrance"}}