❯ cabal new-run
Up to date
create
... connection used
destroy
resource-pool-error(61409,0x70000394e000) malloc: *** error for object 0xc000000000000000: pointer being freed was not allocated
resource-pool-error(61409,0x70000394e000) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort cabal new-run
on macOS
単純に disconnect を並列に呼んだらだめ。
https://github.com/hdbc/hdbc-postgresql/blob/master/hdbc-postgresql-helper.c#L31-L35
おそらく reaper の処理と purgeLocalPool が並列に呼ばれている?
(もともとのこのコードは threaded をつけ忘れていて気づかなかった。GC のスレッドは別なのでたまに起きていた)