Project

General

Profile

Actions

Bug #1718

closed

Face still alive after any failure

Added by Alex Afanasyev over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Faces
Target version:
Start date:
06/30/2014
Due date:
% Done:

100%

Estimated time:

Description

When on-demand UdpFace is being closed, the object itself is still alive.

To check:

  • in udp-face.cpp on line 128 (just after close()):

    NFD_LOG_ERROR("Remaining references: " << this->shared_from_this().use_count() - 1);
    
  • run NFD

  • from another machine either send UDP packet with nc or establish udp face towards the machine

  • wait

Expectation: Remaining references: 0 (or crash)

Actual: Remaining references: 2

This may not be just UdpFace, I just discovered it with idle UdpFace. Where could we forgotten this face?

Actions #1

Updated by Alex Afanasyev over 10 years ago

  • Description updated (diff)
Actions #2

Updated by Alex Afanasyev over 10 years ago

  • Subject changed from UdpFace still alive after being closed to Face still alive after any failure
  • Status changed from New to Resolved
  • Assignee set to Alex Afanasyev
  • Target version set to v0.2

This is legitimate bug and I found the reason. onFail event emitter is never cleaned, resulting in a self-referenced shared_ptr (face->onFail indirectly reference face).

This applies to all faces. Will submit a patch to fix the problem---will clean onFail inside Face::fail()

Actions #3

Updated by Alex Afanasyev over 10 years ago

  • Status changed from Resolved to Code review
  • % Done changed from 0 to 100
Actions #4

Updated by Alex Afanasyev over 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF