Project

General

Profile

Actions

Bug #3724

closed

Face: bad_function_call when InterestCallback/DataCallback/NackCallback is empty

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
Base
Target version:
Start date:
08/07/2016
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

Steps to reproduce (1):

  1. invoke Face::setInterestFilter with InterestCallback set to nullptr
  2. invoke Face::processEvents
  3. cause the face to receive an Interest that matches the filter

Steps to reproduce (2):

  1. invoke Face::expressInterest with DataCallback set to nullptr
  2. invoke Face::processEvents
  3. answer the Interest with a Data

Steps to reproduce (2):

  1. invoke Face::expressInterest with NackCallback set to nullptr
  2. invoke Face::processEvents
  3. answer the Interest with a Nack

Actual: throw std::bad_function_call

Expected: no such error


Related issues 2 (0 open2 closed)

Blocks NFD - Bug #3702: TopologyTester: does not process NackClosedJunxiao Shi08/04/2016

Actions
Blocks NFD - Bug #3703: AccessStrategy test suite: does not process NackClosedJunxiao Shi08/04/2016

Actions
Actions #1

Updated by Junxiao Shi over 8 years ago

  • Status changed from New to In Progress
  • Assignee set to Junxiao Shi
  • Estimated time set to 1.00 h

The fix is already part of https://gerrit.named-data.net/3025 patchset7, but I should make it explicit as a separate commit, and add test cases.

Actions #2

Updated by Junxiao Shi over 8 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
Actions #3

Updated by Junxiao Shi over 8 years ago

  • Blocks Bug #3702: TopologyTester: does not process Nack added
Actions #4

Updated by Junxiao Shi over 8 years ago

  • Blocks Bug #3703: AccessStrategy test suite: does not process Nack added
Actions #5

Updated by Junxiao Shi over 8 years ago

https://gerrit.named-data.net/3043 makes the test suite run faster.

Actions #6

Updated by Alex Afanasyev over 8 years ago

This is not an issue for me. Don't call expressInterest with nullptr callbacks, which don't makes much sense to me.

Even if such behavior is allowed, it should be implemented as a check inside expressInterest, not at the call time.

Actions #7

Updated by Davide Pesavento over 8 years ago

Alex Afanasyev wrote:

This is not an issue for me. Don't call expressInterest with nullptr callbacks, which don't makes much sense to me.

It's just for convenience... the check is cheap, and makes the API easier to use (it "just works").

Actions #8

Updated by Junxiao Shi over 8 years ago

This is not an issue for me. Don't call expressInterest with nullptr callbacks, which don't makes much sense to me.

It's permitted according to Doxygen https://github.com/named-data/ndn-cxx/blob/83872fd229b8d87e8e2aac25ba1dac3a69740bfd/src/detail/pending-interest.hpp#L77 but not correctly implemented.

Actions #9

Updated by Junxiao Shi over 8 years ago

The other direction to go is to forbid nullptr for all callbacks (except onTimeout on deprecated expressInterest), and assert this condition. There's no reason to require callbacks on Data and Nack, but not require callback on timeout.

Please let me know how to proceed.

Actions #10

Updated by Junxiao Shi over 8 years ago

Benchmark for https://gerrit.named-data.net/3043 patchset3:

Vagrant Ubuntu xenial 32-bit, debug build, static linking, execute time build/unit-tests -t TestFace three times

before: 53642ms, 55785ms, 46764ms

after: 4922ms, 3758ms, 3318ms

Actions #11

Updated by Junxiao Shi over 8 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF