lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] Commented: (SOLR-1091) "phps" (serialized PHP) writer produces invalid output
Date Thu, 27 Aug 2009 00:00:59 GMT


Yonik Seeley commented on SOLR-1091:

Hmmm, I thought this might be a decoding error.  Instead it perhaps looks like the JVM not
handling UTF8 encoding the same as Jetty.

As one can see by this:
$ curl --trace - 'http://localhost:8983/solr/select?q=abcdef&a=%ED%AF%80%ED%B1%B8&wt=phps'

The ascii portion of the dump looks like:

So the JVM is telling us that the string will serialize to 4 bytes, and when Jetty actually
does the serialization, it comes out to 6.

Java's String.getBytes() does have the following warning:
     * <p> The behavior of this method when this string cannot be encoded in
     * the given charset is unspecified.

> "phps" (serialized PHP) writer produces invalid output
> ------------------------------------------------------
>                 Key: SOLR-1091
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>         Environment: Sun JRE 1.6.0 on Centos 5
>            Reporter: frank farmer
>            Priority: Minor
>             Fix For: 1.4
> The serialized PHP output writer can outputs invalid string lengths for certain (unusual)
input values.  Specifically, I had a document containing the following 6 byte character sequence:
> I was able to create a document in the index containing this value without issue; however,
when fetching the document back out using the serialized PHP writer, it returns a string like
the following:
> s:4:"􀁸";
> Note that the string length specified is 4, while the string is actually 6 bytes long.
> When using PHP's native serialize() function, it correctly sets the length to 6:
> # php -r 'var_dump(serialize("\xED\xAF\x80\xED\xB1\xB8"));'
> string(13) "s:6:"􀁸";"
> The "wt=php" writer, which produces output to be parsed with eval(), doesn't have any
trouble with this string.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message