Thrift
  1. Thrift
  2. THRIFT-1488

src/concurrency/Thread.h:91:58: error: invalid conversion from 'pthread_t {aka _opaque_pthread_t*}' to 'apache::thrift::concurrency::Thread::id_t {aka long long unsigned int}' [-fpermissive]

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9
    • Component/s: Build Process
    • Labels:
      None
    • Environment:

      Mac OSX 10.6.8 x86_64, up to date macports, apple gcc 4.2.1, genuine gnu gcc 4.5.3 and 4.6.2

      Description

      right after building the generators :

      Making all in lib
      Making all in cpp
      Making all in .
      /bin/sh ../../libtool --tag=CXX --mode=compile /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT Thrift.lo -MD -MP -MF .deps/Thrift.Tpo -c -o Thrift.lo `test -f 'src/Thrift.cpp' || echo './'`src/Thrift.cpp
      libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT Thrift.lo -MD -MP -MF .deps/Thrift.Tpo -c src/Thrift.cpp -fno-common -DPIC -o .libs/Thrift.o
      libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT Thrift.lo -MD -MP -MF .deps/Thrift.Tpo -c src/Thrift.cpp -o Thrift.o >/dev/null 2>&1
      mv -f .deps/Thrift.Tpo .deps/Thrift.Plo
      /bin/sh ../../libtool --tag=CXX --mode=compile /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT TApplicationException.lo -MD -MP -MF .deps/TApplicationException.Tpo -c -o TApplicationException.lo `test -f 'src/TApplicationException.cpp' || echo './'`src/TApplicationException.cpp
      libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT TApplicationException.lo -MD -MP -MF .deps/TApplicationException.Tpo -c src/TApplicationException.cpp -fno-common -DPIC -o .libs/TApplicationException.o
      libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT TApplicationException.lo -MD -MP -MF .deps/TApplicationException.Tpo -c src/TApplicationException.cpp -o TApplicationException.o >/dev/null 2>&1
      mv -f .deps/TApplicationException.Tpo .deps/TApplicationException.Plo
      /bin/sh ../../libtool --tag=CXX --mode=compile /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT VirtualProfiling.lo -MD -MP -MF .deps/VirtualProfiling.Tpo -c -o VirtualProfiling.lo `test -f 'src/VirtualProfiling.cpp' || echo './'`src/VirtualProfiling.cpp
      libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT VirtualProfiling.lo -MD -MP -MF .deps/VirtualProfiling.Tpo -c src/VirtualProfiling.cpp -fno-common -DPIC -o .libs/VirtualProfiling.o
      libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT VirtualProfiling.lo -MD -MP -MF .deps/VirtualProfiling.Tpo -c src/VirtualProfiling.cpp -o VirtualProfiling.o >/dev/null 2>&1
      mv -f .deps/VirtualProfiling.Tpo .deps/VirtualProfiling.Plo
      /bin/sh ../../libtool --tag=CXX --mode=compile /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT ThreadManager.lo -MD -MP -MF .deps/ThreadManager.Tpo -c -o ThreadManager.lo `test -f 'src/concurrency/ThreadManager.cpp' || echo './'`src/concurrency/ThreadManager.cpp
      libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -Wall -g -O2 -MT ThreadManager.lo -MD -MP -MF .deps/ThreadManager.Tpo -c src/concurrency/ThreadManager.cpp -fno-common -DPIC -o .libs/ThreadManager.o
      In file included from src/concurrency/ThreadManager.h:26:0,
      from src/concurrency/ThreadManager.cpp:24:
      src/concurrency/Thread.h: In static member function 'static apache::thrift::concurrency::Thread::id_t apache::thrift::concurrency::Thread::get_current()':
      src/concurrency/Thread.h:91:58: error: invalid conversion from 'pthread_t

      {aka _opaque_pthread_t*}

      ' to 'apache::thrift::concurrency::Thread::id_t

      {aka long long unsigned int}

      ' [-fpermissive]
      make[4]: *** [ThreadManager.lo] Error 1
      make[3]: *** [all-recursive] Error 1
      make[2]: *** [all-recursive] Error 1
      make[1]: *** [all-recursive] Error 1
      make: *** [all] Error 2

      1. ASF.LICENSE.NOT.GRANTED--config.log
        184 kB
        Philippe STRAUSS
      2. thrift-1488.patch
        0.5 kB
        Jake Farrell

        Issue Links

          Activity

          Hide
          Jake Farrell added a comment -

          I am currently on lion and snow leopard and I have the latest version of xcode which provides gcc. I am using the latest version of autoconf and automake along with pkg-config v.25, and boost 1.47. I have compiled everything using a prefix of /usr/local. With these settings I have not run into any issues. Can you please attach your configure log and installed versions of everything

          Show
          Jake Farrell added a comment - I am currently on lion and snow leopard and I have the latest version of xcode which provides gcc. I am using the latest version of autoconf and automake along with pkg-config v.25, and boost 1.47. I have compiled everything using a prefix of /usr/local. With these settings I have not run into any issues. Can you please attach your configure log and installed versions of everything
          Hide
          Philippe STRAUSS added a comment -

          Hello Jake,

          this is using :

          automake @1.11.2_0 (active)
          autoconf @2.68_2 (active)
          pkgconfig @0.26_1 (active)
          boost @1.48.0_4 (active)

          ./configure --prefix=/opt/misc/ --with-c_glib --with-haskell=no --with-php=no --with-ruby=no --with-java=no

          enabling or disabling c_glib doesn't change anything.
          using apple gcc-4.2.1 or genuine gnu gcc 4.5.3 doesn't improve the situation either (4.6.2 got an accurate error msg)

          I've also restarted with a fresh svn checkout.

          the config log is attached.


          Philippe Strauss
          http://www.philou.ch/

          Show
          Philippe STRAUSS added a comment - Hello Jake, this is using : automake @1.11.2_0 (active) autoconf @2.68_2 (active) pkgconfig @0.26_1 (active) boost @1.48.0_4 (active) ./configure --prefix=/opt/misc/ --with-c_glib --with-haskell=no --with-php=no --with-ruby=no --with-java=no enabling or disabling c_glib doesn't change anything. using apple gcc-4.2.1 or genuine gnu gcc 4.5.3 doesn't improve the situation either (4.6.2 got an accurate error msg) I've also restarted with a fresh svn checkout. the config log is attached. – Philippe Strauss http://www.philou.ch/
          Hide
          Jake Farrell added a comment -

          After upgrading to the latest stable libevent (currently 2.0.16) this patch will fix the compile issue you are having with os x gcc

          Show
          Jake Farrell added a comment - After upgrading to the latest stable libevent (currently 2.0.16) this patch will fix the compile issue you are having with os x gcc
          Hide
          Jake Farrell added a comment -

          committed

          Show
          Jake Farrell added a comment - committed
          Hide
          Philippe STRAUSS added a comment -

          Jake,

          The good news is that it is solved in this file,

          The bad one is that I encounter the same further in the build :

          libtool: link: (cd ".libs" && rm -f "libthrift.dylib" && ln -s "libthrift-0.9.0-dev.dylib" "libthrift.dylib")
          libtool: link: ar cru .libs/libthrift.a Thrift.o TApplicationException.o VirtualProfiling.o ThreadManager.o TimerManager.o Util.o TDebugProtocol.o TDenseProtocol.o TJSONProtocol.o TBase64Utils.o TTransportException.o TFDTransport.o TFileTransport.o TSimpleFileTransport.o THttpTransport.o THttpClient.o THttpServer.o TSocket.o TSSLSocket.o TSocketPool.o TServerSocket.o TSSLServerSocket.o TTransportUtils.o TBufferTransports.o TServer.o TSimpleServer.o TThreadPoolServer.o TThreadedServer.o TAsyncChannel.o PeekProcessor.o Mutex.o Monitor.o PosixThreadFactory.o
          /usr/bin/ranlib: file: .libs/libthrift.a(VirtualProfiling.o) has no symbols
          libtool: link: ranlib .libs/libthrift.a
          ranlib: file: .libs/libthrift.a(VirtualProfiling.o) has no symbols
          libtool: link: ( cd ".libs" && rm -f "libthrift.la" && ln -s "../libthrift.la" "libthrift.la" )
          /bin/sh ../../libtool --tag=CXX --mode=compile /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -I/opt/local/include -Wall -g -O2 -MT libthriftnb_la-TNonblockingServer.lo -MD -MP -MF .deps/libthriftnb_la-TNonblockingServer.Tpo -c -o libthriftnb_la-TNonblockingServer.lo `test -f 'src/server/TNonblockingServer.cpp' || echo './'`src/server/TNonblockingServer.cpp
          libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -I/opt/local/include -Wall -g -O2 -MT libthriftnb_la-TNonblockingServer.lo -MD -MP -MF .deps/libthriftnb_la-TNonblockingServer.Tpo -c src/server/TNonblockingServer.cpp -fno-common -DPIC -o .libs/libthriftnb_la-TNonblockingServer.o
          src/server/TNonblockingServer.cpp: In member function 'void apache::thrift::server::TNonblockingIOThread::breakLoop(bool)':
          src/server/TNonblockingServer.cpp:1432:36: error: invalid conversion from 'apache::thrift::concurrency::Thread::id_t

          {aka long long unsigned int}

          ' to 'pthread_t

          {aka _opaque_pthread_t*}

          ' [-fpermissive]
          ./src/concurrency/Thread.h:90:22: error: initializing argument 1 of 'static bool apache::thrift::concurrency::Thread::is_current(pthread_t)' [-fpermissive]
          make[4]: *** [libthriftnb_la-TNonblockingServer.lo] Error 1
          make[3]: *** [all-recursive] Error 1
          make[2]: *** [all-recursive] Error 1
          make[1]: *** [all-recursive] Error 1
          make: *** [all] Error 2

          using the same build tools and ./configure --prefix=/opt/misc/ --with-c_glib --with-haskell=no --with-php=no --with-ruby=no --with-java=no

          Thanks.


          Philippe Strauss
          http://www.philou.ch/

          Show
          Philippe STRAUSS added a comment - Jake, The good news is that it is solved in this file, The bad one is that I encounter the same further in the build : libtool: link: (cd ".libs" && rm -f "libthrift.dylib" && ln -s "libthrift-0.9.0-dev.dylib" "libthrift.dylib") libtool: link: ar cru .libs/libthrift.a Thrift.o TApplicationException.o VirtualProfiling.o ThreadManager.o TimerManager.o Util.o TDebugProtocol.o TDenseProtocol.o TJSONProtocol.o TBase64Utils.o TTransportException.o TFDTransport.o TFileTransport.o TSimpleFileTransport.o THttpTransport.o THttpClient.o THttpServer.o TSocket.o TSSLSocket.o TSocketPool.o TServerSocket.o TSSLServerSocket.o TTransportUtils.o TBufferTransports.o TServer.o TSimpleServer.o TThreadPoolServer.o TThreadedServer.o TAsyncChannel.o PeekProcessor.o Mutex.o Monitor.o PosixThreadFactory.o /usr/bin/ranlib: file: .libs/libthrift.a(VirtualProfiling.o) has no symbols libtool: link: ranlib .libs/libthrift.a ranlib: file: .libs/libthrift.a(VirtualProfiling.o) has no symbols libtool: link: ( cd ".libs" && rm -f "libthrift.la" && ln -s "../libthrift.la" "libthrift.la" ) /bin/sh ../../libtool --tag=CXX --mode=compile /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -I/opt/local/include -Wall -g -O2 -MT libthriftnb_la-TNonblockingServer.lo -MD -MP -MF .deps/libthriftnb_la-TNonblockingServer.Tpo -c -o libthriftnb_la-TNonblockingServer.lo `test -f 'src/server/TNonblockingServer.cpp' || echo './'`src/server/TNonblockingServer.cpp libtool: compile: /opt/gnucc/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I./src -I/opt/local/include -Wall -g -O2 -MT libthriftnb_la-TNonblockingServer.lo -MD -MP -MF .deps/libthriftnb_la-TNonblockingServer.Tpo -c src/server/TNonblockingServer.cpp -fno-common -DPIC -o .libs/libthriftnb_la-TNonblockingServer.o src/server/TNonblockingServer.cpp: In member function 'void apache::thrift::server::TNonblockingIOThread::breakLoop(bool)': src/server/TNonblockingServer.cpp:1432:36: error: invalid conversion from 'apache::thrift::concurrency::Thread::id_t {aka long long unsigned int} ' to 'pthread_t {aka _opaque_pthread_t*} ' [-fpermissive] ./src/concurrency/Thread.h:90:22: error: initializing argument 1 of 'static bool apache::thrift::concurrency::Thread::is_current(pthread_t)' [-fpermissive] make [4] : *** [libthriftnb_la-TNonblockingServer.lo] Error 1 make [3] : *** [all-recursive] Error 1 make [2] : *** [all-recursive] Error 1 make [1] : *** [all-recursive] Error 1 make: *** [all] Error 2 using the same build tools and ./configure --prefix=/opt/misc/ --with-c_glib --with-haskell=no --with-php=no --with-ruby=no --with-java=no Thanks. – Philippe Strauss http://www.philou.ch/
          Hide
          Jake Farrell added a comment -

          I ran into the same issue, upgrading to the latest libevent-2.0.16-stable will fix that issue. What libevent version are you using?

          Show
          Jake Farrell added a comment - I ran into the same issue, upgrading to the latest libevent-2.0.16-stable will fix that issue. What libevent version are you using?
          Hide
          Philippe STRAUSS added a comment -

          2.0.16 too, I've looked at your patch and made this one:

          — TNonblockingServer.cpp.orig 2012-01-17 16:14:45.000000000 +0100
          +++ TNonblockingServer.cpp 2012-01-17 16:19:17.000000000 +0100
          @@ -1429,7 +1429,7 @@
          // mechanism to stop the thread, but happily if we're running in the
          // same thread, this means the thread can't be blocking in the event
          // loop either.

          • if (!Thread::is_current(threadId_))
            Unknown macro: {+ if (!Thread}

          TNonblockingServer.cpp and Thrift as a whole (with my configure invocation) builds.

          But physically far for a while of the location where I have a second computer to test thrift now, hmm could cook something on localhost in case though.

          Regards.


          Philippe Strauss
          http://www.philou.ch/

          Show
          Philippe STRAUSS added a comment - 2.0.16 too, I've looked at your patch and made this one: — TNonblockingServer.cpp.orig 2012-01-17 16:14:45.000000000 +0100 +++ TNonblockingServer.cpp 2012-01-17 16:19:17.000000000 +0100 @@ -1429,7 +1429,7 @@ // mechanism to stop the thread, but happily if we're running in the // same thread, this means the thread can't be blocking in the event // loop either. if (!Thread::is_current(threadId_)) Unknown macro: {+ if (!Thread} TNonblockingServer.cpp and Thrift as a whole (with my configure invocation) builds. But physically far for a while of the location where I have a second computer to test thrift now, hmm could cook something on localhost in case though. Regards. – Philippe Strauss http://www.philou.ch/
          Hide
          Philippe STRAUSS added a comment -

          got it again on current SVN in TNonblockingServer.cpp:1432 :

          src/server/TNonblockingServer.cpp: In member function 'void apache::thrift::server::TNonblockingIOThread::breakLoop(bool)':
          src/server/TNonblockingServer.cpp:1432:36: error: invalid conversion from 'apache::thrift::concurrency::Thread::id_t

          {aka long long unsigned int}

          ' to 'pthread_t

          {aka _opaque_pthread_t*}

          ' [-fpermissive]

          Show
          Philippe STRAUSS added a comment - got it again on current SVN in TNonblockingServer.cpp:1432 : src/server/TNonblockingServer.cpp: In member function 'void apache::thrift::server::TNonblockingIOThread::breakLoop(bool)': src/server/TNonblockingServer.cpp:1432:36: error: invalid conversion from 'apache::thrift::concurrency::Thread::id_t {aka long long unsigned int} ' to 'pthread_t {aka _opaque_pthread_t*} ' [-fpermissive]
          Hide
          Philippe STRAUSS added a comment -

          Jake,

          I need this patch to build thrift on my setup (the same issue than jira's thrift 1488):

          — TNonblockingServer.cpp.orig 2012-02-25 15:40:11.000000000 +0100
          +++ TNonblockingServer.cpp 2012-02-25 15:44:26.000000000 +0100
          @@ -1429,7 +1429,7 @@
          // mechanism to stop the thread, but happily if we're running in the
          // same thread, this means the thread can't be blocking in the event
          // loop either.

          • if (!Thread::is_current(threadId_))
            Unknown macro: {+ if (!Thread}

          Currently I have on the build machine, this version of libevent (same as you):

          libevent @2.0.16_0 (active)

          this is still OSX 10.6.8, gcc 4.6.2 (gnu, not macports, apple or whatever), same or a bit newer autotools than last time.

          Regards.


          Philippe Strauss
          http://www.strauss-acoustics.ch/

          Show
          Philippe STRAUSS added a comment - Jake, I need this patch to build thrift on my setup (the same issue than jira's thrift 1488): — TNonblockingServer.cpp.orig 2012-02-25 15:40:11.000000000 +0100 +++ TNonblockingServer.cpp 2012-02-25 15:44:26.000000000 +0100 @@ -1429,7 +1429,7 @@ // mechanism to stop the thread, but happily if we're running in the // same thread, this means the thread can't be blocking in the event // loop either. if (!Thread::is_current(threadId_)) Unknown macro: {+ if (!Thread} Currently I have on the build machine, this version of libevent (same as you): libevent @2.0.16_0 (active) this is still OSX 10.6.8, gcc 4.6.2 (gnu, not macports, apple or whatever), same or a bit newer autotools than last time. Regards. – Philippe Strauss http://www.strauss-acoustics.ch/
          Hide
          Roger Meier added a comment -
          Show
          Roger Meier added a comment - see THRIFT-1585

            People

            • Assignee:
              Jake Farrell
              Reporter:
              Philippe STRAUSS
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development