[Samba] Conversion error: Illegal multibyte sequence

Jeremy Allison jra at samba.org
Thu Sep 5 15:34:59 MDT 2013


On Thu, Sep 05, 2013 at 11:28:14PM +0200, Laurent Blume wrote:
> 
> I'm not sure I'm still good at adding printf("DEBUG\n") lines around :-)
> so I tried my hand with dtrace for a start.
> 
> Here are some examples of what it returns when looking at smb_iconv()
> while I opened the directory and listed the content:
> 
>   0  61539                  smb_iconv:entry
>   0  88770     convert_string_talloc:return
>   0  88786          push_ucs2_talloc:return
>   0  69264                 talloc_tos:entry
>   0  88535                talloc_tos:return
>   0  69516           push_ucs2_talloc:entry
>   0  69500      convert_string_talloc:entry
>   0  69497       lazy_initialize_conv:entry
>   0  88767      lazy_initialize_conv:return
>   0  61537      get_iconv_convenience:entry
>   0  61585     get_iconv_convenience:return
>   0  69852            get_conv_handle:entry
>   0  89122           get_conv_handle:return
>   0  82016            _talloc_realloc:entry
>   0  81992          talloc_alloc_pool:entry
>   0  81991    talloc_pool_objectcount:entry
>   0 101091   talloc_pool_objectcount:return
>   0 101092         talloc_alloc_pool:return
>   0 101116           _talloc_realloc:return
> 
> 
>   0  61539                  smb_iconv:entry
>   0  88770     convert_string_talloc:return
>   0  88786          push_ucs2_talloc:return
>   0  69821                 strupper_w:entry
>   0  69840                  toupper_w:entry
>   0  69846                  toupper_m:entry
>   0  89116                 toupper_m:return
>   0  89110                 toupper_w:return
>   0  69840                  toupper_w:entry
>   0  69846                  toupper_m:entry
>   0  75259                    toupper:entry
>   0  94407                   toupper:return
>   0  89116                 toupper_m:return
>   0  89110                 toupper_w:return
>   0  69840                  toupper_w:entry
>   0  69846                  toupper_m:entry
>   0  75259                    toupper:entry
>   0  94407                   toupper:return
>   0  89116                 toupper_m:return
>   0  89110                 toupper_w:return
>   0  89091                strupper_w:return
>   0  69499             convert_string:entry
>   0  69497       lazy_initialize_conv:entry
>   0  88767      lazy_initialize_conv:return
>   0  61537      get_iconv_convenience:entry
>   0  61585     get_iconv_convenience:return
>   0  69852            get_conv_handle:entry
>   0  89122           get_conv_handle:return
> 
> Does it make sense? There are some longer examples, but the only
> function call containing iconv is get_iconv_convenience().

No, it doesn't make sense. smb_iconv() vectors
through pull and push function pointers that
do the actual conversion - that's where the
errno is coming from. That's why you need
debug statements - you know it's going into
smb_iconv() but you don't know where it's
going from there.

Jeremy.


More information about the samba mailing list