Issue #16283 has been reported by doloopwhile / gmail.com ( ).

----------------------------------------
Bug #16283: A fork in transaction of PG cause Segmentation fault
https://bugs.ruby-lang.org/issues/16283

* Author: doloopwhile / gmail.com ( )
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Call Kernel#fork in transaction of Postgres and call some Socket method in fork's block, then ruby on the child process abort with segmentation fault.

Conceptual code:

```
MGModel.connection.transaction do

  # Do something

  fork do
    Socket.gethostbyname('localhost') # <- Segmentation fault.
  end
end
```

Expected behavior: The child process successfully exists or raises exception.

Please see attached files for Reproduction code and full error log.


---Files--------------------------------
bug.zip (1.51 KB)
stderr.txt (97.3 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>