Overview
Features
Download
Documentation
Community
Add-Ons & Services

Cannot start windows service with HTTPSClientSession

A general discussion forum.

Cannot start windows service with HTTPSClientSession

Postby Pankaj » 17 May 2013, 09:09

I installed my ServerApplication as windows service on win 2008 32 bit server. When service is started, application crashes and produces a crash dump.
This issue is observed only when HTTPSClientSession object instantiation is included. On removing this, service starts successfully.
Also when service is started from administrator account, it works.

Please let me know if there is any solution to this problem. Please find code and crash dump call stack details below.

Code: Select all
#include "Poco/Util/ServerApplication.h"
#include "Poco/Net/HTTPSClientSession.h"
#include <iostream>

using Poco::Util::ServerApplication;

#include "fstream"
#define SEPARATOR "response:"

using namespace std;

class mysvr : public ServerApplication
{
    int main(const std::vector<std::string>& args)
    {
        waitForTerminationRequest();
        return 1;
    }
};

using Poco::Net::HTTPSClientSession;

int main(int argc, char** argv)
{
    mysvr osvr;
    WORD    version = MAKEWORD(2, 2);
    WSADATA data;
    if (WSAStartup(version, &data) != 0)
        printf("Failed to initialize network subsystem");
    Poco::Net::HTTPClientSession  *httpClientSession = 0;
    try
    {
        httpClientSession = new HTTPSClientSession();
    }
    catch(...)
    {}
    osvr.run(argc, argv);
    return 1;
}


Crash dump points to
Code: Select all
if (WSAStartup(version, &data) != 0)

callstack is

Code: Select all
>   PocoNet.dll!Poco::Net::initializeNetwork()  Line 286 + 0x12 bytes   C++
    PocoNet.dll!Poco::Net::SocketImpl::SocketImpl()  Line 66   C++
    PocoNet.dll!Poco::Net::StreamSocketImpl::StreamSocketImpl()  Line 47 + 0xf bytes   C++
    PocoNet.dll!Poco::Net::Socket::Socket()  Line 53 + 0x49 bytes   C++
    PocoNet.dll!Poco::Net::`anonymous namespace'::`dynamic initializer for 'nullSocket''()  Line 90 + 0xd bytes   C++

This is invoked from
Code: Select all
static Socket nullSocket;
in file Net\src\SocketNotifier.cpp.
Pankaj
 
Posts: 1
Joined: 16 May 2013, 07:54

Re: Cannot start windows service with HTTPSClientSession

Postby alex » 18 May 2013, 07:03

Pankaj wrote:Also when service is started from administrator account, it works.

Sounds definitely like a permission issue. If you need to run as non-Administrator, see if the solution described in this post helps.
alex
 
Posts: 1132
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest