Project

General

Profile

Actions

Bug #1732

closed

WebSocketFace::sendData crash upon browser refresh

Added by Junxiao Shi over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Faces
Target version:
Start date:
07/03/2014
Due date:
% Done:

100%

Estimated time:
1.50 h

Description

Steps to reproduce:

  1. start ndnpingserver on the router
  2. create a web application with NDN-JS that sends ping Interests continuously at 200ms interval
  3. run the web application on an Android phone, connect to the router over a high-latency (200ms or more) link
  4. hit REFRESH button on the phone browser

Expected: NFD destroys the face

Actual: with high probability, NFD crashes with terminate called after throwing an instance of 'boost::system::error_code'

More information:

  • gdb stack trace reveals the crash happens in nfd::WebSocketFace::sendData.
  • The log message immediately before the crash is 1404449150.332705 INFO: [FaceTable] Removed face id=23 remote=wsclient://180.158.23.39:44199 local=ws://[::]:9696, which indicates the face is already closed. However, PIT Downstream Record contains a reference to the face, so sendData is still called.
Actions #1

Updated by Junxiao Shi over 10 years ago

There are two ways to fix this bug, and I suggest doing both:

  • WebSocketFace should have better error handling. A socket error in sending path should not cause a crash.
  • Outgoing Interest pipeline and Outgoing Data pipeline should check face is still open (having a FaceId above zero) before sending via the face.
Actions #2

Updated by Junxiao Shi over 10 years ago

  • Status changed from New to In Progress

I'll take care of modifications in forwarding pipelines, and leave WebSocketFace error handling to @Wentao Shang.

Actions #3

Updated by Junxiao Shi over 10 years ago

  • % Done changed from 0 to 50

Modifications in forwarding pipelines are complete.

Actions #4

Updated by Wentao Shang over 10 years ago

  • % Done changed from 50 to 70

Bug fix is pushed to gerrit. Please verify whether it works or not. Currently I don't have the environment to reproduce the error.

Actions #5

Updated by Alex Afanasyev over 10 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 70 to 100
Actions

Also available in: Atom PDF