Hi all.
Just joined the list so sorry if I?m breaking etiquette, but I found that it?s
extremely easy to crash every single sample in the Iotivity build. Justin
Hutchings encouraged me to post this here though.
Since Iotivity is quite new to me (however been doing lots of AllJoyn the last
few years), I tried mocking up a quick little CoAP client in .NET to see if I
can figure out how to talk to a service. While my client probably isn?t correct
(yet), what I found that every single sample running on the PC would crash when
my client tried making a simple request to it.
Repro steps:
- Build iotivity using command:
scons TARGET_OS=windows TARGET_ARCH=amd64 RELEASE=0 WITH_RA=0
TARGET_TRANSPORT=IP SECURED=1 WITH_TCP=0 BUILD_SAMPLE=ON LOGGING=OFF TEST=1
- Start up for instance simpleserver.exe (or any other sample that
listens for request):
iotivity\out\windows\amd64\debug\resource\examples\simpleserver.exe
- Create a simple .NET Console Application, and add the ?CoAP? nuget
package (v1.1.0).
- Add the following lines of code to the console app and run it:
var request = new CoAP.Request(CoAP.Method.GET);
request.URI = new Uri("coap://localhost/");
request.Send();
var response = request.WaitForResponse();
The sample app will then crash in secureresourcemanager.c:
[cid:image003.png at 01D2390B.0E1275C0]
Stack trace:
> octbstack.dll!SRMRequestHandler(const CAEndpoint_t * endPoint,
> const CARequestInfo_t * requestInfo) Line 158 C
octbstack.dll!CAHandleRequestResponseCallbacks(...) Line 861 C
octbstack.dll!CAHandleRequestResponse(...) Line 476 C
octbstack.dll!OCProcess(...) Line 3102 C
simpleserver.exe!OC::InProcServerWrapper::processFunc() Line 307
C++
simpleserver.exe!std::_Invoker_pmf_pointer::_Call<void (__cdecl
OC::InProcServerWrapper::*)(void) __ptr64,OC::InProcServerWrapper *
__ptr64>(void(OC::InProcServerWrapper::*)() _Pmf, OC::InProcServerWrapper * &&
_Arg1) Line 1342 C++
simpleserver.exe!std::invoke<void (__cdecl
OC::InProcServerWrapper::*)(void) __ptr64,OC::InProcServerWrapper *
__ptr64>(void(OC::InProcServerWrapper::*)() && _Obj, OC::InProcServerWrapper *
&& <_Args_0>) Line 1445 C++
simpleserver.exe!std::_LaunchPad<std::unique_ptr<std::tuple<void
(__cdecl OC::InProcServerWrapper::*)(void) __ptr64,OC::InProcServerWrapper *
__ptr64>,std::default_delete<std::tuple<void (__cdecl
OC::InProcServerWrapper::*)(void) __ptr64,OC::InProcServerWrapper * __ptr64> >
> >::_Execute<0,1>(std::tuple<void (__cdecl
OC::InProcServerWrapper::*)(void),OC::InProcServerWrapper *> & _Tup,
std::integer_sequence<unsigned __int64,0,1> __formal) Line 241 C++
simpleserver.exe!std::_LaunchPad<std::unique_ptr<std::tuple<void
(__cdecl OC::InProcServerWrapper::*)(void) __ptr64,OC::InProcServerWrapper *
__ptr64>,std::default_delete<std::tuple<void (__cdecl
OC::InProcServerWrapper::*)(void) __ptr64,OC::InProcServerWrapper * __ptr64> >
> >::_Run(std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl
OC::InProcServerWrapper::*)(void),OC::InProcServerWrapper
*>,std::default_delete<std::tuple<void (__cdecl
OC::InProcServerWrapper::*)(void),OC::InProcServerWrapper *> > > > * _Ln) Line
247 C++
simpleserver.exe!std::_LaunchPad<std::unique_ptr<std::tuple<void
(__cdecl OC::InProcServerWrapper::*)(void) __ptr64,OC::InProcServerWrapper *
__ptr64>,std::default_delete<std::tuple<void (__cdecl
OC::InProcServerWrapper::*)(void) __ptr64,OC::InProcServerWrapper * __ptr64> >
> >::_Go() Line 233 C++
simpleserver.exe!std::_Pad::_Call_func(void * _Data) Line 210
C++
ucrtbased.dll!00007ffe7429b0a8() Unknown
ucrtbased.dll!00007ffe7429ad11() Unknown
kernel32.dll!00007ffebe6a8364() Unknown
ntdll.dll!00007ffebf225e91() Unknown
So yes my request probably isn?t valid, but I assume it shouldn?t be so easy to
crash the services ?
If someone can give my pointers how to log something in Jira (again: Completely
new to that), I?d love to.
Thanks
/Morten Nielsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20161107/c4afa4ab/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0052D29F286C4B569DF33445113C4FE3.png
Type: image/png
Size: 305232 bytes
Desc: 0052D29F286C4B569DF33445113C4FE3.png
URL:
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20161107/c4afa4ab/attachment.png>