Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error compiling on new stable Debian Wheezy with 1.9.3p194 #346

Closed
ibc opened this Issue · 5 comments

3 participants

@ibc

eventmachine 0.12.10 (but also 1.0.0.preX) fails to compile on the new Debian wheezy (which will become the new Debian Stable next week, so IMHO this is a critical issue):

/# cat /etc/issue
Debian GNU/Linux wheezy/sid \n \l
/# ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
/# gem install eventmachine

usr/bin/ruby1.9.1 extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
checking for main() in -lcrypto... yes
checking for main() in -lssl... yes
checking for main() in -lcrypto... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
creating Makefile

make
compiling binder.cpp
compiling cmain.cpp
compiling cplusplus.cpp
compiling ed.cpp
ed.cpp: In member function ‘virtual int ConnectionDescriptor::SendOutboundData(const char*, int)’:
ed.cpp:503:76: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ed.cpp: In member function ‘void ConnectionDescriptor::_WriteOutboundData()’:
ed.cpp:956:67: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
compiling em.cpp
em.cpp: In member function ‘bool EventMachine_t::_RunEpollOnce()’:
em.cpp:501:3: warning: ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’ is deprecated (declared at /usr/include/ruby-1.9.1/ruby/intern.h:379) [-Wdeprecated-declarations]
em.cpp:501:37: warning: ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’ is deprecated (declared at /usr/include/ruby-1.9.1/ruby/intern.h:379) [-Wdeprecated-declarations]
em.cpp:556:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
em.cpp: In member function ‘bool EventMachine_t::_RunSelectOnce()’:
em.cpp:873:4: warning: ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’ is deprecated (declared at /usr/include/ruby-1.9.1/ruby/intern.h:379) [-Wdeprecated-declarations]
em.cpp:873:38: warning: ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’ is deprecated (declared at /usr/include/ruby-1.9.1/ruby/intern.h:379) [-Wdeprecated-declarations]
em.cpp: In member function ‘void EventMachine_t::_ReadLoopBreaker()’:
em.cpp:924:52: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘bool EventMachine_t::_RunTimers()’:
em.cpp:948:72: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::ConnectToServer(const char*, int, const char*, int)’:
em.cpp:1089:22: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::ConnectToUnixServer(const char*)’:
em.cpp:1218:22: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1221:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1237:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1243:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1249:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::CreateTcpServer(const char*, int)’:
em.cpp:1453:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1455:33: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1535:9: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::OpenDatagramSocket(const char*, int)’:
em.cpp:1545:33: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1596:9: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::_OpenFileForWriting(const char*)’:
em.cpp:1773:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::CreateUnixDomainServer(const char*)’:
em.cpp:1805:33: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1866:9: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::Socketpair(char* const*)’:
em.cpp:1927:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1932:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1934:33: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1938:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1948:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘void EventMachine_t::_ReadLoopBreaker()’:
em.cpp:922:50: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
em.cpp: In member function ‘void EventMachine_t::SignalLoopBreaker()’:
em.cpp:294:34: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
compiling emwin.cpp
compiling epoll.cpp
compiling files.cpp
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:79:27: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
compiling page.cpp
compiling pipe.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘VALUE t_connect_server(VALUE, VALUE, VALUE)’:
rubymain.cpp:468:42: error: format not a string literal and no format arguments [-Werror=format-security]
rubymain.cpp: In function ‘VALUE t_bind_connect_server(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:488:42: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [rubymain.o] Error 1
@ibc

The problem is that in Debian Wheezy, it seems that ruby1.9 uses -Werror=format-security instead of -Wformat-security. The solution is replacing in rubymain.cpp:

rb_raise (EM_eConnectionError, e.what());

with:

rb_raise (EM_eConnectionError, e.what(), "%s");
@raggi
Owner

Fixed by 9473a1b

@raggi raggi closed this
@ibc

Hi, this is not fixed. The lines causing the compilation error are those:

rb_raise (EM_eConnectionError, e.what());

They should be:

rb_raise (EM_eConnectionError, "%s", e.what());
@tmm1
Owner

Looks fixed to me:

$ git grep EM_eConnectionError
ext/rubymain.cpp:                       rb_raise (EM_eConnectionError, "%s", "no connection");
ext/rubymain.cpp:               rb_raise (EM_eConnectionError, "%s", e.what());
ext/rubymain.cpp:                       rb_raise (EM_eConnectionError, "%s", "no connection");
ext/rubymain.cpp:               rb_raise (EM_eConnectionError, "%s", e.what());
ext/rubymain.cpp:               rb_raise (EM_eConnectionError, "%s", e.what());
ext/rubymain.cpp:               rb_raise (EM_eConnectionError, "%s", e.what());
ext/rubymain.cpp:               rb_raise (EM_eConnectionError, "%s", e.what());
ext/rubymain.cpp:               rb_raise (EM_eConnectionError, "%s", e.what());
@ibc

Opss, yeah, the issue was fixed two months ago:

d9718de

@bluewomble bluewomble referenced this issue in alexgutteridge/rsruby
Open

Fix build on Ubuntu Quantal #15

@sodabrew sodabrew referenced this issue from a commit in sodabrew/eventmachine
@ibc ibc Fix an error in rubymain.cpp that makes not possible to compile in De…
…bian Wheezy due to -Werror=format-security.

Related bug reported in EventMachine gem: eventmachine#346
d3a4c49
@decklin decklin referenced this issue in actblue/abagnale
Merged

Run bundle update #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.