Monday April 12, 2010

[Time] NameMessage
[07:25] CIA-5 zeromq2: 03Martin Sustrik 07master * r3236cb1 10/ (7 files): ETERM is accounted for in the documentation -
[07:57] CIA-5 zeromq2: 03Martin Sustrik 07master * r7668e79 10/ (doc/zmq_socket.txt src/zmq.cpp): zmq_poll returns ETERM in case of context termination -
[08:05] CIA-5 zeromq2: 03Martin Sustrik 07master * r3496476 10/ (4 files in 4 dirs): MSVC perf build fixed -
[08:43] mikko good morning
[09:11] sustrik morning
[11:15] olivier_c hello everybody
[11:37] sustrik olivier_c: hi
[11:42] olivier_c sustrik, could you bring me some clarifications on assertion in pgm_socket.cpp line 130, please ? I've got an assertion fail (assert false) there, and i don't have any clue on what could have fail :/.
[11:45] sustrik wait a sec
[11:47] sustrik it's an unexpected result code from OpenPGM library
[11:47] sustrik can you check what exact error are you getting?
[11:47] sustrik (both domain and code)
[11:49] olivier_c ok I'm going to have a look on it
[11:49] sustrik thanks
[12:24] olivier_c so. i just get "Assertion failed: false (pgm_socket.cpp line 130). Aborted. i'm just trying to connect a SUB socket to "epgm://eth0;". does it mean that pgm isn't supported ?
[12:41] sustrik olivier_c: no, it means that OpenPGM returned unexpected error
[12:41] sustrik can you run the app under gdb
[12:41] sustrik and check what the actual error is:
[12:42] sustrik pgm_error->domain
[12:42] sustrik and
[12:42] sustrik pgm_error->code
[12:43] olivier_c ah ok, sorry for misunderstanding.
[12:49] sustrik np
[12:56] mato sustrik: _WIN32 is always defined on Win32, yes?
[12:56] mato sustrik: at the top of zmq.h we have:
[12:56] mato (...)
[12:56] mato #include <errno.h>
[12:56] mato #include <stddef.h>
[12:56] mato #if defined _WIN32
[12:56] mato #include "winsock2.h"
[12:56] mato #endif
[12:56] mato #if defined ZMQ_BUILDING_LIBZMQ_WITH_MSVC
[12:56] mato #define ZMQ_EXPORT __declspec(dllexport)
[12:56] mato #elif defined _MSC_VER
[12:56] mato #define ZMQ_EXPORT __declspec(dllimport)
[12:56] mato #else
[12:57] mato #define ZMQ_EXPORT
[12:57] mato #endif
[12:57] mato (...)
[12:58] sustrik at least with MSVC
[12:58] sustrik not sure how gcc handles this
[12:59] mato ok and that BUILDING_LIBZMQ_WITH_MSVC is something you define in your project file, right?
[12:59] sustrik right
[12:59] mato for libzmq only, and not for e.g. the perf tests or devices
[12:59] mato right?
[12:59] sustrik right
[13:00] sustrik and it's not relevant to anyting except msvc
[13:00] mato no, it's relevant to win32 in general
[13:00] sustrik ?
[13:00] mato MinGW also supports the __declspec(dll...) stuff
[13:00] sustrik whoa
[13:00] mato at least it seems that way
[13:00] mato well it certainly doesn't complain
[13:01] sustrik ok then
[13:01] mato so I'm thinking that the above if's should be changed
[13:01] sustrik maybe a more sound name should be used then?
[13:01] mato 1. ZMQ_BUILDING... becomes something like LIBZMQ_DLL ?
[13:01] mato 2. that can probably become #elif defined _WIN32, but I'm going to check
[13:02] sustrik ZMQ_BUILD_IN_PROGRESS
[13:02] mato no, it's only to do with a win32 dll
[13:02] sustrik that can be defined for all platforms
[13:02] mato ah
[13:02] sustrik but then we'll need _WIN32
[13:02] mato that's no problem
[13:05] mato i'll do something experimental on a branch, no hurry for this to go into git proper right now
[13:06] sustrik ok
[13:19] lvh Hello
[13:19] lvh Anyone know where the zmq_server binary is in debian?
[13:21] mato lvh: there is no zmq_server binary :-)
[13:21] mato lvh: in any case the device binaries are in zeromq-bin
[13:22] lvh So why does tell me to run it? :-(
[13:23] mato that's old 1.x material
[13:23] mato sorry, it really needs to be removed :(
[13:23] mato and/or updated
[13:24] lvh Aha, I see.
[13:24] lvh I'm trying to use pyzmq
[13:24] lvh I'm not sure if that's 1.x material
[13:24] mato see the Cookbook for up to date examples
[13:24] mato no, pyzmq is definitely 2.x
[13:24] lvh okay :-)
[13:24] mato how did you get to the old chat example?
[13:24] mato anyway, you want to look here:
[13:25] mato and also on the pyzmq page itself
[13:25] mato
[13:25] lvh errrrrr
[13:26] lvh I'm not sure.
[13:27] lvh I'm trying to get the python chat example to work with no dice
[13:28] lvh An address like tcp://localhost:5555 is fine, right?
[13:29] lvh Oh, I figured out how I got to that page.
[13:29] lvh Google indexes it.
[13:29] mato localhost:5555 will work for connecting to localhost
[13:30] mato use (interface):5555 when binding, or just use IP addresses
[13:30] mato zee the zmq_connect() and zmq_bind() reference
[13:30] lvh right
[13:30] lvh the script just blocks and doesnt react to signals other than SIGKILL
[13:30] mato read the FAQ :-)
[13:31] lvh Just localhost:5555 gets me zmq._zmq.ZMQError: Invalid argument
[13:31] lvh
[13:31] mato I meant tcp://... of course.
[13:31] lvh Aha :-)
[13:33] lvh
[13:34] mato I'm sorry, I can't help you right now. Not sure who wrote the python examples, maybe sustrik.
[13:34] lvh ellisonbg
[13:35] mato Suggest you ask on the mailing list or wait for Brian to show up here (nick: bgranger).
[13:35] lvh
[13:35] lvh this appears to be something completely different too
[13:35] lvh it has a ZMQ object in the zmq modul
[13:35] lvh mine doesn't have that
[13:36] lvh and the module's called "pyzmq" instead of just "zmq"
[13:36] mato that'll be 1.x also
[13:36] lvh (but the thing on github *is* called pyzmq, yay)
[13:36] mato sustrik: We need to kill the 1.x stuff from the site.
[13:37] lvh sustrik: (even the stuff that doesn't have internal links: google got me there)
[13:39] sustrik lvh: the paste is a pyzmq problem
[13:39] sustrik it's brian's pyzmq
[13:40] sustrik not the old 1.0 pyzmq
[13:40] sustrik mato: yes, i think it's time to ditch 1.0 stuff
[13:40] sustrik i've kept it there so that people still using 1.0 have reference
[13:40] sustrik but they had enough time to migrate by now
[13:41] lvh sustrik: so these are the bindings I should be using, but I've found a bug?
[13:41] sustrik yes, it looks like that
[13:41] sustrik i would try filling an error report with pyzmq project
[13:42] lvh will do :-)
[13:42] sustrik lvh: wait a sec
[13:42] sustrik where does the chat example come from
[13:42] sustrik ?
[13:43] sustrik aha, looks like brian's project
[13:44] sustrik so yes, please report it with pyzmq
[13:45] sustrik lvh: i am not a python programmer, but what about this:
[13:45] sustrik msg = raw_input("%s " % who)
[13:45] sustrik EOFError
[13:45] sustrik ?
[13:45] lvh oh that just means it was waiting for imput and I mashed C-d
[13:45] lvh input, even
[13:45] lvh not a bug, expected behavior :-)
[13:45] sustrik :)
[13:47] lvh the test suite doesn't work because there's no pgm support, apparently
[13:47] lvh somewhat weird that multicast doesn't work -- does that need userspace libs, or something?
[13:47] lvh apt-cache search multicast lib dev doesn't yield any likely candidates
[13:48] sustrik lvh: does it work with tcp?
[13:48] lvh sustrik: Nope, that pasted example was tcp
[13:49] lvh I'm trying to run the test suite
[13:49] lvh which fails (more quitely than I'd have liked it to), because pgm doesn't work
[13:49] sustrik lvh: this one: ?
[13:50] sustrik the error is caused by Ctrl+C, no?
[13:50] lvh right, but i was expecting to display that message i did send
[13:50] sustrik have you run zmq_forwarder?
[13:50] lvh I didn't know I was supposed to, so no
[13:50] sustrik read README
[13:50] sustrik aha
[13:51] sustrik no README in the directory
[13:51] lvh which one
[13:51] lvh :D
[13:51] sustrik you should complain to Brian
[13:51] sustrik anyway, the C chat example is exactly the same
[13:51] sustrik and there's README
[13:51] sustrik wait a sec
[13:51] lvh i should open a ticket, branch, fix it, deploy patch
[13:51] lvh there's README.rst
[13:51] lvh that describes building
[13:51] sustrik
[13:53] lvh so if you wanted people to be able log in and have everything published to them automatically, you'd use PUBSUB mode?
[13:53] lvh eg "like IRC"
[13:54] lvh I'm building zmq2 manually now, I think pyzmq was building against my system installed libzeromq-dev files and that might be why it was breaking
[14:00] sustrik lvh: yes, PUB/SUB
[14:01] sustrik what system-insalled libzeromq-dev?
[14:01] lvh library_dirs = /home/lvh/dev/zeromq2/lib
[14:01] lvh include_dirs = /home/lvh/dev/zeromq2/include
[14:01] lvh
[14:01] lvh Any idea what the library_dirs is supposed to be on git checkouts of zeromq2?
[14:01] lvh libzmq-dev - Development files and static library for the ZeroMQ library
[14:02] lvh 2.0.6beta.dfsg-2 (/var/lib/apt/lists/
[14:02] sustrik you've had that installed by default?
[14:02] sustrik strange
[14:03] lvh nope, I installed it myself when I started playing with zmq
[14:03] sustrik ok
[14:03] lvh it makes pyzmq compile, but not necessarily work (apparently)
[14:03] sustrik the best thing you can do is to remove all of it
[14:04] lvh just did. what am I supposed to use as lib dir? /usr/bin/ld: cannot find -lzmq
[14:04] sustrik and build both 0mq and pyzmq from git
[14:04] lvh sustrik: build, or build and install?
[14:04] lvh I haven't installed 0mq, just built it
[14:04] sustrik autotools by default use /usr/local as install directory
[14:04] lvh ./ && ./configure && make
[14:05] sustrik where do you want to install it?
[14:05] lvh /usr/local's fine, home dir's better
[14:05] lvh ~/lib/
[14:05] lvh That's where all my python stuff lives, at least
[14:06] sustrik pretty unorthodox
[14:06] sustrik rather do it this way:
[14:06] sustrik ./
[14:07] sustrik ./configure --prefix=/usr
[14:07] sustrik make
[14:07] sustrik sudo make install
[14:07] lvh right, got that
[14:08] lvh where does it install the headers?
[14:08] sustrik /usr/include
[14:08] lvh ah, /usr/local/include
[14:08] mato sustrik: installing to /usr is not a good idea unless you know the implications
[14:09] mato sustrik: that's what /usr/local is for, and most distributions have support for e.g. python/ruby/perl stuff in /usr/local also
[14:09] sustrik ok, i am not an expert
[14:09] sustrik ok, then use just ./configure
[14:09] lvh mato: debian by default doesn't, apparently ;-)
[14:09] lvh ImportError: cannot open shared object file: No such file or directory
[14:10] lvh similarly letting setuptools loose on something your distro occasionally uses is a terrible idea
[14:10] lvh but setuptools in general is a terrible idea
[14:11] lvh it's marginally worse than auto*hell
[14:11] mato lvh: so you have in /usr/local/lib and python can't find it?
[14:11] mato lvh: did you run ldconfig as root after doing make install?
[14:11] mikko is /usr/local/lib in
[14:12] lvh woo, that works
[14:12] lvh nope, forgot ldconfig
[14:12] lvh Ran 13 tests in 9.303s, yay
[14:12] mato there you go :-)
[14:12] mato mikko: on debian at least, yes
[14:14] mikko i think RHEL leaves it out by default
[14:14] mikko seems to be in /etc/ for deb
[14:14] lvh is there a magic zmq_thing I have to run before the pubsub example'll work?
[14:14] sustrik zmq_forwarder
[14:15] lvh I'm seeing zmq._zmq.ZMQError: No such device, afaik devices are things like zmq_*
[14:16] sustrik
[14:17] lvh is the man page for that supposed to be empty?
[14:19] olivier_c fiou, sorry for the delay, so the error is AGAIN (pgm_error->code = 1 and pgm_error->domain = 8) and AGAIN isn't in the "if" line 115 of pgm_socket.cpp
[14:19] olivier_c that's why i get this assert
[14:19] lvh oh, that reminds me. in a pubsub context, what happens if I publish to things that have no listeners (subscribers)? stuff gets silently dropped, right?
[14:20] lvh if so that would be ideal for my use case
[14:20] sustrik lvh: right
[14:20] sustrik olivier_c: wait a sec, checking...
[14:24] sustrik olivier_c: PGM_IF_ERROR_AGAIN?
[14:24] olivier_c yes
[14:26] sustrik hm, pretty vague error
[14:27] lvh ack, now it works
[14:27] sustrik EAI_AGAIN
[14:27] sustrik The name server returned a temporary failure indication. Try again later.
[14:27] sustrik olivier_c: is your name server working?
[14:29] olivier_c hmmm good question . it need a check !
[14:30] sustrik anyway, i would say bind shouldn't even try to access name server, probably an openPGM bug...
[14:31] lvh what's the difference between zmq.POLL and zmq.NOBLOCK? Both appear to be flags set on the Context.
[14:31] lvh (and both want to not block)
[14:32] mikko NOBLOCK is send/recv flag
[14:32] lvh I don't really care if 0MQ blocks internally, as long as I can write my python code as if it doesn't (but how does it tell me it has data when not blocking? callbacks?)
[14:33] lvh aha, okay, so s.recv(flags=zmq.NOBLOCK), and then call that in perpetuity until ther's something there? that sounds like busy waiting
[14:34] sustrik that's what non-blocking access is meant to be, if you want to block, don't specify the flag
[14:34] lvh perhaps I should be asking brian this
[14:35] lvh sustrik: I'm used to non-blocking api's that take callbacks
[14:36] lvh apparently brian knows twisted, he might know how to best integrate the two
[14:36] lvh having select and poll-likes sounds promising :-)
[14:46] mato sustrik: I am going to commit my magic Win32 changes, since they don't break anything
[14:47] sustrik ack
[14:47] mato sustrik: but I need two things from you
[14:47] mato sustrik: 1) Change your "DLL being built" define for the MSVC builds to just define "DLL_EXPORT", don't ask why :-)
[14:48] mato sustrik: 2) then when you have time retest the MSVC builds to make sure they still work (they should, but we need to be sure)
[14:48] sustrik ok, commit it and I change MSVC build
[14:48] sustrik however, are you sure about DLL_EXPORT
[14:48] sustrik no ZMQ_ prefix?
[14:48] mato sustrik: yes, don't ask
[14:49] sustrik no possible collisions with other projects?
[14:49] mato it shouldn't matter right now, if someone complains i'll do something else
[14:50] sustrik well, you should know better than myself, but it sounds suspicious
[14:52] CIA-5 zeromq2: 03Martin Lucina 07master * r0024d29 10/ (4 files in 4 dirs): Build fixes for cross compiling and Win32 -
[14:52] sustrik ok, i'm switching to win
[15:00] CIA-5 zeromq2: 03Martin Sustrik 07master * r370cde0 10/ builds/msvc/libzmq/libzmq.vcproj : win build fixed -
[15:38] lvh brian granger follows zeromq-dev, right?
[15:39] mato yup
[15:39] lvh what exactly is zmq.POLL supposed to do? use async IO internally?
[15:40] lvh ideally, I'd like to have an api that fires a callback as soon as messages come in
[15:40] lvh I think that can be implemented using zmq_select
[15:40] lvh well,
[17:02] lvh Does select busy-wait until something is available?
[17:48] sophacles 2
[17:49] lvh sophacles: ?
[18:18] sophacles sorry typo
[19:45] lvh Hello.