Project

General

Profile

Bug #1332

WServer/wthttp: start(): server already started!

Added by navnidhi sharma over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Target version:
Start date:
06/20/2012
Due date:
% Done:

0%

Estimated time:

Description

Is there any obvious reason I am getting the following error when i run my application as '-bash-4.1$ Debug/mychart ---docroot . ---http-address 0.0.0.0 ---http-port 8080' :

[2012-Jun-20 09:33:35.767315] 10669 - [error] "WServer/wthttp: start(): server already started!"

Facts-

I am using latest GCC, i.e. 4.7 and boost 1.49. The port(8080) is available and is NOT occupied by any other process. I ran a simple socket server raw C application, and it starts listening. Any help will be appreciated and thanks for the great tool.

Code -

#include

#include "Charts.h"

#include

#include <boost/thread.hpp>

#include <boost/date_time.hpp>

#include <boost/serialization/singleton.hpp>

using namespace Wt;

class Exchanges

{

public:

Exchanges() : m_tradeQueue(m_io_mutex)

{

}

boost::mutex m_io_mutex;

ibc::Queue m_tradeQueue;

};

class ChartsApplication: public WApplication

{

public:

boost::serialization::singleton exchanges;

ChartsApplication(const WEnvironment& env)

: WApplication(env)

{

setTitle("Charts example");

setCssTheme("polished");

messageResourceBundle().use(appRoot() + "charts");

root()->setPadding(10);

root()->resize(WLength::Auto, WLength::Auto);

new ChartsExample(root(), exchanges.get_mutable_instance().m_tradeQueue);

/*

  • Set our style sheet last, so that it loaded after the ext stylesheets.
    */
    useStyleSheet("charts.css");
    }
    };

WApplication *createApplication(const WEnvironment& env)

{

WApplication *app = new ChartsApplication(env);

return app;

}

int main(int argc, char **argv)

{

int iret = WRun(argc, argv, &createApplication);

return iret;

}

-bash-4.1$ ldd Debug/mychart

linux-vdso.so.1 => (0x00007ffff7ec8000)

libwtdbosqlite3.so.32 => /home/nsharma/nsharma/Desktop/crtllc/sw/wt-3.2.1/build/src/Wt/Dbo/backend/libwtdbosqlite3.so.32 (0x00007ffb53879000)

libwtdbo.so.32 => /home/nsharma/nsharma/Desktop/sw/wt-3.2.1/build/src/Wt/Dbo/libwtdbo.so.32 (0x00007ffb535f2000)

libwttest.so.2 => /home/nsharma/nsharma/Desktop/sw/wt-3.2.1/build/src/Wt/Test/libwttest.so.2 (0x00007ffb533d8000)

libwthttp.so.32 => /home/nsharma/nsharma/Desktop/sw/wt-3.2.1/build/src/http/libwthttp.so.32 (0x00007ffb53117000)

libwt.so.32 => /home/nsharma/nsharma/Desktop/sw/wt-3.2.1/build/src/libwt.so.32 (0x00007ffb528bf000)

libstdc.so.6 => /opt/gcc-4.7.0/lib64/libstdc.so.6 (0x00007ffb52048000)

libm.so.6 => /lib64/libm.so.6 (0x000000331b600000)

libgcc_s.so.1 => /opt/gcc-4.7.0/lib64/libgcc_s.so.1 (0x00007ffb51e24000)

libc.so.6 => /lib64/libc.so.6 (0x000000331a600000)

libpthread.so.0 => /lib64/libpthread.so.0 (0x000000331ae00000)

libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x0000003326e00000)

librt.so.1 => /lib64/librt.so.1 (0x000000331b200000)

libboost_date_time.so.1.49.0 => /opt/boost_1_49_0_source/stage/lib/libboost_date_time.so.1.49.0 (0x00007ffb51c12000)

libdl.so.2 => /lib64/libdl.so.2 (0x000000331aa00000)

libboost_thread.so.1.49.0 => /opt/boost_1_49_0_source/stage/lib/libboost_thread.so.1.49.0 (0x00007ffb519f6000)

libboost_random.so.1.49.0 => /opt/boost_1_49_0_source/stage/lib/libboost_random.so.1.49.0 (0x00007ffb517f4000)

libboost_regex.so.1.49.0 => /opt/boost_1_49_0_source/stage/lib/libboost_regex.so.1.49.0 (0x00007ffb51500000)

libboost_signals.so.1.49.0 => /opt/boost_1_49_0_source/stage/lib/libboost_signals.so.1.49.0 (0x00007ffb512ec000)

libboost_system.so.1.49.0 => /opt/boost_1_49_0_source/stage/lib/libboost_system.so.1.49.0 (0x00007ffb510e9000)

libssl.so.10 => /usr/lib64/libssl.so.10 (0x000000332aa00000)

libz.so.1 => /opt/CollabNet_Subversion/lib/libz.so.1 (0x00007ffb50fd1000)

libboost_filesystem.so.1.49.0 => /opt/boost_1_49_0_source/stage/lib/libboost_filesystem.so.1.49.0 (0x00007ffb50db1000)

libboost_program_options.so.1.49.0 => /opt/boost_1_49_0_source/stage/lib/libboost_program_options.so.1.49.0 (0x00007ffb50b51000)

/lib64/ld-linux-x86-64.so.2 (0x000000331a200000)

libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x0000003327e00000)

libkrb5.so.3 => /lib64/libkrb5.so.3 (0x0000003327200000)

libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000003325600000)

libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003326200000)

libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x0000003325e00000)

libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x0000003326a00000)

libresolv.so.2 => /lib64/libresolv.so.2 (0x000000331c600000)

libselinux.so.1 => /lib64/libselinux.so.1 (0x000000331c200000)

#1

Updated by Wim Dumon over 9 years ago

This message has nothing to do with TCP ports being occupied, but rather with starting an already started WServer (i.e. calling WServer twice).

Note that only one WServer may exist per process - that could maybe explain what you see.

No idea why you see this error; your best option is to step into WRun and WServer::start() and see what is going on there. It may also be a build problem? Did you compile everything with the same compiler version?

Wim.

#2

Updated by navnidhi sharma over 9 years ago

thanks for the quick response. You were correct.

I see for some reason WRun is calling 'WServer server(argv[0], "");' two times. howver, I am calling it only once.

int WRun(int argc, char *argv[], ApplicationCreator createApplication)

{

try {

WServer server(argv[0], "");

try {

...

...

...

}

Wt::WRun(int, char, Wt::ApplicationCreator):

0x7ffff7692ab0: ...icationCreator)+0 push %r15

0x7ffff7692ab2: ...icationCreator)+2 push %r14

0x7ffff7692ab4: ...icationCreator)+4 mov %edi,%r14d

0x7ffff7692ab7: ...icationCreator)+7 push %r13

0x7ffff7692ab9: ...icationCreator)+9 push %r12

0x7ffff7692abb: ...cationCreator)+11 mov %rsi,%r12

229 WServer server(argv[0], "");

0x7ffff7692abe: ...cationCreator)+14 lea 0x6353(%rip),%rsi # 0x7ffff7698e18

227 {

0x7ffff7692ac5: ...cationCreator)+21 push %rbp

0x7ffff7692ac6: ...cationCreator)+22 mov %rdx,%rbp

0x7ffff7692ac9: ...cationCreator)+25 push %rbx

0x7ffff7692aca: ...cationCreator)+26 sub $0x158,%rsp

229 WServer server(argv[0], "");

0x7ffff7692ad1: ...cationCreator)+33 lea 0xe(%rsp),%rdx

0x7ffff7692ad6: ...cationCreator)+38 lea 0x20(%rsp),%rdi

0x7ffff7692adb: ...cationCreator)+43 callq 0x7ffff7654df8 <_ZNSsC1EPKcRKSaIcE@plt>

0x7ffff7692ae0: ...cationCreator)+48 mov (%r12),%rsi

0x7ffff7692ae4: ...cationCreator)+52 lea 0xd(%rsp),%rdx

0x7ffff7692ae9: ...cationCreator)+57 lea 0x10(%rsp),%rdi

0x7ffff7692aee: ...cationCreator)+62 callq 0x7ffff7654df8 <_ZNSsC1EPKcRKSaIcE@plt>

0x7ffff7692af3: ...cationCreator)+67 lea 0x20(%rsp),%rdx

0x7ffff7692af8: ...cationCreator)+72 lea 0x10(%rsp),%rsi

0x7ffff7692afd: ...cationCreator)+77 lea 0xc0(%rsp),%rdi

0x7ffff7692b05: ...cationCreator)+85 callq 0x7ffff7653ce8 <ZN2Wt7WServerC1ERKSsS2@plt>

0x7ffff7692b0a: ...cationCreator)+90 mov 0x10(%rsp),%r13

0x7ffff7692b0f: ...cationCreator)+95 mov 0x22493a(%rip),%rbx # 0x7ffff78b7450

0x7ffff7692b16: ...ationCreator)+102 sub $0x18,%r13

0x7ffff7692b1a: ...ationCreator)+106 cmp %rbx,%r13

0x7ffff7692b1d: ...ationCreator)+109 jne 0x7ffff7692e08 <Wt::WRun(int, char, Wt::ApplicationCreator)+856>

0x7ffff7692b23: ...ationCreator)+115 mov 0x20(%rsp),%r13

Very strange, I wish I could have understood the assembely. Do you have any idea?

Thannks again!

#3

Updated by navnidhi sharma over 9 years ago

Wim-

Please close it. The issue no longer exists. The reason was incorrect Wt build with the latest GCC4.7. I rebuilt the library and it went aways.

Navi

#4

Updated by Koen Deforche over 9 years ago

  • Status changed from New to Closed

Also available in: Atom PDF