Camelia, the Perl 6 bug

IRC log for #darcs, 2011-04-22

| Channels | #darcs index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:37 lispy left #darcs
00:52 jeffz joined #darcs
01:10 secorp left #darcs
01:31 copumpkin joined #darcs
01:33 lispy joined #darcs
01:43 iago left #darcs
02:34 zooko joined #darcs
02:46 exlevan joined #darcs
02:51 intripoon_ joined #darcs
02:53 zooko left #darcs
02:53 zooko joined #darcs
02:54 intripoon left #darcs
04:14 secorp joined #darcs
04:41 copumpkin left #darcs
04:59 sm left #darcs
05:09 dankna left #darcs
05:52 secorp left #darcs
05:53 secorp joined #darcs
06:34 kolmodin left #darcs
07:22 jeltsch joined #darcs
07:51 gal_bolle joined #darcs
07:58 shenshei joined #darcs
08:09 jeltsch left #darcs
09:05 exlevan left #darcs
09:06 raichoo joined #darcs
09:19 jeltsch joined #darcs
09:55 jeffz left #darcs
10:00 dcoutts Heffalump: sorry, I didn't explain it well
10:00 dcoutts I've got 3 patches from the same contributor
10:01 dcoutts 2 of them done at the same time, and a 3rd later
10:01 dcoutts the first 2 now conflict with more recent developments in the head version of the repo
10:02 dcoutts the 3rd is mostly a merge patch that fixes up many of those conflicts, but it was still too late and the head version has moved on further
10:03 dcoutts so it's not a 3-way conflict I think
10:04 dcoutts perhaps I do just have to amend each of the three patches in sequence
10:04 dcoutts but it seems like I ought to be able to save some effort, since the remaining conflicts after applying the 3rd patch are much smaller than after applying the first 2
10:04 gwern left #darcs
10:19 gwern joined #darcs
10:52 owst joined #darcs
11:15 jderque joined #darcs
11:25 iago joined #darcs
12:15 gal_bolle left #darcs
12:52 dankna joined #darcs
12:58 sm joined #darcs
13:20 shenshei left #darcs
13:20 shenshei joined #darcs
13:34 copumpkin joined #darcs
13:35 dankna left #darcs
14:00 copumpkin left #darcs
14:00 jeltsch left #darcs
14:15 sm_ joined #darcs
14:16 sm left #darcs
14:16 sm_ is now known as sm
14:29 jeffz joined #darcs
14:40 gh_ joined #darcs
14:49 copumpkin joined #darcs
14:49 copumpkin left #darcs
14:49 copumpkin joined #darcs
14:54 iago owst, did you have luck?
14:55 owst No, I'm still trying to make the segfault consistantly reproducable.
14:55 owst I think it must be a timing-dependent bug, since it doesn't always happen, every time.
14:56 iago I don't know
14:56 iago seems very improbable if it is related with the compilation of a regex,no?
14:57 owst I don't know at all! I'm just trying things to see if I can track it down.
14:57 owst I just don't see what effect my patch can be having, that would cause this.
15:00 owst And it seems strange that I can't reproduce the segfault outside of darcs (and the test runner)
15:03 jderque left #darcs
15:05 Heffalump try building darcs with the non-threaded runtime
15:07 owst Yeah, that was my next port-of-call. I've just been trying to disable the RTS timer, but I seem to passing the flags incorrectly, since darcs keeps saying I haven't compiled with -rtsopts, when I have :)
15:07 secorp left #darcs
15:08 owst s/compiled/linked/ Well, I assume adding -rtsopts to ghc-options in the cabal file is the way to do so?
15:08 jeltsch joined #darcs
15:09 preflex joined #darcs
15:10 lispy left #darcs
15:10 lispy joined #darcs
15:13 Heffalump yes, but make sure you find the right ghc-options section - though I guess you're well aware of the multiple sections already
15:13 owst Ah, phew, I thought threading was causing the bug - a few false positives :). It's still happening.
15:15 owst Heffalump: Yep I spotted the lib/darcs/darcs-test sections. Not sure why it doesn't work.
15:31 Heffalump you can always cabal build -v, then copy and paste the long ghc command-line yourself and start playing with it
15:31 owst Heffalump: Ah, excellent, that's handy.
15:31 owst Blimey, not lying about 'long'!
15:32 Heffalump :-)
15:32 Heffalump it's got to the point where I redirect the output to a text file
15:32 Heffalump the output of cabal build -v, i.e. including that command-line
15:33 jeffz left #darcs
15:35 lispy owst: if you're trying to run darcs inside ghci, you can also use cabal-dev ghci
15:35 lispy owst: that drops you into ghci and then you manually say ":m + Foo" and it will be available to ghci
15:35 owst I wasn't, but maybe I should...
15:35 lispy owst: Eh, not that useful IMO unless you want to know the type of something.
15:36 lispy owst: I probably just misunderstood why you wanted the exact ghc command
15:42 shenshei left #darcs
15:43 shenshei joined #darcs
15:47 exlevan joined #darcs
15:49 Heffalump 'lo
15:50 owst Afternoon, again.
15:59 exlevan hi
16:13 zooko is now known as zookoreading
16:20 sm morning all
16:21 sm to find the date of your last tag, in a shell script.. is there any better way than darcs changes --from-tag . | tail -2 | head -1 | cut -c '-28'   ?
16:25 lispy sm: you can provide both from and to
16:25 lispy sm: that way you can be sure that only the tag is listed
16:26 lispy $ darcs changes --to-tag . --from-tag .
16:26 lispy Sun Oct 24 08:18:05 PDT 2010  Reinier Lamers <tux_rocker@reinier.de>
16:26 lispy tagged 2.5
16:26 sm good idea
16:26 sm much more portable
16:27 sm I want to count the number of days since.. I think that will need a hs script, or ghc -e oneliner if I can remember how to do imports
16:27 lelit` joined #darcs
16:27 kerneis sm: date should be able to read your date and convert it to seconds since epoch
16:28 kerneis and then, another date gives you current day
16:28 sm aha
16:28 kerneis and a little of bc magic does the diff
16:28 lispy sm: you could also use --xml-output and transform that to strip out the date
16:29 lispy sm: in the xml output I don't know if you want date or local_date.  Probably local_date
16:29 sm kerneis: actually, I don't see my date being able to read an arbitrary date, without also setting the system clock
16:31 lispy sm: you can use date to reformat a time that is input as a string
16:32 kerneis sm: darcs changes --to-tag . --from-tag .|head -n 1|cut -d' ' -f-6 |xargs -I {} date -d "{}"  +%s
16:32 kerneis works for me
16:32 lispy $ date -d 1/1/1989
16:32 lispy Sun Jan  1 00:00:00 PST 1989
16:32 sm doh, how could I not see that. Thanks!
16:33 kerneis darcs changes --to-tag . --from-tag .|head -n 1|cut -d' ' -f-6 |xargs -I {} date -d "{}"  +%s|xargs -I {} echo \( $(date +%s) - {}\)/\(60*60*24\) |bc
16:33 kerneis for the number of days
16:34 sm very nice
16:34 kerneis very ugly, I must say
16:34 sm a haskell script is starting to look like the better option isn't it
16:34 kerneis at least a bash script with intermediate variables
16:35 kerneis instead of the xargs trick
16:35 lelit` left #darcs
16:43 sm yow.. well a ghc one-liner is not going to beat the shell one-line
16:45 zookoreading left #darcs
16:50 secorp joined #darcs
16:55 sm man this should be easier
16:55 lispy if I wanted to make an operator for Storable a => Ptr a -> Int -> a, I was thinking (*>) might be a decent way to go, but I think that's taken in applicative.  Is there a way to reuse applicative for this?
16:55 lispy :t (*>)
16:55 lambdabot forall (f :: * -> *) a b. (Applicative f) => f a -> f b -> f b
16:56 lispy Basically, I want to say, (*>) = peekByteOffset
16:57 lispy But it's hard to think of a good operator name since I can't use []
16:58 zookoreading joined #darcs
16:59 gh_ left #darcs
16:59 lispy oh, oops. I'm asking this in the wrong channel
16:59 lispy I thought I was asking in #haskell.  Sorry
17:02 sm I give you... http://hpaste.org/45951/days_since_darcs_tag !
17:04 sm and I think the result is actually correct
17:08 lelit left #darcs
17:09 owst sm: cool :)
17:09 owst Pub didn't help the debugging effort yesterday, so I'm going to try again later and see if it helps ;)
17:14 sm owst: well.. it may have helped, you just don't know it yet :)
17:14 sm here's the corrected shell version, giving a similar but different count: darcs changes --to-tag . --from-tag .|head -n 1 |cut -d' ' -f-7 |xargs -I {} date -d "{}" +%s |xargs -I {} expr \( $(date +%s) - {} \) / 60 / 60 / 24
17:16 owst http://hpaste.org/45952/core_dump_for_darcs_rec Anyone able to glean anything from this? Could it be a double free somewhere?
17:21 zookoreading is now known as zookophone
17:36 zookophone is now known as zooko
17:50 etarasov joined #darcs
18:03 jderque joined #darcs
18:13 jeltsch left #darcs
18:41 owst Aha!
18:52 sm aha!
18:52 owst I thought I'd found the bug, but I'm not sure, and so am testing before resuming aha-ing :)
18:52 iago so you say "aha" a bit early :P
18:52 owst yep ;)
18:57 jeltsch joined #darcs
19:10 dankna joined #darcs
19:44 owst http://hpaste.org/45955/ So, line 9 adds a finalizer, (which apparently is where the segfault is happening) for a mallocForeignPtrBytes allocated foreign pointer. http://hackage.haskell.org/packages/​archive/base/latest/doc/html/Foreign​-ForeignPtr.html#v:mallocForeignPtr says that a pointer allocated that way does not require a finalizer... I tried hacking some C code to reproduce a segfault, and I could do
19:44 owst it, if I called regfree on a incorrectly initialised regex. I think the finalizer should only be added if the regex is successfully created (if at all).
19:45 Heffalump ahah :-)
19:45 iago owst, so a library problem
19:45 Heffalump and before, no crash because darcs just died straight away?
19:47 owst I haven't convinced myself of a reason why it would happen sometimes and not others...
19:48 Heffalump double frees won't always cause a segfault
19:49 Heffalump it'll just be memory patterns
19:50 owst Hmm, so next question is, why is it failing to compile a regex (and then calling free on an unallocated regex ptr).
19:50 shenshei left #darcs
19:50 shenshei joined #darcs
19:55 copumpkin is now known as elitist
19:56 iago owst, maybe I lost something
19:56 iago but I don't understand "why is it failing to compile a regex" <-- because the regex is invalid ???
19:57 owst Ah, sorry, I wasn't clear.
19:57 owst In the tests, there shouldn't be any invalid regexs, right?
19:57 owst So why is this failure happening!
19:57 iago yes, but why do you know that it is failing to compile a regex ?
19:57 owst Well, I don't.
19:57 owst But that would be a cause of the segfault.
19:59 owst And I know the segfault is happening in that finalize method, in the call to "regfree" which frees a regex structure.
20:00 iago well, IIRC the code is buggy because it could cause double free
20:00 owst Which code?
20:01 iago wrapCompile
20:01 owst How do you know? Sorry, I'm confused :)
20:01 iago well, you said that they are registering a finalizer for a memory which will be automatically released
20:02 owst Oh, riiiight. :)
20:02 iago don't you?
20:02 iago so the code is buggy
20:02 owst Sorry, I got myself confused.
20:02 owst Yes, you're right.
20:02 iago well, I think that bug affects to both cases, valid and invalid regex
20:02 owst Yes, you're right
20:02 owst Sorry, I was being an idiot.
20:03 owst Cool, well, that was a bloody hard bug to track down...
20:04 iago from the manpage
20:04 iago " Otherwise, or if free(ptr) has already been called before, undefined behaviour occurs"
20:04 iago when I read undefined... I guess I should not worry about nothing more
20:04 iago just fix that bug and see what happens
20:04 owst Yeah ;)
20:07 iago I imagine you have some kind of headache
20:07 owst Yeah! I'm happy that it wasn't my code that was the problem :)
20:08 Riastradh `Undefined behaviour' means that the implementation is allowed to make demons fly out of your nose.  Or, `don't do that'.
20:09 elitist is now known as copumpkin
20:10 iago owst, if you get a segfault and you are not playing with Foreign.* not with unsafe* ...
20:11 iago a) it is a library bug b) it is a compiler bug
20:12 iago at least I cannot think in another way to get a segfault with Haskell
20:12 JaffaCake joined #darcs
20:15 JaffaCake1 left #darcs
20:19 owst Argh! I've removed that line, rebuilt the package and installed it, yet the same segfault is still happening :(
20:19 owst Oh wait, I need to rebuild darcs :)
20:21 Heffalump yeah, none of that dynamic linking nonsense in Haskell land :-) (it is supported as of recently, but isn't widely used)
20:23 zooko left #darcs
20:26 owst left #darcs
21:03 jeltsch left #darcs
21:09 shenshei left #darcs
21:15 jderque left #darcs
21:30 zooko joined #darcs
21:46 owst joined #darcs
22:25 gwern left #darcs
22:30 secorp left #darcs
22:30 lispy left #darcs
22:30 lispy joined #darcs
22:45 gwern joined #darcs
22:45 gwern left #darcs
22:45 gwern joined #darcs
22:54 owst Regarding the regex-posix bug, what's the normal approach - just email the maintainer?
23:02 zooko left #darcs
23:04 lispy owst: what is the bug in this case?
23:05 owst There's an extra finalizer registered for the created regex, meaning that a double free happens, which causes a segfault every once in a blue moon.
23:21 owst iago: turns out I don't need to match against "", I was being stupid, and was being bitten by laziness :)
23:24 lispy owst: interesting
23:24 lispy owst: who wrote that?  bos?  dons?
23:24 * lispy goes to look
23:24 owst lispy: Christopher Kuklewicz apparently.
23:24 lispy hmm
23:24 lispy That name is not familiar
23:40 iago owst, no bug tracker ?
23:42 owst iago: Yeah, there is, I didn't look hard enough first time!
23:43 iago in any case I don't what you can expect
23:43 owst Do you mean in terms of a response?
23:44 iago well, forget what I said, if you send a patch it should be fast
23:45 iago I mean that lot of packages are not truly maintained and so bugs are solved by slowly... but in your case you can provide the patch
23:45 iago -by +very
23:45 owst Yes, indeed - if I hadn't been able to track it down, it may have taken a while for it to be fixed!
23:49 iago sure
23:50 owst iago: have you been working on Darcs at all recently?
23:50 iago a bit, but I have to record and submit the patches
23:51 iago milestone on 28th
23:53 owst Cool - what have you been doing?
23:53 iago I have solved a bug introduced by myself in test code
23:53 iago :)
23:54 iago well, and I have continued working a bit more on testing
23:54 iago but not a lot
23:54 owst Good stuff.
23:54 owst I hear about GSoC on Monday I think :)
23:54 iago good luck
23:55 owst Thanks! I hope if I get it, it won't be as painful as finding this memory bug ;)
23:55 iago I hope so
23:56 iago debug that kind of bugs sucks
23:57 iago I'm sure it will be much funnier
23:59 owst haha, you probably mean "more fun" :) "funnier" would be something that is more funny (although git may well be that!). Stupid English!

| Channels | #darcs index | Today | | Search | Google Search | Plain-Text | summary