Logs: liberachat/#haskell
| 2021-06-04 10:28:54 | <yahb> | dminuoso: |
| 2021-06-04 10:29:01 | <dminuoso> | % Data.List.foldl' (+) 0 xs |
| 2021-06-04 10:29:04 | <yahb> | dminuoso: *** Exception: heap overflow |
| 2021-06-04 10:29:07 | <dminuoso> | % :i Bool |
| 2021-06-04 10:29:08 | <yahb> | dminuoso: *** Exception: heap overflow |
| 2021-06-04 10:29:10 | <dminuoso> | % :i ala |
| 2021-06-04 10:29:10 | <yahb> | dminuoso: ala :: (Functor f, Rewrapping s t) => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> f s) -> f (Unwrapped s) -- Defined in `Control.Lens.Wrapped' |
| 2021-06-04 10:29:13 | <boxscape> | hm |
| 2021-06-04 10:29:14 | <boxscape> | okay |
| 2021-06-04 10:29:43 | <absence> | pja: i don't think the blog addresses my particular situation, it seems more focused on throwing exceptions within the ffi thread, and not throwing them to other threads outside. i don't think hs_exit is involved here, but your suggestion about the thread being blocked waiting for ffi makes sense, and could result in the deadlock. i'm not sure i understand why the c code can't continue to run after the |
| 2021-06-04 10:29:45 | <dminuoso> | boxscape: It seems as if `:i` on non-types is acceptable |
| 2021-06-04 10:29:48 | <dminuoso> | % :i Functor |
| 2021-06-04 10:29:48 | <yahb> | dminuoso: *** Exception: heap overflow |
| 2021-06-04 10:29:49 | <absence> | throwTo though |
| 2021-06-04 10:30:09 | <boxscape> | dminuoso I'm surprised that the first expression produced a heap overflow at all without setting +RTS -M20m like in the ticket |
| 2021-06-04 10:30:18 | <dminuoso> | why? |
| 2021-06-04 10:30:40 | <boxscape> | because it doesn't do that for me locally, and it doesn't seem like [1..10^6] needs that much memory |
| 2021-06-04 10:31:28 | <dminuoso> | boxscape: Who ways it produces a heap overflow without setting it? |
| 2021-06-04 10:31:39 | <dminuoso> | I dont know how yahb is configured |
| 2021-06-04 10:32:14 | <boxscape> | hm that is true, I guess I just would have expected it to be configured with a bit more memory, but I don't have a particularly good reason for that |
| 2021-06-04 10:32:33 | <dminuoso> | It's at least reasonable to assume that yahb is severely constrained in terms of resources. |
| 2021-06-04 10:32:37 | <boxscape> | yeah |
| 2021-06-04 10:32:37 | <dminuoso> | Someone has to pay for that machine. :) |
| 2021-06-04 10:32:54 | <absence> | pja: i.e. if i do myThreadId from within the callback, and throw to that id, i do get a forceful shutdown and the "too many hs_exit()s" warning mentioned in the blog |
| 2021-06-04 10:34:44 | × | chomwitt quits (~Pitsikoko@athedsl-20549.home.otenet.gr) (Ping timeout: 252 seconds) |
| 2021-06-04 10:35:54 | → | ikex joins (~ash@user/ikex) |
| 2021-06-04 10:36:23 | × | peterhil quits (~peterhil@dsl-hkibng32-54f849-252.dhcp.inet.fi) (Ping timeout: 252 seconds) |
| 2021-06-04 10:36:29 | <pja> | IIRC, if an FFI C call is marked as safe, it gets run in it’s own thread. |
| 2021-06-04 10:36:47 | <pja> | but don’t quote me on that... |
| 2021-06-04 10:37:04 | <pja> | (s/it’s/its/) |
| 2021-06-04 10:44:27 | × | v01d4lph4 quits (~v01d4lph4@user/v01d4lph4) (Remote host closed the connection) |
| 2021-06-04 10:44:34 | <pja> | so if you throw to the running thread, then that will cause that thread to exit, which in turn allows the main thread to exit. That seems a plausible explanation for the behaviour you’re seeing at least! |
| 2021-06-04 10:45:09 | <dminuoso> | pja: Without touching on the rest, its irrespective of safety. |
| 2021-06-04 10:45:34 | <dminuoso> | It's described in "Extending the Haskell Foreign Function Interface with Concurrency" |
| 2021-06-04 10:48:02 | <dminuoso> | Note in particualr |
| 2021-06-04 10:48:24 | <dminuoso> | `Foreign export. Invoking a function declared with foreign export creates a new Haskell thread which is bound to theOS thread making the call" |
| 2021-06-04 10:48:43 | <dminuoso> | absence: Try using runInBoundThread. |
| 2021-06-04 10:49:55 | × | dunkeln quits (~dunkeln@94.129.65.28) (Ping timeout: 245 seconds) |
| 2021-06-04 10:51:49 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 2021-06-04 10:52:24 | <dminuoso> | Or see whether `myThreadId` inside `myHaskellFunction` produces a different thread id, I think it should. |
| 2021-06-04 10:56:39 | × | pe200012 quits (~pe200012@119.131.208.84) (Remote host closed the connection) |
| 2021-06-04 10:57:11 | → | pe200012 joins (~pe200012@218.107.17.245) |
| 2021-06-04 10:58:24 | → | zeenk joins (~zeenk@2a02:2f04:a310:b600:b098:bf18:df4d:4c41) |
| 2021-06-04 11:00:40 | <boxscape> | % GHC.RTS.Flags.maxHeapSize . GHC.RTS.Flags.gcFlags <$> GHC.RTS.Flags.getRTSFlags -- dminuoso FWIW the answer yahb gives is consistent with -M200m |
| 2021-06-04 11:00:40 | <yahb> | boxscape: 51200 |
| 2021-06-04 11:02:00 | × | yd502__ quits (~yd502@180.168.212.6) (Ping timeout: 245 seconds) |
| 2021-06-04 11:05:20 | <absence> | pja: if i catch the exception in the main thread, it still hangs, and the exception handler isn't invoked, so it's not related to the main thread exiting at least |
| 2021-06-04 11:08:23 | <absence> | dminuoso: yes, the threadid is different. runInBoundThread doesn't change anything |
| 2021-06-04 11:13:51 | × | guest63`` quits (~user@49.5.6.87) (Quit: ERC (IRC client for Emacs 27.1)) |
| 2021-06-04 11:14:04 | → | ddellaco_ joins (~ddellacos@89.46.62.130) |
| 2021-06-04 11:15:11 | <dminuoso> | How are you wrapping it with runInBoundThread? |
| 2021-06-04 11:15:23 | <dminuoso> | Oh, actually this is not what bound thread is about. Mmmm. |
| 2021-06-04 11:15:27 | <dminuoso> | bound thread is about the OS thread |
| 2021-06-04 11:15:31 | <dminuoso> | not the haskell thread |
| 2021-06-04 11:16:28 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 2021-06-04 11:18:44 | × | ddellaco_ quits (~ddellacos@89.46.62.130) (Ping timeout: 252 seconds) |
| 2021-06-04 11:20:23 | <absence> | according to the ghc user guide, " Normally when the target of a throwTo is involved in a foreign call, the exception is not raised until the call returns, and in the meantime the caller is blocked." so i guess the result is that the thread is blocking itself |
| 2021-06-04 11:21:14 | <absence> | i had hoped the callback could continue to run, and the async exception be raised when it returns, but i guess that's now how it works |
| 2021-06-04 11:23:55 | <absence> | not* |
| 2021-06-04 11:25:39 | × | _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection) |
| 2021-06-04 11:28:20 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:2819:e0f3:7100:f98e) |
| 2021-06-04 11:32:12 | <pja> | Yes, I think the thread is “self-blocked”. |
| 2021-06-04 11:32:31 | <pja> | but I’m not that familiar with this part of the runtime. |
| 2021-06-04 11:32:34 | → | ddellaco_ joins (~ddellacos@86.106.121.100) |
| 2021-06-04 11:33:15 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:2819:e0f3:7100:f98e) (Ping timeout: 268 seconds) |
| 2021-06-04 11:34:47 | → | WorldSEnder joins (~martin@88.215.103.12) |
| 2021-06-04 11:34:50 | → | machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca) |
| 2021-06-04 11:35:14 | × | node-sh quits (~node-sh@2401:4900:3b29:78ba:5b23:3841:af60:74fd) (Ping timeout: 272 seconds) |
| 2021-06-04 11:37:30 | × | ddellaco_ quits (~ddellacos@86.106.121.100) (Ping timeout: 264 seconds) |
| 2021-06-04 11:37:48 | → | ixlun joins (~matthew@109.249.184.235) |
| 2021-06-04 11:37:51 | → | ixlun- joins (~matthew@109.249.184.235) |
| 2021-06-04 11:41:02 | → | node-sh joins (~node-sh@2401:4900:3b29:78ba:5b23:3841:af60:74fd) |
| 2021-06-04 11:45:05 | → | Guest28 joins (~Guest28@194.68.222.71) |
| 2021-06-04 11:45:44 | × | wallymathieu quits (~wallymath@81-234-151-21-no94.tbcn.telia.com) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-06-04 11:46:36 | ← | Guest28 parts (~Guest28@194.68.222.71) () |
| 2021-06-04 11:49:11 | → | ddellaco_ joins (~ddellacos@86.106.121.114) |
| 2021-06-04 11:49:40 | → | ft joins (~ft@shell.chaostreff-dortmund.de) |
| 2021-06-04 11:52:19 | × | ft quits (~ft@shell.chaostreff-dortmund.de) (Client Quit) |
| 2021-06-04 11:52:33 | → | ft joins (~ft@shell.chaostreff-dortmund.de) |
| 2021-06-04 11:54:07 | → | prite joins (~pritam@user/pritambaral) |
| 2021-06-04 11:54:17 | × | ddellaco_ quits (~ddellacos@86.106.121.114) (Ping timeout: 272 seconds) |
| 2021-06-04 11:54:54 | × | ikex quits (~ash@user/ikex) (Ping timeout: 264 seconds) |
| 2021-06-04 11:56:14 | × | eight quits (~eight@user/eight) (Quit: rebooting) |
| 2021-06-04 11:56:33 | → | ikex joins (~ash@user/ikex) |
| 2021-06-04 11:56:43 | → | eight joins (~eight@user/eight) |
| 2021-06-04 11:57:01 | <maerwald> | how do you pass gcc options to a package in stack.yaml |
| 2021-06-04 11:59:47 | → | dhil joins (~dhil@195.213.192.47) |
| 2021-06-04 12:00:34 | × | ru0mad quits (~ru0mad@82-64-17-144.subs.proxad.net) (Ping timeout: 272 seconds) |
| 2021-06-04 12:00:36 | <Hecate> | maerwald: I don't think you can |
| 2021-06-04 12:00:51 | <Hecate> | I think there is no '--gcc-option' equivalent |
| 2021-06-04 12:01:07 | → | smitop joins (uid328768@user/smitop) |
| 2021-06-04 12:06:05 | × | ft quits (~ft@shell.chaostreff-dortmund.de) (Quit: leaving) |
| 2021-06-04 12:06:14 | → | ft joins (~ft@shell.chaostreff-dortmund.de) |
| 2021-06-04 12:08:57 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-06-04 12:10:15 | × | kw quits (~user@152.1.137.158) (Remote host closed the connection) |
| 2021-06-04 12:10:25 | → | mccoyb joins (~textual@2601:182:d000:3b50:6d20:ecfa:c38a:3ddb) |
| 2021-06-04 12:10:42 | → | fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
| 2021-06-04 12:14:55 | × | fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 245 seconds) |
| 2021-06-04 12:16:32 | → | Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) |
| 2021-06-04 12:20:40 | → | fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
All times are in UTC.