From: "Glenn Michaels" <gmichaels@Safe-mail.net>
To: 18065@debbugs.gnu.org
Subject: bug#18065: guile hangs if strerror is called with invalid (non-int) argument
Date: Sun, 20 Jul 2014 11:25:11 -0400 [thread overview]
Message-ID: <N1R-TlUzyvhY6d@Safe-mail.net> (raw)
Calling strerror with a non-integer argument causes guile to hang.
e.g.:
(strerror 1.5)
It's a locking issue, which is solved by the following trivial patch:
--- a/libguile/error.c
+++ b/libguile/error.c
@@ -121,10 +121,12 @@ SCM_DEFINE (scm_strerror, "strerror", 1, 0, 0,
#define FUNC_NAME s_scm_strerror
{
SCM ret;
+ int errnum;
scm_dynwind_begin (0);
+ errnum = scm_to_int (err);
scm_i_dynwind_pthread_mutex_lock (&scm_i_misc_mutex);
- ret = scm_from_locale_string (strerror (scm_to_int (err)));
+ ret = scm_from_locale_string (strerror (errnum));
scm_dynwind_end ();
return ret;
next reply other threads:[~2014-07-20 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-20 15:25 Glenn Michaels [this message]
2014-08-01 19:47 ` bug#18065: guile hangs if strerror is called with invalid (non-int) argument Ian Price
2014-11-12 6:05 ` Mark H Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=N1R-TlUzyvhY6d@Safe-mail.net \
--to=gmichaels@safe-mail.net \
--cc=18065@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).