--- Log opened Fri Nov 02 00:00:54 2012 00:26 < bnoordhuis> experiments from the wonderful world of systemtap... running `stap -e 'probe process("node").function("*") { }'` on a build with debug symbols is a good way to hang your system 00:48 < Bdedcas> hey guys, i need some help 00:50 < Bdedcas> libuv exits without running my threads 01:02 <@piscisaureus_> too busy 01:11 < piscisaureus_> bnoordhuis: hey 01:11 <@piscisaureus_> bnoordhuis: what's the strace syscall name for getaddrinfo ? 01:41 < bnoordhuis> piscisaureus_: there is no getaddrinfo syscall, it's a library function 01:41 < bnoordhuis> piscisaureus_: you can use ltrace though 01:42 < bnoordhuis> okay, off to bed 01:59 <@piscisaureus_> tell bnoordhuis I'll be late tomorrow probably, firefighting again :-(. Start working on the preso alreadu. 02:01 < mmalecki> piscisaureus_: you'll need some ircretary right there 02:01 <@piscisaureus_> ircretary: tell bnoordhuis I'll be late tomorrow probably, firefighting again :-(. Start working on the preso alreadu. 02:01 < ircretary> piscisaureus_: I'll be sure to tell bnoordhuis 02:02 <@piscisaureus_> mmalecki: good point, thanks ;_) 02:02 < mmalecki> pleasure :) 09:50 <@indutny> hoya 10:11 < roxlu> indutny: got a tiny working libuv+openssl client working with this code: https://gist.github.com/3999827 10:11 <@indutny> good! 10:11 <@indutny> roxlu: ++ 10:11 < roxlu> thanks : ) 10:14 < saghul> roxlu thanks for sharing! :-) 10:15 < roxlu> np, it's not coded super clean, but it shows a bit how to handle memory bios with nonblocking sockets. And it does not do client verification (which was actually why my code wasn't working before: my client was using a self signed certificate which is not allowed by httpd probably) 10:55 <@indutny> piscisaureus_: hey man 10:55 <@indutny> piscisaureus_: do you have a minute? 11:41 < roxlu> Wrapped all SSL bio/encrypting operations in a separate class: https://gist.github.com/4000573 12:09 <@piscisaureus_> hey bnoordhuis 12:09 <@piscisaureus_> I'll be at the office around 2 12:09 < janjongboom> Ben already stole your seat 12:09 <@piscisaureus_> bnoordhuis: we can talk about stream2 / transforms maybe ? 12:09 <@piscisaureus_> the dickhead 12:10 < bnoordhuis> first come, first served 12:10 <@piscisaureus_> that's not what your gf said bnoordhuis 12:10 < bnoordhuis> actually, i know almost nothing about streams2 12:10 < bnoordhuis> but you go ahead and write that presentation :) 12:10 <@piscisaureus_> bnoordhuis: oh I thought we agreed you'd do that? 12:10 <@piscisaureus_> bnoordhuis: we can also do cat pictures only 12:10 < bnoordhuis> no, i'll present it with my usual flair - you can be the speech writer 12:11 < roxlu> :-) 12:11 < roxlu> bnoordhuis: I just posted a simple ssl client example https://gist.github.com/4000573 (you just missed my post) 12:12 < bnoordhuis> ah, you got it to work? 12:12 < roxlu> yes 12:12 < bnoordhuis> good :) 12:12 <@piscisaureus_> indutny: sup? 12:12 <@indutny> piscisaureus_: nvm :) 12:13 < roxlu> actually my previous versions were working too (although the code was even uglier), but I was using SSL_CTX_use_certificate_chain_file which loaded my client certificate which was not validated by the server (because it was self signed) 12:13 < bnoordhuis> ah right, makes sense 12:15 <@indutny> creationix: hoya 12:15 <@indutny> creationix: ia32 support landed https://github.com/indutny/candor 12:16 <@indutny> muhahaha 12:17 <@piscisaureus_> indutny: what did I tell you? 12:18 <@indutny> piscisaureus_: idk? 12:18 <@piscisaureus_> indutny: dont do it!!1 12:18 <@indutny> piscisaureus_: ahahaha 12:18 <@indutny> piscisaureus_: why? 12:18 <@piscisaureus_> I wasn't aware that so many people take the friday off btw - 12:18 <@indutny> I needed it to run candor on travis 12:18 <@piscisaureus_> just had 2 neighbours complaining about my music independent of each other 12:18 <@piscisaureus_> indutny: 64 bit is the future 12:19 <@piscisaureus_> indutny: you can do more interesting optimizations when you can assume near-infinite address space 12:19 <@indutny> :) 12:19 <@indutny> piscisaureus_: I can turn those optimizations off on 32bit 12:20 <@piscisaureus_> indutny: for example you could do garbage collection like go does it 12:20 <@indutny> piscisaureus_: how? 12:20 <@piscisaureus_> lmgtfy 12:20 <@indutny> ah 12:20 <@indutny> http://stackoverflow.com/questions/7823725/what-kind-of-garbage-collection-does-go-use 12:36 <@indutny> piscisaureus_: I'm much more impressed by GC using GPU 13:26 < MI6> joyent/libuv: Ben Noordhuis master * 9c7ae2e : darwin: don't use deprecated AbsoluteToNanoseconds (+1 more commits) - http://git.io/6QO5jg 13:28 < travis-ci> [travis-ci] joyent/libuv#838 (master - 9c7ae2e : Ben Noordhuis): The build passed. 13:28 < travis-ci> [travis-ci] Change view : https://github.com/joyent/libuv/compare/b0bcbdfe81c6...9c7ae2e7a334 13:28 < travis-ci> [travis-ci] Build details : http://travis-ci.org/joyent/libuv/builds/3032098 13:39 < MI6> joyent/libuv: Ben Noordhuis master * dcce1ea : test: fix -Wmissing-field-initializers warnings (+1 more commits) - http://git.io/gE0Oqg 13:41 < travis-ci> [travis-ci] joyent/libuv#839 (master - dcce1ea : Ben Noordhuis): The build passed. 13:41 < travis-ci> [travis-ci] Change view : https://github.com/joyent/libuv/compare/9c7ae2e7a334...dcce1eab3b02 13:41 < travis-ci> [travis-ci] Build details : http://travis-ci.org/joyent/libuv/builds/3032296 13:44 < bnoordhuis> why is gdb so broken on os x ...? 13:45 < bnoordhuis> maybe i should reword that as "why does apple hate developers so much?" 13:46 < deoxxa[cookies]> bnoordhuis: good start, but now you need to expand it to about 500 words, retitle it "why apple hates developers" and post it on HN 14:06 < creationix> indutny: yay 14:06 < creationix> so this means I can run candor on atom processors now? 14:07 < creationix> or a 32-bit vps server 14:22 <@indutny> creationix: yes 14:22 <@indutny> creationix: at least you can try and tell me results :) 14:23 < creationix> I don't have ant 32 bit hardware at the moment, but I could create a 32-bit vm 14:23 < creationix> (well, except for my arm and mips hardware, but that's not ia32) 14:29 < tjfontaine> bnoordhuis: because it's ancient and their focus is on lldb 15:00 < MI6> joyent/node: Ben Noordhuis master * a6fef47 : build: make debug build on os x compile at -O0 Set GCC_OPTIMIZATION_LEVE - http://git.io/QiyGHg 15:08 < saghul> bnoordhuis did you ever compile gdb on OSX and got it to accept core files? 15:08 < saghul> I can compile it but it won't accept core files, even after signing it :-S 15:22 <@indutny> saghul: custom gdb on osx is totally fucked 15:22 < saghul> indutny yeah, I discovered that the sad way :-S 15:22 <@indutny> saghul: also, it'll report wrong backtraces 15:22 <@indutny> saghul: and suddenly crash 15:23 < saghul> indutny debugging the debugger doesn't sound like fun xD 15:24 <@indutny> why not? 15:24 < bnoordhuis> saghul: what indutny said, it's total fail 15:25 <@indutny> not as much as stack alignment on 32bit platforms is 15:25 <@indutny> why 16 bytes?! 15:25 <@indutny> when word size is 4 bytes 15:25 < bnoordhuis> depends on the abi 15:25 <@indutny> also 15:25 <@indutny> I've just lost one of my macbook's rubber "feet" 15:25 <@indutny> is it dangerous? 15:26 < bnoordhuis> they've been known to attack 15:26 < mmalecki> bnoordhuis++ 15:26 < mmalecki> aaaand kohai is gone 15:39 < roxlu> does libuv have integer wrappers 15:41 <@piscisaureus_> um? 15:41 < roxlu> like uv_int8, uv_int16 15:41 <@piscisaureus_> no 15:41 <@piscisaureus_> use stdint.h 15:41 < roxlu> I thought windows doesn't hav stdint.h ? 15:41 <@piscisaureus_> oh - vs2008 doesn't indeed 15:41 <@piscisaureus_> actually we added this to uv.h 15:41 <@piscisaureus_> so if you include uv.h then you can just use these 15:41 < roxlu> ok awesome 15:42 <@indutny> creationix: going to take a look at candor.io 15:43 < creationix> libuv has changed so much and I has so little done 15:43 < creationix> it might be good to just use the old code as reference and start over 15:48 <@indutny> creationix: indeed 15:48 <@indutny> creationix: that's what I'm going to do 15:49 < creationix> indutny: did you want push access or are you going to just fork/start over? 15:49 <@indutny> creationix: I'll start with private repo 15:50 <@indutny> creationix: btw, https://travis-ci.org/#!/indutny/candor/builds/3034356 15:50 <@indutny> confirmation that it works on 32bit platforms 15:50 < creationix> wohoo! 15:50 < creationix> or at least in a 32-but vm 15:50 < creationix> but good enough 15:51 <@indutny> creationix: indeed 15:51 <@indutny> creationix: also it's using lir allocator on both platforms now 15:51 <@indutny> creationix: can't say it's really faster than fullgen 15:51 <@indutny> creationix: but it's a big step anyway 15:52 < creationix> does it beat v8 for some stuff yet? 15:52 < creationix> I imagine candor is a lot easier to optimize 15:54 <@indutny> nope 15:54 <@indutny> :) 15:54 <@indutny> creationix: well 15:54 <@indutny> creationix: it beats it at crossing js-C++ land 15:55 <@indutny> creationix: but I wouldn't say that 15:55 <@indutny> because I hadn't really benchmarked it yet 15:56 < creationix> ok, I'll finish my bare lua-libuv bindings (not the ones used in luvit) and we'll compare with bare candor bindings for tcp echo or something 15:56 < creationix> that would be mostly libuv doing the work with very little done in script land 15:56 < creationix> should test the bindings speed right? 15:59 <@indutny> yeah 16:00 <@indutny> well, it'll measure libuv mostly 16:00 <@indutny> but in case of this test crossing-time is really important 16:24 < saghul> creationix also let me know when you got them, I'd like to see how performance compares to pyuv in Python ;-) 16:24 < creationix> saghul: I need to finish luv before my talk as the lua conference 16:24 < creationix> (that's the week after thanksgiving) 16:25 < saghul> saghul no problem :-) 16:25 < creationix> saghul: you can compare against the bindings in luvit today 16:25 < saghul> doh, that was for you creationix 16:25 < creationix> just require('uv_native') (or whatever I called it) 16:25 < saghul> creationix aren't they more than just a thin wrapper? 16:25 < creationix> the raw bindings aren't much more 16:25 < saghul> oh, nice 16:26 < creationix> but the new bindings I'm writing are even leaner and generic to any lua system, not just luvit 16:26 < saghul> aha 16:26 < saghul> so then luvit would use those instead? 16:33 < creationix> that's the goal 16:33 < creationix> merge it back in when done 16:33 < creationix> assuming it's faster 16:34 < saghul> cool! 16:34 < creationix> libuv itself doesn't have events like node does 16:34 < creationix> only callbacks 16:35 < creationix> luvit's bindings emit named events since luvit was targeting a node style api 16:35 < creationix> but I think it's better for bindings to be 1-1 with the libuv api 16:35 < creationix> pass in the onData callback when calling read_start, for example 16:36 < creationix> vs setting a data handler and then calling read_start() without a callback 16:57 <@isaacs> If a socket is set to allowHalfOpen=false, then we should kill the writable side when the readable side ends, yes? but not hte reverse? 16:57 <@indutny> piscisaureus_: can you remind me utility that can remove useless headers from c files? 17:00 < saghul> creationix indeed 17:01 <@isaacs> creationix: i was thinking about your new luvit plans. in a lot of ways, it's *more* like node than your previous approach. 17:02 <@isaacs> creationix: node is "javascript in javascript-style on the server" 17:02 < creationix> right 17:02 <@isaacs> creationix: luvit was "lua in javascript-style" 17:02 <@isaacs> creationix: but it should be lua in lua-style 17:02 <@isaacs> the current luvit is more like jsgi 17:02 < creationix> but it sure was a fun experiment to clone the node api in another language :) 17:02 <@isaacs> or CommonJS 17:02 <@isaacs> aka, "javascript in python/java style" 17:02 <@isaacs> yeah, yeah 17:02 <@isaacs> informative :) 17:02 <@isaacs> good failures are super valuable. 17:03 < creationix> and backspace likes it 17:03 < creationix> they wanted node in lua 17:03 <@isaacs> backspace? 17:03 < creationix> rackspace 17:03 < CoverSlide> haha 17:03 <@isaacs> is that like a clever insult-name? 17:03 < CoverSlide> that's what i was thinking 17:03 < creationix> no, just a typo 17:03 <@isaacs> like how }); calls the iPad the iBad 17:03 <@isaacs> and the iPhone the iGroan 17:03 < creationix> something about apple keyboards, I can't type on them very well 17:04 < CoverSlide> pquerna and his backspace peeps 17:04 < creationix> besides, backspace would be a compliment 17:04 < creationix> deleting code is always better than adding code :P 17:04 <@isaacs> i guess :) 17:04 <@isaacs> anyway, yeah, a thin wrapper around libuv in lua would be great. 17:04 <@isaacs> you should definitely add a node-like module system, though 17:04 < creationix> yeah, not sure how to do that and embrace lua 17:05 < creationix> their module system sucks 17:05 <@isaacs> yeah 17:05 <@isaacs> so does javascript's 17:05 < creationix> it's all based on pwd and predefined folders 17:05 <@isaacs> that's why we built a new one 17:05 < CoverSlide> es6's too 17:05 <@isaacs> i think es6's has promise. 17:05 <@isaacs> i don't love it, but meh. i don't love much about js, really. 17:05 <@isaacs> i think it'll be useful, probably. we'll see. 17:06 < creationix> I could probably hack the node-style require system on top of lu's require system 17:06 <@isaacs> creationix: i'd suggest, though, don't do exports.foo=blah 17:06 <@isaacs> creationix: *only* support module.exprots=whatever. 17:06 < creationix> in that case, just use return 17:07 < creationix> but then you don't get cyclical dependencies and certain people get upset 17:07 <@isaacs> creationix: well... you need cyclical deps. 17:07 <@isaacs> creationix: it's more relevant than you'd think 17:07 < creationix> I know where it's useful, but in order to support it, you can't use only module.exports 17:08 <@isaacs> creationix: sure you can, just set it to an object at the outsde. 17:08 <@isaacs> *outset 17:08 * isaacs can't type on apple keyboards either, apparently 17:08 <@isaacs> module.exports = {}; runTheModule(module, require, __filename, __dirname); return module.exports; 17:08 <@isaacs> you can always do module.exports.foo=bar 17:09 <@isaacs> you lose this if you only do return 17:10 < creationix> how is that different from what node has? 17:10 < creationix> you're saying to just not inject exports as a local var? 17:10 < mjr_> Having two ways to export things is bad. 17:10 < creationix> actually though, in lua functions can't have properties 17:11 < creationix> so module.exports = some function will be a lot less common 17:11 < creationix> in luvit I always export my classes as properties on the module 17:11 < creationix> require('core').Object, require('emitter').EventEmitter, etc.. 17:11 < creationix> so if I had to pick just one method, it would be exports.foo = 17:11 < mjr_> isaacs: that was a pretty good "sad stallman" pull earlier. 17:12 <@isaacs> mjr_: thanks :) 17:12 < mjr_> ie. reference noted, and credited to your account. 17:13 <@isaacs> creationix: wait, functions can't have properties in lua? 17:13 <@isaacs> wtf? 17:13 < creationix> nope, only tables can 17:13 * isaacs keeps learning things about lua that make it less enticing. 17:13 < creationix> though tables can be callable 17:13 < creationix> so it's infinitely flexible 17:13 < creationix> just the core language is very simple 17:13 <@isaacs> what's the difference between a callable table and a function? 17:14 < creationix> callable tables can have properties 17:14 <@isaacs> ok :) 17:14 < creationix> and they are a lot uglier to define 17:14 < CoverSlide> screw lua. let's all write everything in C 17:14 < mjr_> Sounds good 17:14 < creationix> so what you could do in a module is make the exports table callable 17:14 < creationix> using setmetatable on it 17:14 < creationix> there is something nice about knowing that all modules will be tables 17:15 < creationix> and recursive dependencies would always work too 17:15 < creationix> objects in js can be callable too right? 17:15 < creationix> using proxies or something? 17:15 < creationix> or am I confusing that with some ruby magic I used to know 17:17 <@isaacs> piscisaureus_: so, I'm getting some weird behavior here... 17:17 <@isaacs> piscisaureus_: i call StreamWrap::ReadStart() 17:17 <@isaacs> piscisaureus_: then in the OnData callback, I call ReadStop 17:18 <@isaacs> piscisaureus_: but i don't have enough, so I say, "Ok, read again", which calls ReadStart() again 17:18 <@isaacs> piscisaureus_: ReadStart() returns 0, but I never get the EOF, and I never get any data 17:30 <@isaacs> ohhh.... wait, i think this test might be making some assumptions that are a bit weird.. 17:51 <@isaacs> mjr_: how important is a lowWaterMark functionality on a readable side, really? 17:51 <@isaacs> mjr_: it seems like the low/high water marks are mostly for the benefit of writers 17:52 <@isaacs> mjr_: i guess it could be an issue if you're parsing something that comes in specifically sized chunks, and odn't want to bother getting 'readable' events if there isn't enough to consume yet. 18:00 <@TooTallNate> isaacs: ohh that's a nice use-case, i was just trying to think of a way to do that last night 18:01 <@isaacs> TooTallNate: yeah... but it's also complex and hard to get exactly right in the tcp socket case. 18:02 < creationix> for streams in moonslice, I put low-water marks in readable streams specifically for tcp 18:02 < creationix> but I don't have an API at that level for specifying how many bytes you want 18:02 < creationix> I expect the stream to be wrapped if the user wants that kind of api 18:03 < creationix> (moonslice is my new experimental APIs for libuv + lua) 18:16 <@isaacs> i see... so, the issue is quite interesting here. 18:16 <@isaacs> if the lwm is 0, then we get one byte, and say, "Hey, that's enough, come and get it" 18:16 <@isaacs> and it gets consumed, and then call readStart() again 18:17 <@isaacs> if the lwm is >0, then we get one byte, and say, "That's not enough, readStart again." 18:17 <@isaacs> then the second readStart gives me 254 bytes. 18:17 <@isaacs> and the test is assuming taht write("x") will alwasy --> emit('data', 'x') 18:18 <@isaacs> because the client wrote the rest of teh bytes, since it was not yet at the high water mark for the writable end 18:18 < mjr_> isaacs: in my experience, HWM / LWM are more useful on the writing side. 18:18 < mjr_> In fact, I'd be sort of surprised to find that reads were delayed for any reason, ever. 18:19 <@isaacs> mjr_: yeah, really it was the parser side that made me want to set a lwm for the readable side 18:19 <@isaacs> but i dont' think it justifies the complexity. 18:19 <@isaacs> it's actually working properly, but as you say, it's surprising. 18:19 <@isaacs> maybe the lwm for readers should just default to 0 18:20 <@isaacs> it's useful for fs streams, since reads take a while. having a lwm means it tries to maintain a buffer. 18:21 <@isaacs> ie, that's where it *starts* calling _read(n,cb) 18:21 <@isaacs> so if reads are slow, you kind of want that buffer. 18:21 <@isaacs> but in the normal case, you're doing read() with no arg anyway, and just consuming the entire buffer every time... 18:31 < roxlu> hi guys how stable is this: https://github.com/joyent/http-parser ? 18:32 < roxlu> I'm testing with 2 different http responses and I get exc_bad_access (one from chunked transfer encoding, one from normal) 18:32 < CoverSlide> well once it gets to the body it shouldn't be parsing anymore 18:32 < roxlu> but what if data is chunked? 18:43 <@isaacs> roxlu, CoverSlide yes, it keeps parsing. http is a framed protocol 18:43 <@isaacs> it's not just about parsing headers 18:43 < roxlu> yeah 18:43 < roxlu> I'm pretty sure http_parser is quite stable 18:44 < roxlu> .. probably something I'm doing wrong 18:44 < roxlu> althgouh i'm just passing data I receive from my server directly into the parser 18:45 < roxlu> oh wait I think what could be the probem 18:46 < roxlu> isaacs: the parser probably keeps a pointer to 'previous' data? 18:55 < roxlu> oh ... 18:56 < roxlu> I thought it wasn't necessary to add all callbcks and that http_parser would check if callbacks were set 19:11 < sblom> isaacs: where was the wait-for-the-debugg-agent code that you mentioned to me yesterday? node.cc? 19:27 < sblom> isaacs: I think I found the relevant debug code. 21:24 <@isaacs> sblom: it's in src/node.js 21:24 <@isaacs> sblom: search for " // XXX Fix this terrible hack! 21:26 < sblom> isaacs: See it! Thanks. 21:53 <@isaacs> hm... this is so weird. so, i'm calling readStart, getting a data, then i'm not calling readStop, and it never gives me the eof, even though the other end has ended. 21:56 <@isaacs> ohhh... i get it. 21:56 <@isaacs> oh, this is awesome. 21:56 <@TooTallNate> isaacs: haha 21:56 <@TooTallNate> having a conversation with self? 21:56 <@isaacs> sorta 21:57 <@TooTallNate> net.socket stuff? 21:57 <@isaacs> moving to unofficial StreamFreaks room, aka #stackvm 22:05 <@isaacs> there's nothing wrong with libuv's readStart and readStop 22:05 <@isaacs> this is entirely my bug, and it's so awesome. 22:07 <@TooTallNate> isaacs: hahaha, i like the enthusiasm 23:17 <@isaacs> 7 net tests failing. 23:18 <@isaacs> of 38 23:18 <@isaacs> that's a lot of passing! 23:18 <@isaacs> :) 23:21 <@TooTallNate> isaacs++ 23:21 < kohai> isaacs has 25 beers 23:33 <@piscisaureus_> isaacs++ 23:33 < kohai> isaacs has 26 beers 23:33 <@piscisaureus_> nice --- Log closed Sat Nov 03 00:00:00 2012