Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

bugfixes, updates and c++11 #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

thomas-burger
Copy link

Added some functionality:

  • put has now parameters priority, delay and timeToRun
  • added function release

Bugfixes:

  • added missing expectEol() to listTubes()

c++11:

  • added c++11 compiler flag to be able to use the library from c++11 code

- removed defines DEFAULT_PRIORITY, DEFAULT_PORT, DEFAULT_DELAY and DEFAULT_TTR. Added const integers Client::DEFAULT_PRIORITY, Client::DEFAULT_PORT, Client::DEFAULT_DELAY, Client::DEFAULT_TTR instead.
- added function release(&job, priority, delay)
@mr-andreas
Copy link

Looks nice, except for the -std=c++11. What bugs did you run into that required it?

@thomas-burger
Copy link
Author

It was a segmentation fault in boost (i think at that time it was version 1.49, but it also occurs with version 1.53). As far as i remember, the error occured first, when I started to compile my program with -std=c++11 (but I am not sure of that because I made several changes at that time .. compiler was gcc 4.7.3). Compiling Beanstalkpp with -std=c++11 removed the problem.

output of gdb:
Program received signal SIGSEGV, Segmentation fault.
0x000000000047d8a7 in boost::asio::detail::task_io_service::wake_one_idle_thread_and_unlock (this=0x70fc20, lock=...)
at /usr/include/boost/asio/detail/impl/task_io_service.ipp:507
507 first_idle_thread_ = idle_thread->next;

Backtrace was:
#0 0x000000000047d8a7 in boost::asio::detail::task_io_service::wake_one_idle_thread_and_unlock (this=0x70fc20, lock=...)
at /usr/include/boost/asio/detail/impl/task_io_service.ipp:507
#1 0x000000000047d90b in boost::asio::detail::task_io_service::wake_one_thread_and_unlock (this=0x70fc20, lock=...)
at /usr/include/boost/asio/detail/impl/task_io_service.ipp:518
#2 0x00007ffff703ebcd in boost::asio::detail::task_io_service::init_task() ()
from ../../Libraries/Beanstalkpp/build/libbeanstalkpp.so
#3 0x00007ffff703ec66 in boost::asio::io_service::service* boost::asio::detail::service_registry::createboost::asio::stream_socket_service<boost::asio::ip::tcp >(boost::asio::io_service&) ()
from ../../Libraries/Beanstalkpp/build/libbeanstalkpp.so
#4 0x00007ffff703bad7 in boost::asio::detail::service_registry::do_use_service(boost::asio::io_service::service::key const&, boost::asio::io_service::service* (*)(boost::asio::io_service&)) ()
from ../../Libraries/Beanstalkpp/build/libbeanstalkpp.so
#5 0x00007ffff703f057 in boost::asio::stream_socket_serviceboost::asio::ip::tcp& boost::asio::detail::service_registry::use_serviceboost::asio::stream_socket_service<boost::asio::ip::tcp >() ()
from ../../Libraries/Beanstalkpp/build/libbeanstalkpp.so
#6 0x00007ffff7039338 in Beanstalkpp::Client::Client(std::string const&, int)
() from ../../Libraries/Beanstalkpp/build/libbeanstalkpp.so

@blindmatrix
Copy link
Contributor

Hello Thomas!

Could it be that you've compiled your boost as -std=c++11?

@thomas-burger
Copy link
Author

I installed boost with "sudo aptitude install libboost1.53-all-dev" on Ubuntu. So I don't know which settings were used to compile it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants