On Sun, 20 Oct 2013 20:27:23 +0200 Ulrich Spörlein wrote:
> ever since that iconv thing replaced the ports version, I run into
> trouble with several ports that I have installed on a -CURRENT (now
> stable/10 system).
> 
> These are not compile-time errors, but crashes or limited functionality
> where I blame iconv :)
> 
> 1. www/newsbeuter crashes during startup, somewhere in the stfl code
> that deals with wide char functions.
> 
> 2. devel/git: when using git-svn, it'll segfault in the perl code, not
> sure how to get a backtrace here as gdb's follow-fork doesn't quite
> work.
> 
> 3. multimedia/xbmc is no longer able to decode unicode filenames and
> other things are broken. It spews an endless stream of 
> 19:36:00 T:34594644992   ERROR: convert_checked iconv_open() failed from
> WCHAR_T to UTF-8, errno=22(Invalid argument)
> 19:36:00 T:34594644992   ERROR: convert_checked iconv_open() failed from
> UTF-8 to WCHAR_T, errno=22(Invalid argument)
> 19:37:00 T:34594644992   ERROR: Previous line repeats 9656 times.
> 
> Is my system hexed? I've rebuilt the ports/packages a dozen times now.
> Am I seeing ghosts?

Can you try the attached patch?  It includes the one from
http://www.freebsd.org/cgi/query-pr.cgi?pr=182994
Index: lib/libc/iconv/citrus_mapper.c
===================================================================
--- lib/libc/iconv/citrus_mapper.c      (revision 256803)
+++ lib/libc/iconv/citrus_mapper.c      (working copy)
@@ -341,14 +341,15 @@ _citrus_mapper_open(struct _citrus_mappe
        /* open mapper */
        UNLOCK(&cm_lock);
        ret = mapper_open(ma, &cm, module, variable);
-       WLOCK(&cm_lock);
        if (ret)
-               goto quit;
+               goto quit_unlocked;
+       WLOCK(&cm_lock);
        cm->cm_key = strdup(mapname);
        if (cm->cm_key == NULL) {
                ret = errno;
+               UNLOCK(&cm_lock);
                _mapper_close(cm);
-               goto quit;      
+               goto quit_unlocked;
        }
 
        /* insert to the cache */
@@ -359,7 +360,7 @@ _citrus_mapper_open(struct _citrus_mappe
        ret = 0;
 quit:
        UNLOCK(&cm_lock);
-
+quit_unlocked:
        return (ret);
 }
 
@@ -381,7 +382,9 @@ _citrus_mapper_close(struct _citrus_mapp
                        _CITRUS_HASH_REMOVE(cm, cm_entry);
                        free(cm->cm_key);
                }
+               UNLOCK(&cm_lock);
                mapper_close(cm);
+               return;
 quit:
                UNLOCK(&cm_lock);
        }

Attachment: signature.asc
Description: PGP signature

Reply via email to