[ruby-core:95578] [Ruby master Bug#16283] A fork in transaction of PG cause Segmentation fault

From: doloopwhile@...
Date: 2019-10-29 03:55:36 UTC
List: ruby-core #95578
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>

In This Thread

Prev Next