NDN project issue tracking system: Issueshttps://redmine.named-data.net/https://redmine.named-data.net/favicon.ico?14759811232016-04-25T15:02:30ZNDN project issue tracking system
Redmine NFD - Bug #3608 (Closed): Pit::erase crash if Interest name contains implicit digesthttps://redmine.named-data.net/issues/36082016-04-25T15:02:30ZMichael Sweattmickeysweatt@engineering.ucla.edu
<p>NFD segfaults when receiving interests with full names. </p>
<pre><code>(gdb) bt
#0 nfd::name_tree::Entry::erasePitEntry (this=0xa142a0, pitEntry=std::shared_ptr (count 6, weak 0) 0xac63c0)
at ../daemon/table/name-tree-entry.cpp:103
#1 0x0000000000534312 in nfd::Pit::erase (this=this@entry=0x891ad8,
pitEntry=std::shared_ptr (count 6, weak 0) 0xac63c0) at ../daemon/table/pit.cpp:119
#2 0x00000000004ba91c in nfd::Forwarder::onInterestFinalize (this=0x891950,
pitEntry=std::shared_ptr (count 6, weak 0) 0xac63c0, isSatisfied=<optimized out>, dataFreshnessPeriod=...)
at ../daemon/fw/forwarder.cpp:371
#3 0x00000000004c1d8f in boost::_mfi::mf3<void, nfd::Forwarder, std::shared_ptr<nfd::pit::Entry>, bool, boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&>::operator() (a3=..., a2=<optimized out>, a1=...,
p=<optimized out>, this=<optimized out>) at /usr/include/boost/bind/mem_fn_template.hpp:393
#4 boost::_bi::list4<boost::_bi::value<nfd::Forwarder*>, boost::_bi::value<std::shared_ptr<nfd::pit::Entry> >, boost::_bi::value<bool>, boost::_bi::value<boost::chrono::duration<long, boost::ratio<1l, 1000l> > > >::operator()<boost::_mfi::mf3<void, nfd::Forwarder, std::shared_ptr<nfd::pit::Entry>, bool, boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&>, boost::_bi::list0> (a=<synthetic pointer>, f=..., this=<optimized out>)
at /usr/include/boost/bind/bind.hpp:457
#5 boost::_bi::bind_t<void, boost::_mfi::mf3<void, nfd::Forwarder, std::shared_ptr<nfd::pit::Entry>, bool, boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&>, boost::_bi::list4<boost::_bi::value<nfd::Forwarder*>, boost::_bi::value<std::shared_ptr<nfd::pit::Entry> >, boost::_bi::value<bool>, boost::_bi::value<boost::chrono::duration<long, boost::ratio<1l, 1000l> > > > >::operator() (this=<optimized out>) at /usr/include/boost/bind/bind.hpp:893
#6 std::_Function_handler<void (), boost::_bi::bind_t<void, boost::_mfi::mf3<void, nfd::Forwarder, std::shared_ptr<nfd::pit::Entry>, bool, boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&>, boost::_bi::list4<boost::_bi::value<nfd::Forwarder*>, boost::_bi::value<std::shared_ptr<nfd::pit::Entry> >, boost::_bi::value<bool>, boost::_bi::value<boost::chrono::duration<long, boost::ratio<1l, 1000l> > > > > >::_M_invoke(std::_Any_data const&) (
__functor=...) at /usr/include/c++/5/functional:1871
#7 0x00007ffff7467722 in std::function<void ()>::operator()() const (this=0x7fffffffd710)
at /usr/include/c++/5/functional:2271
#8 ndn::util::scheduler::Scheduler::onEvent (this=0x86f910, error=...) at ../src/util/scheduler.cpp:182
#9 0x00007ffff7467e10 in std::_Mem_fn_base<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&), true>::operator()<boost::system::error_code const&, void> (__object=<optimized out>, this=0x7fffffffd7a0)
at /usr/include/c++/5/functional:600
#10 std::_Bind<std::_Mem_fn<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&)> (ndn::util::scheduler::Scheduler*, std::_Placeholder<1>)>::__call<void, boost::system::error_code const&, 0ul, 1ul>(std::tuple<boost::system::error_code const&>&&, std::_Index_tuple<0ul, 1ul>) (__args=<optimized out>, this=0x7fffffffd7a0)
at /usr/include/c++/5/functional:1074
#11 std::_Bind<std::_Mem_fn<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&)> (ndn::util::scheduler::Scheduler*, std::_Placeholder<1>)>::operator()<boost::system::error_code const&, void>(boost::system::error_code const&) (this=0x7fffffffd7a0) at /usr/include/c++/5/functional:1133
#12 boost::asio::detail::binder1<std::_Bind<std::_Mem_fn<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&)> (ndn::util::scheduler::Scheduler*, std::_Placeholder<1>)>, boost::system::error_code>::operator()()
(this=0x7fffffffd7a0) at /usr/include/boost/asio/detail/bind_handler.hpp:47
#13 boost::asio::asio_handler_invoke<boost::asio::detail::binder1<std::_Bind<std::_Mem_fn<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&)> (ndn::util::scheduler::Scheduler*, std::_Placeholder<1>)>, boost::system::error_code> >(boost::asio::detail::binder1<std::_Bind<std::_Mem_fn<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&)> (ndn::util::scheduler::Scheduler*, std::_Placeholder<1>)>, boost::system::error_code>&, ...) (function=...) at /usr/include/boost/asio/handler_invoke_hook.hpp:69
#14 boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder1<std::_Bind<std::_Mem_fn<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&)> (ndn::util::scheduler::Scheduler*, std::_Placeholder<1>)>, boost::system::error_code>, std::_Bind<std::_Mem_fn<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&)> (ndn::util::scheduler::Scheduler*, std::_Placeholder<1>)> >(boost::asio::detail::binder1<std::_Bind<std::_Mem_fn<void (ndn::util::scheduler::Scheduler::*)(boost::system::error_code const&)> (ndn::util::scheduler::Schedule---Type <return> to continue, or q <return> to quit---
</code></pre> ndn-cxx - Bug #3495 (Abandoned): Space blow-up in cxxhttps://redmine.named-data.net/issues/34952016-03-02T10:33:46ZMichael Sweattmickeysweatt@engineering.ucla.edu
<p>When building a large number of data packets,signing them, and getting the Names. <br>
10M of Names uses 4G of memory. </p>
<p>We determined the cause being that the Names maintain references to their underlying Data, which can be reduced by calling wireEncode().</p>
<p>Discussed locally and determined intentional. Posting here for posterity sake. </p>
<p>Attached is a small code snippet that demonstrates the issue.</p>
ndn-cxx - Feature #2451 (Closed): New Abstraction for Identity Key Certificatehttps://redmine.named-data.net/issues/24512015-01-29T21:21:50ZMichael Sweattmickeysweatt@engineering.ucla.edu
<p>Refactoring code from the SecPubInfo interface, and more precisely the sec-pub-info-sqlite3 concrete implementation into a series of abstractions.</p>
<p>The general design is as follows:</p>
<ul>
<li>SecIdentityManager - a mechanism class that is used to interact with the TPM, Pib, and Identities</li>
<li>SecIdentityInfo - a value-semantic class used to manage information relating to a particular identity,
including accessing any keys associated with the Identity</li>
<li>SecKeyInfo - a value-semantic type used to manage information relating to a particular key including
the type of key and associated certificates</li>
<li>DbUtil - a utility class to encapsulate common functionality used to access sqlite database</li>
</ul>
<p>More complete public interfaces are included below.</p>
<p>A current topic relevant to the design that needs to be settled are the circumstances in which we should throw an exception.</p>
<pre><code>class SecIdentityManager {
// A mechanism class to manage access to identities, TPM, and Pib.
public:
explicit
SecIdentityManager(const std::string& dir = "");
// ACCESSORS
/**
* @brief Get TPM Locator
*
* @throws SecPublicInfo::Error if the TPM info does not exist
*/
std::string
getTpmLocator() const;
/**
* @brief Get PIB Locator
*/
std::string
getPibLocator() const;
/**
* @brief Check if the specified identity already exists
*
* @param identityName The identity name
* @return true if the identity exists, otherwise false
*/
bool
doesIdentityExist(const Name& identityName) const;
/**
* @brief Get name of the default identity
*
* @throws SecPublicInfo::Error if there is no default.
*/
SecIdentityInfo&
getDefaultIdentity() const;
/**
* @brief Get all the identities from public info, return a vector
* with the results.
*/
std::vector<SecIdentityInfo>&&
getAllIdentities() const;
/**
* @brief return the scheme of the PibLocator
*/
std::string
getScheme() const;
// MANIPULATORS
/**
* @brief Set the corresponding TPM information to @p tpmLocator
*
* If the provided @p tpmLocator is different from the existing one, the PIB will be reset,
* otherwise nothing will be changed.
*
* For legacy issue, the TPM info may not exist (some old PIB content may not have this info),
* this method will simply set the TPM info as provided without changing anything else. Thus an
* ideal process of handling old PIB is to check if TPM info exists. If it does not exist,
* then set it to the default value according to configuration.
*/
void
setTpmLocator(const std::string& tpmLocator);
/**
* @brief Add a new identity
*
* if identity already exist, do not add it again
*
* @param identityName The identity name to be added
*/
void
addIdentity(const Name& identityName);
/**
* @brief Set the default identity
*
* @param identityName The default identity name
*/
void
setDefaultIdentity(const Name& identity);
/**
* @brief Delete an identity and related public keys and certificates
*
* @param identity The identity name
*/
void
deleteIdentityInfo(const Name& identityName);
};
class SecIdentityInfo {
public:
//CREATORS
/**
* @brief Create an a new 'SecIdentityInfo' for the identity with the
specified 'identityName'.
*
* @param identityName The identity name
*/
SecIdentityInfo(Name& identityName);
//ACCESSORS
bool
doesPublicKeyExist(const Name& keyName) const;
/**
* @brief Generate a key name for this identity
*
* @param useKsk If true, generate a KSK name, otherwise a DSK name
* @return The a "SecKeyInfo" for the new key
*/
SecKeyInfo&
getNewKeyInfo(bool useKsk) const;
/**
* @brief Get all the keys associated with this identity
* @return A vector of all keys
*/
std::vector<SecKeyInfo>&&
getAllKeys() const;
/**
* @brief Get name of the default key name for this identity
*
* @throws SecPublicInfo::Error if there is no default
*
* @return The keyInfo for the requested key
*/
SecKeyInfo&
getDefaultKey() const;
/**
* @brief Get the KeyInfo for the key with the specified 'keyName'.
*
* @param keyName The name of the desired key
*
* @return The keyInfo for the requested key
*/
SecKeyInfo&
getKey(const Name& keyName) const;
//MANIPULATORS
/**
* @brief Delete a public key and related certificates related to the key
* of the specifed 'name' associated with this identity.
*
* @param keyName The key name
*/
void
deletePublicKeyInfo(const Name& keyName);
/**
* @brief Add a public key to the identity storage.
*
* @param keyName The name of the public key to be added
* @param publicKey Reference to the PublicKey object
*/
void
addKey(const Name& keyName, const PublicKey& publicKey);
/**
* @brief Set the default key name for the corresponding identity
*
* @param keyName The key name
* @throws SecPublicInfo::Error if the key does not exist
*/
void
setDefaultKeyName(const Name& keyName) const;
};
class SecKeyInfo {
public:
SecKeyInfo(const Name& keyName);
// ACCESSORS
/**
* @brief Check if the specified certificate already exists
*
* @param certificateName The name of the certificate
*/
bool
doesCertificateExist(const Name& certificateName) const;
/**
* @brief Get a shared pointer to identity certificate object
from the identity storage corresponding to this Key.
*
* @param certificateName The name of the requested certificate
* @throws SecPublicInfo::Error if the certificate does not exist
*/
shared_ptr<IdentityCertificate>
getCertificate(const Name& certificateName) const;
/**
* @brief Get all the certificate name in public info
*
* @return A vector will all certificates for this key.
*/
std::vector<IdentityCertificate>&&
getAllCertificates();
/**
* @brief Get the type of the queried public key
*
* @note KeyType is also available from PublicKey instance.
* This method is more efficient if only KeyType is needed.
*
* @param keyName The name of the requested public key
* @return the type of the key. If the queried key does not exist, KEY_TYPE_NULL will be returned
*/
virtual KeyType
getPublicKeyType(const Name& keyName)
// MANIPULATOR
/**
* @brief Add a certificate to the identity storage.
*
* It will add the corresponding public key and identity if they do not exist
*
* @param certificate The certificate to be added
*/
void
addCertificate(const IdentityCertificate& certificate)
/**
* @brief Delete a certificate
*
* @param certificateName The certificate name
*/
void
deleteCertificateInfo(const Name& certificateName)
/**
* @brief Add a certificate into the public key identity storage and set the certificate as the
* default one of the default identity
*
* @param certificate The certificate to be added
* @throws SecPublicInfo::Error if the certificate cannot be added (though it is really rare)
*/
void
addCertificateAsSystemDefault(const IdentityCertificate& certificate);
};
</code></pre> NFD - Bug #2125 (Rejected): Build error with Apple clang 6.0https://redmine.named-data.net/issues/21252014-11-03T17:23:38ZMichael Sweattmickeysweatt@engineering.ucla.edu
<p>On OSX Mavericks with:</p>
<pre><code>>>> clang -v
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
</code></pre>
<p>The following build errors:</p>
<pre><code> ../daemon/face/ndnlp-partial-message-store.cpp:70:18: error: no viable conversion from 'typename enable_if<!is_array<Buffer>::value, shared_ptr<Buffer> >::type' (aka 'std::__1::shared_ptr<ndn::Buffer>') to 'ndn::BufferPtr' (aka 'shared_ptr<ndn::Buffer>')
ndn::BufferPtr buffer = make_shared<ndn::Buffer>(m_totalLength);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:340:5: note: candidate constructor not viable: no known conversion from 'typename enable_if<!is_array<Buffer>::value, shared_ptr<Buffer> >::type' (aka 'std::__1::shared_ptr<ndn::Buffer>') to 'boost::detail::sp_nullptr_t' (aka 'nullptr_t') for 1st argument
shared_ptr( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT : px( 0 ), pn() // never throws
^
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:392:5: note: candidate constructor not viable: no known conversion from 'typename enable_if<!is_array<Buffer>::value, shared_ptr<Buffer> >::type' (aka 'std::__1::shared_ptr<ndn::Buffer>') to 'const boost::shared_ptr<ndn::Buffer> &' for 1st argument
shared_ptr( shared_ptr const & r ) BOOST_NOEXCEPT : px( r.px ), pn( r.pn )
^
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:563:5: note: candidate constructor not viable: no known conversion from 'typename enable_if<!is_array<Buffer>::value, shared_ptr<Buffer> >::type' (aka 'std::__1::shared_ptr<ndn::Buffer>') to 'boost::shared_ptr<ndn::Buffer> &&' for 1st argument
shared_ptr( shared_ptr && r ) BOOST_NOEXCEPT : px( r.px ), pn()
^
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:420:5: note: candidate template ignored: could not match 'boost::shared_ptr' against 'std::__1::shared_ptr'
shared_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
^
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:454:5: note: candidate template ignored: could not match 'auto_ptr' against 'shared_ptr'
shared_ptr( std::auto_ptr<Y> && r ): px(r.get()), pn()
^
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:486:5: note: candidate template ignored: could not match 'unique_ptr' against 'shared_ptr'
shared_ptr( std::unique_ptr< Y, D > && r ): px( r.get() ), pn()
^
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:572:5: note: candidate template ignored: could not match 'boost::shared_ptr' against 'std::__1::shared_ptr'
shared_ptr( shared_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
^
1 error generated.
Build failed
-> task in 'daemon-objects' failed (exit status 1):
{task 4451962320: cxx ndnlp-partial-message-store.cpp -> ndnlp-partial-message-store.cpp.3.o}
['/usr/bin/clang++', '-std=c++0x', '-std=c++11', '-stdlib=libc++', '-pedantic', '-Wall', '-O2', '-g', '-fPIC', '-include', '/Users/admin/NDN/NFD/build/core-objects.2', '-I/Users/admin/NDN/NFD/build/daemon', '-I/Users/admin/NDN/NFD/daemon', '-I/Users/admin/NDN/NFD/build', '-I/Users/admin/NDN/NFD', '-I/Users/admin/NDN/NFD/build/core', '-I/Users/admin/NDN/NFD/core', '-I/opt/local/include', '-I/usr/local/include', '-I/Users/admin/NDN/NFD/websocketpp', '-DHAVE_NDN_CXX=1', '../daemon/face/ndnlp-partial-message-store.cpp', '-c', '-o', '/Users/admin/NDN/NFD/build/daemon/face/ndnlp-partial-message-store.cpp.3.o']
</code></pre> ndn-cxx - Task #1506 (Closed): Unitiailzed Variables in tlv readVarNumber/readTypehttps://redmine.named-data.net/issues/15062014-04-20T00:19:29ZMichael Sweattmickeysweatt@engineering.ucla.edu
<p>There are a few uninitialized variables, which are declared and then passed into another function by reference.<br>
This causes the build to fail in debug mode.</p>
<p>In these functions the variable is always either set or an error is thrown, thus initializing them to an arbitrary values should be <br>
a sufficicent fix.</p>