00:04:24 | * | reem joined #nim |
00:15:58 | * | irrequietus quit () |
00:16:30 | * | flaviu joined #nim |
00:25:34 | * | reem quit (Remote host closed the connection) |
00:34:24 | * | reem joined #nim |
00:35:18 | tghume | Powered by Nim thanks to Araq’s help: http://ratewith.science/ |
00:36:51 | EXetoC | cool. I'll post it on reddit |
00:36:56 | EXetoC | jk |
00:48:54 | * | MyMind quit (Read error: Connection reset by peer) |
00:50:54 | flaviu | tghume: What does it do? |
00:52:15 | * | MyMind joined #nim |
00:52:41 | tghume | flaviu: Breadth first searches the link graph of Wikipedia. But the stated purpose is to find rating scales for things like “On a scale of The Pope to Benedict Cumberbatch how awesome do you feel today?” |
00:53:01 | flaviu | Ah, I didn't notice the github link at the bottom. |
00:53:30 | tghume | flaviu: it was originally written for a “stupid shit noone needs” hackathon in Rust, but I had trouble getting the Rust web framework iron to work so it ended up being a total hack. |
00:53:50 | * | MyMind quit (Read error: Connection reset by peer) |
00:54:18 | tghume | So yesterday I rewrote it in Nim. The hard part is generating the dense binary link graph file of Wikipedia that can fit in memory and allow efficient searching, but I already had that so porting the rest to Nim was easy. |
00:54:28 | flaviu | Btw, comparing Me to Someone Else doesn't return any results. |
00:54:58 | tghume | As I said it works by the Wikipedia link graph, so if the thing doesn’t have a Wikipedia page, it won’t work. |
00:55:58 | flaviu | Well, it does have a wikipedia page, but it looks like they aren't connected. |
00:56:07 | flaviu | Anyway, cool toy. |
00:56:28 | * | MyMind joined #nim |
00:56:38 | flaviu | Getting a scale from Reddit to Hacker News is interesting. |
01:00:20 | * | MyMind quit (Read error: Connection reset by peer) |
01:02:30 | * | MyMind joined #nim |
01:03:09 | * | fizzbooze quit (Ping timeout: 245 seconds) |
01:04:15 | dom96 | tghume: Really cool, the results don't really make sense most of the time though. |
01:04:27 | dom96 | It's cool to see Jester being used. |
01:05:15 | tghume | dom96: I find it fun to try to figure out the connection. One thing to know is that if the white circles are pulsing then it is a bidirectional connection, which means each page links in both ways, which should mean a strong connection between the two things. |
01:05:44 | def- | tghume: cool stuff, how long does it take to do such a search? |
01:05:49 | tghume | dom96: Also just so you know I had to start using the latest Nim because Jester segfaults on hello world with 10.2 |
01:06:05 | tghume | dom96: And the latest version with the new indexing notation doesn’t compile at all. |
01:06:17 | tghume | dom96: Might want to mention that you need the development version in the Readme |
01:07:13 | tghume | def-: It actually takes less than a second in many cases but can take up to maybe 2 seconds in pathological cases. |
01:07:33 | tghume | def-: which actually makes me think it might be able to handle a small subreddit or lower down on Hacker News |
01:07:59 | dom96 | tghume: I think you should just set some limits. |
01:08:22 | dom96 | tghume: Create a backlog and tell people to wait if there is too much activity. |
01:08:36 | def- | that should be fine, even if you get to the top of HN, that seems to be about 1 request/second |
01:08:58 | tghume | dom96: I guess I could, currently I’m just directly running the search in the Jester handler. With a mutex on the data structure since I can’t figure out if Jester is actually concurrent or just queues requests under load. |
01:09:03 | dom96 | tghume: I applied a patch by Araq which should have fixed it with the new indexing notation. |
01:09:13 | dom96 | tghume: Have you tried updating the jester repo recently? |
01:09:52 | tghume | dom96: Yah I’m on the latest commit. What I’m saying is that it doesn’t work on the *older* release version of Nim. Only the latest unreleased developer version. |
01:09:59 | dom96 | tghume: Jester does not create threads so you don't need mutexes. |
01:10:14 | dom96 | oh right, yeah. |
01:10:42 | tghume | dom96: So requests that come in before the last one is done just queue up? Or do they get dropped? |
01:11:52 | dom96 | tghume: Jester is async so it will not block on IO intensive tasks but it will block on CPU intensive tasks. |
01:12:03 | * | MyMind quit (Read error: Connection reset by peer) |
01:12:12 | tghume | dom96: Because if Jester doesn’t create threads, then I’m not sure how to set limits. What if 10 new requests come in while a search is going on? How do I turn them away? |
01:13:01 | dom96 | Yeah, that's tricky. |
01:13:09 | * | MyMind joined #nim |
01:14:58 | dom96 | You can try running your search in another thread but I must warn you that so far my experience when mixing threads and async has resulted in odd crashes. |
01:15:07 | tghume | dom96: I bet I could wrap some kind of worker thread in an async context so that the searches wouldn’t block the web serving but that would be tricky and this is a stupid side project. |
01:15:52 | * | girvo joined #nim |
01:16:13 | dom96 | That would probably work, yes. |
01:20:25 | * | girvo quit (Ping timeout: 252 seconds) |
01:25:39 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
01:30:47 | k1i | dom96: implementing kqueue atm |
01:31:11 | k1i | dom96: i didnt look at the epoll implementation used in asyncnet/asyndispatch, but do you know off the top of your head if you are using epoll in edge-triggered mode? |
01:31:32 | dom96 | k1i: Awesome. Nope, can't remember. |
01:31:45 | k1i | i don't know that my implementation of kq/epoll will be compatible with asyncnet/asyncdispatch |
01:31:52 | * | tghume_ joined #nim |
01:32:37 | dom96 | why don't you make it compatible and add it to asyncdispatch? |
01:32:41 | k1i | i am building a high-perf web server implementation which will use epoll in ET mode, kq in its equivalent, and a threadpool ($nproc threads) to do ET'd waits |
01:33:24 | k1i | the threadpool + ET epoll/kqueue approach isn't friendly to a windows implementation (completion-based aio) typically |
01:33:54 | k1i | and isn't compatible with select() implementations usually |
01:33:57 | k1i | ill look at it, but i wasn't sure |
01:34:58 | * | tghume quit (Ping timeout: 272 seconds) |
01:34:58 | * | tghume_ is now known as tghume |
01:35:20 | * | brson quit (Quit: leaving) |
01:36:08 | dom96 | k1i: I see. If you do choose to implement it for the stdlib all you need to do is implement it in the selectors module. |
01:36:10 | k1i | dom96: i'd like to see how you abstracted windows iocp and epoll |
01:36:24 | k1i | completion vs. readiness |
01:36:32 | dom96 | Asyncdispatch is basically a completion-based API. |
01:36:34 | k1i | ah. |
01:36:50 | k1i | that was the feeling I got |
01:36:54 | dom96 | I can emulate it pretty easily for epoll/select |
01:37:26 | k1i | i am going to need to have a closer look at your epoll impl. - does your epoll_wait block? |
01:38:09 | dom96 | IIRC no |
01:38:26 | k1i | yeah so in non-edge-triggered mode it behaves a lot like select() |
01:38:43 | k1i | in ET mode epoll blocks the thread until an event is dispatched to it |
01:38:51 | k1i | the readiness event also only fires once |
01:39:21 | k1i | so you can have N threads all blocking on a single epoll FD and are given the "guarantee" that only one of them will be awoken with any single event |
01:40:41 | dom96 | ahh |
01:41:17 | k1i | level triggered epoll behaves a lot more like select iirc, it constantly returns readiness status with every loop cycle w/o blocking |
01:42:14 | k1i | the other thing, being a nim newb, i wasn't sure about, was the assumption about IO and threading |
01:42:34 | dom96 | yeah, in that case I am using level triggered epoll. |
01:43:05 | k1i | wasn't sure if it were "okay" to have a library manage an event loop/thread pool behind the scenes |
01:45:24 | k1i | dom96: if i saw correctly, if using asyncdispatch, the user initiates the event loop in their own thread, via runForever? |
01:45:34 | dom96 | indeed |
01:46:56 | k1i | will need to think about how to expose the "sleeping thread-pool" side of the API |
01:49:14 | k1i | cant wait to see the perf numbers though :) |
01:51:10 | k1i | dom96: would there be value in an abstracted HTTP parser? |
01:51:58 | dom96 | I don't think so. Parsing HTTP isn't really that bad. |
01:52:44 | k1i | :D braver than i |
01:52:53 | dom96 | But if you want to create a nimble package which provides it then go right ahead :) |
01:53:11 | k1i | ive never implemented 2.0 either |
01:55:30 | reem | PSA: the fastest http parsers are push parsers which don't keep state |
01:55:49 | reem | so definitely use one vs. a pull parser if you are doing non-blocking io already |
01:55:58 | dom96 | oh yeah, forgot about 2.0. |
01:56:04 | reem | they're also way easier to write because you need no state |
01:56:23 | * | reem goes back to lurking |
01:57:06 | dom96 | what is a 'push parser'? |
01:57:26 | reem | basically you give the parser the entire request up front |
01:57:39 | reem | and it tries to parse, and if it can't parse a complete request or there is too much it errors |
01:58:13 | reem | and you try to read some more data and try again (hence push, since you try, push more data, then give it to the parser, whereas a pull parser takes a "stream" and controls reading itself) |
01:59:14 | dom96 | The current asynchttpserver parser just reads lines and parses them. |
02:03:12 | * | a5i quit (Quit: Connection closed for inactivity) |
02:05:20 | * | darkf joined #nim |
02:09:30 | * | rational quit (Quit: Lost terminal) |
02:13:57 | * | MyMind quit (Read error: Connection reset by peer) |
02:15:12 | * | MyMind joined #nim |
02:19:41 | * | fizzbooze joined #nim |
02:20:58 | * | bjz_ quit (Quit: Textual IRC Client: www.textualapp.com) |
02:23:36 | * | bjz joined #nim |
02:31:43 | * | MyMind quit (Read error: Connection reset by peer) |
02:32:30 | * | tghume quit (Quit: tghume) |
02:32:52 | * | MyMind joined #nim |
02:37:34 | * | MyMind quit (Read error: Connection reset by peer) |
02:42:37 | * | MyMind joined #nim |
02:43:36 | * | TEttinger joined #nim |
03:02:00 | * | filwit quit (Quit: Leaving) |
03:04:39 | * | girvo joined #nim |
03:08:57 | * | girvo quit (Ping timeout: 246 seconds) |
03:09:51 | * | reem quit (Remote host closed the connection) |
03:16:18 | * | EXetoC quit (Ping timeout: 272 seconds) |
03:18:37 | * | reem joined #nim |
03:26:28 | * | brson joined #nim |
03:35:35 | * | arnetheduck joined #nim |
03:40:46 | * | reem quit (Remote host closed the connection) |
03:56:34 | * | MyMind quit (Read error: Connection reset by peer) |
03:59:34 | * | reem joined #nim |
04:05:25 | * | girvo joined #nim |
04:10:01 | * | girvo quit (Ping timeout: 264 seconds) |
04:13:07 | * | Kingsquee joined #nim |
04:17:22 | * | vendethiel quit (Ping timeout: 244 seconds) |
04:21:32 | * | jefus quit (Ping timeout: 272 seconds) |
04:26:23 | * | reem quit (Remote host closed the connection) |
04:28:13 | * | reem joined #nim |
04:29:37 | * | reem quit (Remote host closed the connection) |
04:32:38 | * | vendethiel joined #nim |
04:43:43 | * | MyMind joined #nim |
04:48:25 | * | jefus joined #nim |
04:58:14 | * | MyMind quit (Read error: Connection reset by peer) |
05:03:22 | * | MyMind joined #nim |
05:08:09 | * | MyMind quit (Read error: Connection reset by peer) |
05:10:27 | * | MyMind joined #nim |
05:22:07 | * | reem joined #nim |
05:22:16 | * | jefus_ joined #nim |
05:23:30 | * | reem quit (Remote host closed the connection) |
05:25:37 | * | jefus quit (Ping timeout: 264 seconds) |
05:39:00 | * | vendethiel quit (Ping timeout: 244 seconds) |
05:43:44 | * | MyMind quit (Read error: Connection reset by peer) |
05:45:55 | * | MyMind joined #nim |
05:51:13 | * | girvo joined #nim |
05:52:38 | * | vendethiel joined #nim |
05:56:16 | * | girvo quit (Ping timeout: 264 seconds) |
06:03:44 | * | nande joined #nim |
06:24:28 | * | johnsoft quit (Ping timeout: 244 seconds) |
06:25:35 | * | johnsoft joined #nim |
06:36:54 | * | brson quit (Quit: leaving) |
06:38:22 | * | vendethiel quit (Ping timeout: 255 seconds) |
06:43:34 | * | gokr joined #nim |
06:44:16 | * | vendethiel joined #nim |
06:52:19 | * | fizzbooze quit (Ping timeout: 250 seconds) |
07:05:57 | * | vendethiel quit (Ping timeout: 248 seconds) |
07:08:22 | * | Kingsquee quit (Quit: Konversation terminated!) |
07:09:47 | * | Kingsquee joined #nim |
07:11:34 | * | brson joined #nim |
07:18:12 | * | vendethiel joined #nim |
07:28:57 | * | MyMind quit (Read error: Connection reset by peer) |
07:30:09 | * | MyMind joined #nim |
07:30:24 | * | brson quit (Quit: leaving) |
07:30:52 | * | reem joined #nim |
07:39:59 | * | girvo joined #nim |
07:40:06 | * | Senketsu quit (Read error: Connection reset by peer) |
07:42:26 | * | HakanD joined #nim |
07:43:01 | * | HakanD_ joined #nim |
07:44:34 | * | girvo quit (Ping timeout: 250 seconds) |
07:46:51 | * | HakanD quit (Ping timeout: 246 seconds) |
07:53:43 | * | egrep joined #nim |
08:01:32 | * | HakanD_ is now known as HakanD |
08:02:02 | * | gmpreussner|work quit (Read error: Connection reset by peer) |
08:02:56 | * | nande quit (Remote host closed the connection) |
08:03:44 | * | askatasuna joined #nim |
08:07:12 | * | vendethiel quit (Ping timeout: 252 seconds) |
08:16:53 | * | vendethiel joined #nim |
08:25:17 | * | egrep quit (Remote host closed the connection) |
08:26:45 | * | egrep joined #nim |
08:49:37 | * | gokr quit (Read error: Connection reset by peer) |
08:58:43 | * | BlaXpirit joined #nim |
09:00:09 | * | vendethiel quit (Ping timeout: 250 seconds) |
09:15:29 | * | vendethiel joined #nim |
09:25:38 | * | singul42 joined #nim |
09:26:31 | singul42 | morning |
09:28:45 | * | girvo joined #nim |
09:29:08 | singul42 | I am getting a SIGSEV when using repr on a win32 api struct in an array. It looks like repr doesn't like the last entry in the array, where the members need to be set to NULL (required by the following winapi function https://msdn.microsoft.com/en-us/library/windows/desktop/ms686324%28v=vs.85%29.aspx). does anybody know why am I getting the SIGSEV? |
09:29:28 | singul42 | the nim code: https://bpaste.net/show/498442d331f5 |
09:33:25 | * | girvo quit (Ping timeout: 255 seconds) |
09:36:22 | * | filwit joined #nim |
09:37:47 | fowl | singul42, it seems that repr(nil.cstring) causes a segfault |
09:38:30 | BlaXpirit | goddammit |
09:38:49 | BlaXpirit | nil.anything makes me cringe |
09:40:10 | singul42 | the winapi function also crashes with the array structure, maybe it is related |
09:41:52 | * | irrequietus joined #nim |
09:47:47 | * | gokr joined #nim |
09:53:50 | * | gokr quit (Quit: Leaving.) |
09:58:15 | * | gokr joined #nim |
10:06:08 | * | Kingsquee quit (Quit: Konversation terminated!) |
10:45:46 | * | reem quit (Remote host closed the connection) |
10:54:33 | * | HakanD quit (Quit: Be back later ...) |
11:02:54 | * | HakanD joined #nim |
11:08:30 | BlaXpirit | lol finally i realize that regex needs backtracking and i never took it into account |
11:09:07 | BlaXpirit | so forget about that "another implementation" |
11:09:43 | * | BlaXpirit quit (Quit: Quit Konversation) |
11:12:44 | * | BlaXpirit joined #nim |
11:17:33 | * | girvo joined #nim |
11:22:32 | * | girvo quit (Ping timeout: 265 seconds) |
11:28:48 | * | gokr quit (Quit: Leaving.) |
11:30:14 | * | filwit quit (Quit: Leaving) |
11:43:11 | * | vendethiel quit (Ping timeout: 256 seconds) |
11:47:19 | * | zama quit (Ping timeout: 245 seconds) |
11:50:43 | * | vendethiel joined #nim |
11:58:56 | * | irrequietus quit () |
12:02:19 | * | EXetoC joined #nim |
12:07:33 | singul42 | *sigh* guess I am giving up. I'll try to write the windows service in freepascal/VC++ and see if I encounter the same problems as in nim. |
12:09:40 | * | zama joined #nim |
12:13:58 | * | Trustable joined #nim |
12:14:09 | * | davidhq joined #nim |
12:32:25 | * | irrequietus joined #nim |
12:35:26 | * | vendethiel quit (Ping timeout: 244 seconds) |
12:47:35 | * | vendethiel joined #nim |
12:49:55 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:50:30 | * | HakanD quit (Quit: Be back later ...) |
12:53:16 | * | HakanD joined #nim |
12:53:18 | * | TEttinger quit (Ping timeout: 256 seconds) |
12:57:59 | * | cir0x joined #nim |
12:58:39 | * | gokr joined #nim |
12:59:05 | * | gokr quit (Client Quit) |
13:02:15 | singul42 | mhm |
13:04:36 | singul42 | I couldn't stop debugging and it looks like the real problem is --threads:on when compiling my service. when I omit --threads:on the windows service control manager calls my callback just fine and with --threads:on my service crashes. the funny thing is, I don't use any thread stuff at all in my (test) service. |
13:06:19 | * | girvo joined #nim |
13:09:58 | singul42 | in case someone wants to take a look: http://pastebin.com/nivu6ZBS |
13:11:01 | * | girvo quit (Ping timeout: 256 seconds) |
13:11:39 | * | Trustable_2 joined #nim |
13:13:17 | * | Trustable quit (Ping timeout: 256 seconds) |
13:23:29 | * | askatasuna quit (Ping timeout: 256 seconds) |
13:24:37 | * | johnsoft quit (Ping timeout: 256 seconds) |
13:25:01 | * | johnsoft joined #nim |
13:27:36 | flaviu | singul42: If windows has something like gdb, you could try that and see exactly where it crashes. |
13:43:32 | singul42 | mhm, not sure if that works, because windows is starting my service. However, I am a nim/C/C++ noob and don't know gdb very well. |
13:50:37 | * | askatasuna joined #nim |
13:54:17 | singul42 | flaviu: just tried it. I guess it doesn't work as I need to start the application in gdb, but I cannot do that as windows will start it when I am pressing the "Start" link of the service in the service control manager. |
13:55:10 | flaviu | Does it crash immediately after pressing start? |
13:55:51 | flaviu | In linux, you can attach GDB to a certain PID, that might be possible here if it takes a few moments to crash. |
13:55:56 | * | Strikecarl joined #nim |
13:56:32 | singul42 | kind of. My main procedure is called and inside that I register the callback. After registering the callback it crashes immediatetly |
13:56:34 | Strikecarl | If i want to write stuff to an .txt what lib am i going to use? |
13:56:55 | singul42 | Strikecarl: import streams |
13:57:25 | flaviu | singul42: If you can sleep for 20 seconds or so before registering the callback, you might be able to get GDB hooked on the process. |
13:58:05 | singul42 | cool, will try that |
13:58:47 | singul42 | Strikecarl: you can use a FileStream to write stuff to a txt file |
13:59:02 | Strikecarl | Thanks! |
13:59:45 | flaviu | Strikecarl: If this is a single string you're writing, see system.writeFile |
13:59:46 | * | leonlee joined #nim |
14:02:05 | * | darkf quit (Quit: Leaving) |
14:03:36 | * | cir0x1 joined #nim |
14:05:14 | * | cir0x quit (Ping timeout: 245 seconds) |
14:14:19 | singul42 | flaviu: looks like gdb has problems. when using "attach" with the current pid of the waiting service it always tells me "Can't attach to proces" |
14:16:56 | flaviu | Are you running it as admin? http://stackoverflow.com/questions/20337870/what-is-the-equivalent-of-system-diagnostics-debugger-launch-in-unmanaged-code might also be helpful |
14:19:07 | singul42 | flaviu: I am running it under the same user gdb is run |
14:19:26 | flaviu | No, GDB should be run as admin |
14:23:53 | pigmej | hmm, what's the recommended debugger ? |
14:24:44 | flaviu | Whatever C debugger you prefer. Make sure to use --debuginfo --linedir:on |
14:25:06 | * | askatasuna quit (Ping timeout: 272 seconds) |
14:26:10 | pigmej | oh cool |
14:26:13 | singul42 | flaviu: thanks for your help. working now. gdb tells me a SIGSEV happened while exiting nimFrame() |
14:26:54 | flaviu | singul42: type "bt" and get the full stack trace. "i lo" to inspect local variables. |
14:28:29 | singul42 | those are the first 3 entries: |
14:28:32 | singul42 | #0 0x0042efe6 in nimFrame () #1 0x0042f4be in servicemain_190048@8 () #2 0x761375a8 in SECHOST!I_ScIsSecurityProcess () |
14:29:05 | singul42 | servicemain_... is my callback procedure |
14:29:26 | dom96 | perhaps try --tlsEmulation:on |
14:33:09 | EXetoC | do any gdb frontends come close to the functionality provided by VS? displaying trees and such in ddd is highly inconvenient |
14:33:56 | flaviu | EXetoC: You can always eval C expressions, so you can include your own pretty-printer with the program. |
14:36:46 | singul42 | dom96: same error with --tlsEmulation:on |
14:36:56 | singul42 | here's the full stacktrace: https://bpaste.net/show/3e8050292e9e |
14:40:04 | flaviu | Does nim need to do some sort of intialization on new thread creation? |
14:40:32 | flaviu | I think windows is creating a new thread here, but nim doesn't initialize things |
14:40:42 | singul42 | I don't know. The segfault only occurs with --threads:on |
14:41:06 | flaviu | Try --threads:on and -d:release |
14:41:24 | singul42 | flaviu: yes, according to msdn docs a new thread is created which then immediatetly calls the given callback function |
14:41:48 | EXetoC | flaviu: ok. that's something at least |
14:41:49 | * | Sembei quit (Ping timeout: 264 seconds) |
14:43:01 | * | untitaker quit (Ping timeout: 264 seconds) |
14:46:51 | singul42 | flaviu: looks different now with -d:release: https://bpaste.net/show/68b3af2aa7ac |
14:47:53 | * | untitaker joined #nim |
14:50:29 | flaviu | singul42: Try asking Araq, I have no idea. |
14:54:26 | singul42 | flaviu: no problem. you already helped a lot. thanks for that :-) |
14:55:06 | * | girvo joined #nim |
14:57:37 | * | Sembei joined #nim |
14:59:33 | * | girvo quit (Ping timeout: 248 seconds) |
15:02:25 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
15:04:35 | Araq | singul42: is the callback run in a different thread by windows? |
15:04:59 | Araq | if so, you need to call setupForeignThreadGc as the first statement in your callback |
15:05:32 | Araq | also --threads:on sometimes causes problems with --tlsEmulation:on and --stackTrace:on |
15:05:37 | Araq | on windows |
15:05:45 | Araq | try stackTrace:off please |
15:06:15 | singul42 | ok, will do |
15:06:34 | singul42 | Araq: the callback is run in a different thread |
15:06:56 | Araq | then it merely works by chance with --threads:off |
15:07:54 | Araq | BlaXpirit: I have a native regex implementation, will push it soon |
15:09:32 | Araq | I'm doing regex->NFA->DFA-> optimize DFA -> generate state machine though |
15:09:49 | Araq | so it's actually a lexer generator, not a regex engine |
15:09:55 | EXetoC | cool |
15:11:26 | * | vendethiel quit (Ping timeout: 252 seconds) |
15:11:33 | singul42 | Araq: it works with --threads:off. I am still unsure why it doesn't work with --threads:on and if possible I want to use threading support. |
15:12:02 | Araq | singul42: stress tested it with --threads:off? |
15:12:05 | singul42 | Araq: added setupForeignThreadGC() and compiled with --stackTrace:off |
15:12:08 | Araq | cause it shouldn't work |
15:12:27 | singul42 | Araq: still get a segfault |
15:12:33 | singul42 | Araq: not stress tested yet |
15:12:48 | Araq | singul42: turn off --tlsEmulation |
15:15:09 | singul42 | Araq: compiled with: nim c --threads:on --lineDir:on --debuginfo --stackTrace:off --tlsEmulation:off |
15:15:10 | * | vendethiel joined #nim |
15:15:37 | flaviu | Araq: Does it properly handle split? :P |
15:15:40 | singul42 | Araq: still getting a segfault: #0 0x004140f1 in reallocshared_6089 () |
15:15:51 | Araq | reallocshared? |
15:15:56 | Araq | what do you do? |
15:16:26 | Araq | do you use some crappy unprotected shared heap logging? |
15:17:19 | singul42 | Araq: nope, I don't use that anymore :-) |
15:17:33 | singul42 | Araq: also I don't use any threading stuff for the test |
15:17:38 | singul42 | Araq: https://bpaste.net/show/bc8917531b4a |
15:19:40 | * | leonlee quit (Ping timeout: 264 seconds) |
15:19:59 | Araq | str = newWideCString("SCLogService") |
15:20:01 | Araq | arr[0].lpServiceName = cast[LPTSTR](addr str[0]) |
15:20:11 | Araq | <-- extremely fishy |
15:20:24 | Araq | newWideCString can be collected |
15:20:46 | Araq | though a bit unlikely |
15:21:19 | Araq | does StartServiceCtrlDispatcher return immediately? I guess not |
15:21:52 | Araq | btw there is os.changeFileExt(getAppFilename(), "log") |
15:22:13 | singul42 | Araq: thanks for the hint |
15:22:36 | singul42 | Araq: no, it doesn't come back immediately. |
15:24:01 | singul42 | Araq: "If StartServiceCtrlDispatcher succeeds, it connects the calling thread to the service control manager and does not return until all running services in the process have entered the SERVICE_STOPPED state." <-- from msdn |
15:24:20 | Araq | ServiceMain( |
15:24:22 | Araq | _In_ DWORD dwArgc, |
15:24:23 | Araq | _In_ LPTSTR *lpszArgv |
15:24:25 | Araq | ) |
15:24:39 | Araq | but you use Dword, LPTSTR without the * |
15:24:48 | Araq | not that it matters |
15:24:56 | Araq | since you don't access the params anyway |
15:27:03 | Araq | get rid of these |
15:27:06 | Araq | arr[1].lpServiceName = cast[LPTSTR](0) #NULL |
15:27:08 | Araq | arr[1].lpServiceProc = cast[LPSERVICE_MAIN_FUNCTION](0) #NULL |
15:27:17 | singul42 | LPTSTR is PWideChar which is defined as PWideChar* = ptr uint16. |
15:27:19 | Araq | the array is initialized to 0 already for you |
15:27:46 | singul42 | msdn says that the last two entries in the array need to be NULL, but I'll try |
15:27:54 | singul42 | oh, cool |
15:27:59 | Araq | they are NULL already. |
15:28:32 | Araq | why is this cast[LPSERVICE_TABLE_ENTRY] required? |
15:29:46 | singul42 | LPSERVICE_TABLE_ENTRY* = ptr SERVICE_TABLE_ENTRY |
15:30:11 | singul42 | if I don't cast it, I get an compilation error |
15:30:19 | * | askatasuna joined #nim |
15:30:57 | Araq | well you shouldn't really |
15:31:14 | Araq | the addr produces a 'ptr' of the right type afaict |
15:31:32 | singul42 | ok, will change it |
15:32:04 | singul42 | yes, works with addr only |
15:32:31 | Araq | well I dunno. all I do know is that windows has like 2 different threading models for services |
15:32:43 | Araq | or even 4 and it's weird |
15:33:31 | singul42 | omg |
15:33:35 | singul42 | WORKS |
15:33:43 | singul42 | serviceMain is called now |
15:33:44 | Araq | I usually used a supervisor script and called the exe on my own. :P |
15:34:06 | Araq | it's not like the retarded windows service UI buys you anything anyway :P |
15:36:14 | singul42 | so, one or more of the last 5 changes did the trick. rolling back now to see what really helped |
15:36:34 | singul42 | thanks a lot Araq! |
15:38:21 | Araq | btw you can use the RollingLogger as a global variable |
15:38:26 | singul42 | and also thanks to flaviu for the good gdb advice. much appreciated. |
15:38:30 | Araq | but not its 'ref' variant |
15:38:48 | Araq | and even then it kinda relies on implementation details |
15:38:52 | * | HakanD quit (Quit: Be back later ...) |
15:38:53 | Araq | and is fragile |
15:40:42 | singul42 | ok, I tested the RollingFileLogger in an separate thread and used a channel to send text to be logged to that thread. that looked like it worked ok. however, I still have to get used to local heaps and channels. |
15:42:06 | * | HakanD joined #nim |
15:43:58 | singul42 | nim is really nice but also very different in some aspects compared to other (high) level languages, such as java. |
15:50:09 | * | arnetheduck quit (Ping timeout: 252 seconds) |
15:56:07 | singul42 | Araq: --tlsEmulation:off did the trick |
15:57:13 | singul42 | however, I will stress test now with all the changes |
16:02:58 | * | banister joined #nim |
16:03:06 | * | banister quit (Max SendQ exceeded) |
16:04:32 | * | askatasuna quit (Ping timeout: 246 seconds) |
16:17:39 | * | jefus__ joined #nim |
16:20:38 | * | jefus_ quit (Ping timeout: 246 seconds) |
16:43:54 | * | girvo joined #nim |
16:48:52 | * | girvo quit (Ping timeout: 272 seconds) |
16:49:37 | * | vendethiel quit (Ping timeout: 264 seconds) |
16:53:00 | * | banister joined #nim |
16:53:05 | * | banister quit (Max SendQ exceeded) |
16:58:28 | * | banister joined #nim |
16:59:43 | EXetoC | dom96: there's no email authentication associated with password resetting? |
17:16:46 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
17:33:11 | * | vendethiel joined #nim |
17:40:28 | * | HakanD quit (Quit: Be back later ...) |
17:48:47 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:59:11 | onionhammer | why is nimble update timing out... |
18:05:24 | BlaXpirit | hmmm |
18:06:15 | BlaXpirit | yeah, onionhammer, same |
18:06:19 | BlaXpirit | nimble update just hangs |
18:06:23 | BlaXpirit | but the link itself works |
18:07:31 | BlaXpirit | works now |
18:07:38 | BlaXpirit | github seemed to be partially down |
18:09:01 | * | BlaXpirit_ joined #nim |
18:09:10 | * | HakanD joined #nim |
18:09:47 | flaviu | Github is under DDOS |
18:11:47 | * | BlaXpirit_ quit (Read error: Connection reset by peer) |
18:12:23 | * | BlaXpirit_ joined #nim |
18:28:44 | * | HakanD quit (Quit: Be back later ...) |
18:29:17 | flaviu | huh, https://raw.githubusercontent.com/nim-lang/packages/master/packages.json works, but https://github.com/nim-lang/packages/raw/master/packages.json fails |
18:29:34 | flaviu | might be internal changes, not the ddos |
18:29:39 | * | singul42 quit (Quit: Page closed) |
18:32:40 | * | girvo joined #nim |
18:36:59 | * | girvo quit (Ping timeout: 252 seconds) |
18:40:39 | * | gokr joined #nim |
18:40:44 | * | gokr quit (Client Quit) |
18:40:56 | * | gokr joined #nim |
18:42:08 | * | BlaXpirit_ quit (Read error: Connection reset by peer) |
18:42:44 | * | matkuki joined #nim |
18:42:49 | * | BlaXpirit_ joined #nim |
18:50:49 | * | HakanD joined #nim |
18:52:48 | * | matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 36.0.4/20150320202338]) |
19:08:38 | * | Varriount joined #nim |
19:21:01 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
19:24:18 | * | MagusOTB joined #nim |
19:24:51 | * | Varriount looks around |
19:24:54 | MagusOTB | how do I seek() and tell() on a file? |
19:28:16 | def- | MagusOTB: setFilePos and getFilePos? |
19:29:21 | MagusOTB | yep, thanks |
19:38:09 | reactormonk | how well does nim-suggest work? |
19:41:51 | * | fizzbooze joined #nim |
19:51:31 | dom96 | EXetoC: I can only reset passwords for now on the forum. |
19:53:27 | * | Senketsu joined #nim |
20:21:20 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:21:27 | * | girvo joined #nim |
20:23:17 | * | fizzbooze quit (Ping timeout: 248 seconds) |
20:25:01 | * | cir0x1 quit (Quit: Leaving.) |
20:26:02 | * | girvo quit (Ping timeout: 252 seconds) |
20:51:25 | * | MyMind quit (Ping timeout: 265 seconds) |
20:57:21 | * | reem joined #nim |
21:04:34 | * | Etheco quit (Quit: Leaving) |
21:06:43 | Trustable_2 | Hi guys, can iterators be recursive? |
21:15:07 | * | Trixar_za joined #nim |
21:16:42 | * | fizzbooze joined #nim |
21:18:00 | * | Trixar_za quit (Read error: Connection reset by peer) |
21:18:10 | * | Trixar_za joined #nim |
21:18:39 | * | TEttinger joined #nim |
21:21:18 | Araq | no. |
21:23:50 | * | EXetoC quit (Quit: WeeChat 1.1.1) |
21:25:48 | * | perturbation joined #nim |
21:26:36 | * | perturbation quit (Client Quit) |
21:26:42 | * | jefus__ quit (Ping timeout: 265 seconds) |
21:28:54 | Trustable_2 | Araq: ok, I solved my problem without recursion. I just found out , that they are really useful :) |
21:29:07 | Trustable_2 | the iterators in general |
21:32:30 | * | perturbation joined #nim |
21:33:15 | * | Trixar_za quit (Quit: Leaving) |
21:37:00 | * | Kingsquee joined #nim |
21:37:13 | * | girvo joined #nim |
21:37:30 | Araq | hi Kingsquee welcome |
21:38:06 | Kingsquee | hey Araq, thanks! |
21:40:27 | perturbation | anyone else have problems with github today b/c of ddos? |
21:42:00 | * | girvo quit (Ping timeout: 256 seconds) |
21:43:06 | TEttinger | perturbation: https://status.github.com/messages |
21:43:12 | TEttinger | apparently not just today |
21:43:17 | TEttinger | but I haven't had trouble |
21:43:51 | perturbation | it's been intermittent in-and-out for me... glad to hear doing better for others |
21:43:55 | perturbation | seems to be mostly okay now though |
21:44:56 | TEttinger | my commit streak is steady at 289 days on crappy game projects :) |
21:45:25 | TEttinger | I haven't been interrupted by DDoS |
21:46:32 | * | reem quit (Ping timeout: 256 seconds) |
21:47:15 | Varriount | Happily for me, the DDoS started just as I was going to bed. |
21:56:38 | * | cyraxjoe joined #nim |
22:06:31 | onionhammer | hey varriount |
22:06:38 | onionhammer | hows the plugin comin |
22:09:36 | Varriount | onionhammer: I think I'm going to have to release it as-is. I'm being overwhelmed by classwork |
22:09:52 | onionhammer | mmm okay. have u merged it back? |
22:10:46 | * | irrequietus quit () |
22:13:32 | MagusOTB | How do I read some ascii bytes from a file into a string? |
22:14:15 | flaviu | .eval let x: string = readFile("/etc/passwd") |
22:14:18 | Mimbus | flaviu: <no output> |
22:14:50 | MagusOTB | not the whole file, I have a File f and I want to read exactly 64 bytes out of the file into the string. |
22:15:55 | MagusOTB | also I'm somewhat confused as to what 's: var string' in a proc declaration means. |
22:16:27 | flaviu | Basically string &s. |
22:16:35 | flaviu | You have to pass in a mutable string. |
22:16:36 | * | flaviu quit (Remote host closed the connection) |
22:17:03 | * | flaviu joined #nim |
22:18:03 | MagusOTB | well, I passed it a static string once, and it compiled and segfaulted |
22:18:49 | MagusOTB | proc scan(f: File, ret: var string, len: int) = discard f.readBytes(ret, len) |
22:19:17 | MagusOTB | it seems to work, and then segfaults when I try to print what I passed in. |
22:19:37 | MagusOTB | err, nevermind, that isn't the version I meant to post |
22:20:03 | MagusOTB | f.readBuffer(addr(ret), len) |
22:20:20 | flaviu | try addr(ret[0]) |
22:21:21 | MagusOTB | that appears to have worked |
22:21:51 | MagusOTB | but now the string contains trailing nulls and when I echo it, it ends instead of printing the stuff that comes after it |
22:21:54 | flaviu | I'm not sure, but addr(ret) might have given you an address on the stack. |
22:21:59 | * | perturbation quit (Remote host closed the connection) |
22:22:05 | Araq | nah. |
22:22:17 | cazov | addr(ret) will give the address of the string, whcih is different from the data subfield |
22:22:25 | MagusOTB | aaaah |
22:22:27 | MagusOTB | ok that makes sense |
22:22:44 | flaviu | If you'd like, use clang and --passC:-fsanitize=address --passL:-fsanitize=address |
22:23:16 | * | reem joined #nim |
22:23:18 | MagusOTB | that sounds complicated. |
22:24:02 | flaviu | Not really, it just makes clang pop up with a colorful error message on segfault. |
22:24:42 | * | perturbation joined #nim |
22:24:54 | MagusOTB | how do I make it use clang? |
22:25:01 | MagusOTB | I'm using the out of the box nim on archlinux atm |
22:25:10 | flaviu | Just curious, how would I get the address of the string on the stack? |
22:25:32 | flaviu | try --cc:clang |
22:28:22 | MagusOTB | I lack clang |
22:28:24 | * | MagusOTB installs i |
22:35:09 | Varriount | flaviu: addr myString? |
22:38:00 | * | replace-bot quit (Remote host closed the connection) |
22:40:40 | * | girvo joined #nim |
22:42:37 | * | perturbation quit (Quit: back later) |
22:45:49 | * | girvo quit (Read error: Connection reset by peer) |
22:54:08 | * | HakanD quit (Quit: Be back later ...) |
23:13:45 | gokr | MagusOTB: http://pastebin.com/sUtCtyVY |
23:14:00 | gokr | Or perhaps you had your reasons. |
23:19:46 | * | BlaXpirit quit (Remote host closed the connection) |
23:32:50 | MagusOTB | gokr: that's different, but I got what I wanted wokring |
23:33:19 | gokr | MagusOTB: Yeah, I know, just wanted to mention it so that you weren't complicating things. |
23:35:00 | MagusOTB | Although now I ave a string which has len 64 and has a bunch of nulls in it and when I format it into another string, the string ends |
23:38:31 | MagusOTB | is there a nim equivalent of zip() from python? |
23:38:42 | MagusOTB | (takes 2 iterators and returns one iterator which returns tuples) |
23:41:07 | * | gokr quit (Quit: Leaving.) |
23:48:43 | * | JStoker quit (Excess Flood) |
23:48:54 | * | JStoker joined #nim |
23:49:45 | * | Maxdamantus quit (Ping timeout: 252 seconds) |
23:50:54 | def- | MagusOTB: zip from iterutils should do that, but the module doesn't work with the current devel compiler I think: http://hookrace.net/nim-iterutils/iterutils.html#zip,,Iterable[S] |