Logs: freenode/#haskell
| 2021-03-31 18:24:57 | <tomsmeding> | context: snap-core defines this function: https://hackage.haskell.org/package/snap-core-1.0.4.2/docs/src/Snap.Internal.Http.Types.html#parseHttpTime |
| 2021-03-31 18:25:12 | <olle> | Question: Is exceptions in Haskell a regular monad? Or does it have some extras built in? |
| 2021-03-31 18:25:17 | <olle> | Are* |
| 2021-03-31 18:25:57 | <tomsmeding> | S.unsafeUseAsCString (where S = Data.ByteString.Unsafe) requires that the bytestring is null-terminated, but my application is crashing (segfault) within the C function called here and I'm not sure how to debug why |
| 2021-03-31 18:26:34 | <tomsmeding> | olle: are you talking about ExceptT, or something else? |
| 2021-03-31 18:27:04 | <geekosaur> | I'd expect it to be the user's job, since it may be e.g. part of a network stream |
| 2021-03-31 18:27:06 | × | Sgeo quits (~Sgeo@ool-18b98aa4.dyn.optonline.net) (Ping timeout: 268 seconds) |
| 2021-03-31 18:27:07 | <geekosaur> | fwiw |
| 2021-03-31 18:27:11 | <olle> | tomsmeding: dunno |
| 2021-03-31 18:27:12 | <tomsmeding> | also not sure what you mean with "extras"; every monad implements some kind of functionality apart from supporting 'return' and '>>=' |
| 2021-03-31 18:27:20 | <tomsmeding> | except I guess Identity |
| 2021-03-31 18:27:34 | <tomsmeding> | geekosaur: that's what I'd think too |
| 2021-03-31 18:27:34 | <olle> | tomsmeding: extras = special language support that makes it different than any other monad |
| 2021-03-31 18:27:43 | <tomsmeding> | olle: if you're talking about ExceptT, no |
| 2021-03-31 18:27:51 | <olle> | alright |
| 2021-03-31 18:28:06 | × | Sgeo_ quits (~Sgeo@ool-18b98aa4.dyn.optonline.net) (Ping timeout: 252 seconds) |
| 2021-03-31 18:28:08 | <olle> | Is there a concsensus in Haskell community of which error handling design pattern is best? |
| 2021-03-31 18:28:20 | <tomsmeding> | olle: reason why I'm asking: haskell also has IO exceptions and asynchronous exceptions, which are two different things that are also different from ExceptT, and both are not monads at all :p |
| 2021-03-31 18:28:21 | <olle> | Exceptions vs result types, etc |
| 2021-03-31 18:28:29 | <olle> | tomsmeding: oh? |
| 2021-03-31 18:28:34 | <tomsmeding> | "Is there a consensus in Haskell community of " -- no |
| 2021-03-31 18:28:40 | <olle> | ^^ |
| 2021-03-31 18:28:49 | <Uniaika> | olle: my own consensus is that MonadError is great |
| 2021-03-31 18:28:56 | <Uniaika> | if you handle business data-types |
| 2021-03-31 18:29:05 | <tomsmeding> | well that may be overstating the case, but there are many different opinions about many different things |
| 2021-03-31 18:29:09 | <Uniaika> | when it comes to file-system, network, etc, then Exceptions are a better way to go |
| 2021-03-31 18:29:16 | <olle> | OK |
| 2021-03-31 18:31:01 | <tomsmeding> | new question: if I define a local library with the name 'foo' in my cabal.project, will that shadow any 'foo' from hackage in the dependencies of my dependencies? |
| 2021-03-31 18:31:12 | <tomsmeding> | (foo = snap-core >:D) |
| 2021-03-31 18:32:00 | → | argento joins (~argent0@191.81.225.82) |
| 2021-03-31 18:32:00 | → | acidjnk_new joins (~acidjnk@p200300d0c72b95486cfd1d07fe22841d.dip0.t-ipconnect.de) |
| 2021-03-31 18:33:54 | <geekosaur> | I think it's supposed to. It did here, at least |
| 2021-03-31 18:34:05 | <tomsmeding> | thanks! |
| 2021-03-31 18:35:01 | <tomsmeding> | reason why I'm asking: ircbrowse is crashing, like, often |
| 2021-03-31 18:35:55 | <tomsmeding> | like, a total of 7700 times in the past two months |
| 2021-03-31 18:36:04 | × | viluon quits (uid453725@gateway/web/irccloud.com/x-uyquvhnfkmiqllxw) (Quit: Connection closed for inactivity) |
| 2021-03-31 18:36:18 | → | molehillish joins (~molehilli@2600:8800:8d06:1800:49e2:dd02:cb68:846) |
| 2021-03-31 18:36:19 | <geekosaur> | I had wondered why 502 Bad Gateway was so relatively common… |
| 2021-03-31 18:36:35 | <tomsmeding> | >.> |
| 2021-03-31 18:37:05 | <geekosaur> | I think most of the time that would show up as a link time error, though, not as a crash. At least if it exposes any of the ABI |
| 2021-03-31 18:37:06 | <tomsmeding> | for some reason I never looked in my core dump log; I assumed it was an uncommon occurrence |
| 2021-03-31 18:37:14 | <tomsmeding> | link time error? |
| 2021-03-31 18:38:02 | <geekosaur> | either duplicate symbols, or if it exposes any of the ABI at Haskell level then a compile time error showing two apparently identical types as not matching |
| 2021-03-31 18:38:06 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 240 seconds) |
| 2021-03-31 18:38:36 | <tomsmeding> | I'm talking about a segfault in C that comes seems to come from a null pointer dereference |
| 2021-03-31 18:38:56 | <tomsmeding> | and I'm not trusting that unsafeUseAsCString, but maybe I'm mistaken |
| 2021-03-31 18:39:09 | <tomsmeding> | (the crash seems to always be in that C function c_parse_http_time) |
| 2021-03-31 18:39:40 | × | conal quits (~conal@64.71.133.70) (Read error: Connection reset by peer) |
| 2021-03-31 18:39:50 | <geekosaur> | that doesn't sound like missing \0, to be honest |
| 2021-03-31 18:39:59 | <geekosaur> | don't confuse \NUL with null pointers |
| 2021-03-31 18:40:03 | × | Alleria__ quits (~textual@mskresolve-a.mskcc.org) (Ping timeout: 268 seconds) |
| 2021-03-31 18:40:08 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 2021-03-31 18:40:10 | → | Sgeo_ joins (~Sgeo@ool-18b98aa4.dyn.optonline.net) |
| 2021-03-31 18:40:19 | <tomsmeding> | very true |
| 2021-03-31 18:40:27 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2021-03-31 18:40:45 | <tomsmeding> | can unsafeUseAsCString every provide a null pointer? |
| 2021-03-31 18:40:47 | × | molehillish quits (~molehilli@2600:8800:8d06:1800:49e2:dd02:cb68:846) (Ping timeout: 258 seconds) |
| 2021-03-31 18:41:33 | <geekosaur> | I don't think so, unless maybe it was fed one |
| 2021-03-31 18:41:40 | × | lawid_ quits (~quassel@ipservice-092-219-052-236.092.219.pools.vodafone-ip.de) (Ping timeout: 252 seconds) |
| 2021-03-31 18:42:17 | <tomsmeding> | I'm going to instrument the C function anyway |
| 2021-03-31 18:42:39 | <tomsmeding> | the coredumps tell me precious little without going through the pages of assembly listing in strptime() |
| 2021-03-31 18:42:45 | → | lawid joins (~quassel@dslb-178-005-075-217.178.005.pools.vodafone-ip.de) |
| 2021-03-31 18:42:54 | <geekosaur> | but it shouldn't be possible to feed it one since you're feeding it a ByteArray# allocated by the bytestring package, and if that's generating null pointers I'd expect a lot more to break |
| 2021-03-31 18:43:45 | × | Sgeo__ quits (~Sgeo@ool-18b98aa4.dyn.optonline.net) (Ping timeout: 268 seconds) |
| 2021-03-31 18:44:14 | <geekosaur> | hm. you may need to initialize the locale |
| 2021-03-31 18:44:40 | → | conal joins (~conal@64.71.133.70) |
| 2021-03-31 18:45:06 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 240 seconds) |
| 2021-03-31 18:46:20 | → | howdoi joins (uid224@gateway/web/irccloud.com/x-qufpuczcdkidmfvl) |
| 2021-03-31 18:47:36 | <tomsmeding> | running the function on sane input from 'cabal repl' works on my server, so I'm not sure it's an environment problem |
| 2021-03-31 18:50:13 | → | Alleria joins (~textual@zrcout.mskcc.org) |
| 2021-03-31 18:50:19 | → | _fcntl joins (~jaroslawj@185.234.208.208.r.toneticgroup.pl) |
| 2021-03-31 18:50:21 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2021-03-31 18:50:37 | Alleria | is now known as Guest90523 |
| 2021-03-31 18:51:32 | → | lampowner joins (~xblow@2a02:2168:b03:3b74::1) |
| 2021-03-31 18:53:52 | <tomsmeding> | (in any case it seems my server's system locale is C.UTF-8) |
| 2021-03-31 18:55:08 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2021-03-31 18:55:26 | geekosaur | wonders if that's the problem. it may not be fully set up, since that's a somewhat weird-looking locale |
| 2021-03-31 18:56:08 | <geekosaur> | I'd use either C or en_US.UTF-8, not a combination of the two that might be half specified or something |
| 2021-03-31 18:56:18 | tomsmeding | doesn't remember changing it from the ubuntu default |
| 2021-03-31 18:57:22 | <tomsmeding> | then again, a segfault in an http time parsing function that only occurs sometimes? |
| 2021-03-31 18:57:28 | <geekosaur> | /etc/default/locale here is en_US.UTF-8 fwiw |
| 2021-03-31 18:57:33 | <tomsmeding> | s/segfault/null pointer dereference/ |
| 2021-03-31 18:57:54 | <geekosaur> | I dunno, I'm spitballing since I don't have enough information |
| 2021-03-31 18:58:19 | <tomsmeding> | thanks anyway :) |
| 2021-03-31 18:58:28 | <tomsmeding> | I'm going to try some instrumentation |
| 2021-03-31 18:59:00 | <geekosaur> | and strptime() uses locale stuff heavily |
| 2021-03-31 18:59:49 | <tomsmeding> | hm good point |
| 2021-03-31 19:01:01 | × | vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving) |
| 2021-03-31 19:01:10 | <tomsmeding> | changed locale to en_US.UTF-8 and restarted ircbrowse, let's first see if this fixes things |
| 2021-03-31 19:01:56 | → | Erutuon_ joins (~Erutuon@97-116-27-119.mpls.qwest.net) |
| 2021-03-31 19:02:41 | × | lawid quits (~quassel@dslb-178-005-075-217.178.005.pools.vodafone-ip.de) (Ping timeout: 265 seconds) |
| 2021-03-31 19:02:58 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 2021-03-31 19:05:20 | → | dpl_ joins (~dpl@77.121.78.163) |
| 2021-03-31 19:07:10 | × | sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937) |
| 2021-03-31 19:12:46 | × | mkDoku quits (~TheMule@aftr-37-201-195-154.unity-media.net) (Ping timeout: 240 seconds) |
| 2021-03-31 19:14:09 | × | aarvar quits (~foewfoiew@2601:602:a080:fa0:906c:b23f:e55d:e8aa) (Ping timeout: 245 seconds) |
| 2021-03-31 19:14:54 | <_fcntl> | wanted to play with ghc hacking, followed docs, bet on docker and got image that is based on project which is 1.5yo... does anyone use docker for ghc hacking? |
| 2021-03-31 19:17:29 | ← | olle parts (~olle@i5E8666BD.versanet.de) () |
| 2021-03-31 19:18:18 | <Clint> | what? |
| 2021-03-31 19:19:06 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
All times are in UTC.