Fix possible deadlock upon `encoding-error' in `open-input-string'.
authorLudovic Courtès <ludo@gnu.org>
Wed, 20 Jun 2012 20:56:11 +0000 (22:56 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 20 Jun 2012 20:56:11 +0000 (22:56 +0200)
commit03fcf93bff9f02a3d12ab86be4e67b996310aad4
tree5ba8c9d5f477b71e58c3f4386604db0b6665d86d
parentecb48dccbac6b8fdd969f50a23351ef7f4b91ce5
Fix possible deadlock upon `encoding-error' in `open-input-string'.

Partly addresses <http://bugs.gnu.org/11197>.

* libguile/strports.c (scm_mkstrport): Call `scm_port_non_buffer', set
  Z's cell type and stream, and release `scm_i_port_table_mutex' early.
  Reacquire `scm_i_port_table_mutex' once BUF, C_BUF, and STR_LEN are
  initialized.

* test-suite/tests/ports.test ("string ports")["encoding failure leads
  to exception"]: New test.
libguile/strports.c
test-suite/tests/ports.test