[kanji.sljfaq.org] Android bad inputs

Affichage de 14 messages sur 4
[kanji.sljfaq.org] Android bad inputs Ben Bullock 17/03/14 03:20
During my recent extended debugging I have been watching the server log closely, and I'm getting bad inputs from Android WWWJDIC. An example follows:

[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] [Mon Mar 17 10:12:33 2014] /home/public/kanji-0.016.cgi {PID:45786} [client 116.59.16.159] /usr/home/ben/kanji16/Recog-Character/character.c.in:1020: Call 'character_count_points_36 (p, & n_points)' failed with status '13': odd number of coordinates in input
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] [Mon Mar 17 10:12:33 2014] /home/public/kanji-0.016.cgi {PID:45786} [client 116.59.16.159] handwritten.c:144: Bad input in character routine: odd number of coordinates in input
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] [Mon Mar 17 10:12:33 2014] /home/public/kanji-0.016.cgi {PID:45786} [client 116.59.16.159] handwritten.c:145: --- Input follows:  1si73vho50hk6fhm86hna2hrc3hvdti1f9i2geidgmibgli8gli7gli7
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] 6m8k728v7ga67rbq88ci8be18kgg8xj895n09dop9hru9nua9tws9wya9wz59uzo9tzu9pzs9czl8sz687ym84yk84yk
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] 4csn4dsg4lrz54rq6vrg8br5a7qvbxqjdsqdf7q8g8q9glqcgmqegmqe
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] j3j4izinj0iljiihkjiglxikndiqpfj6r7jgszjstgjxtjjztmk4rskjrskj
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] nfkbnpm3nlnfnfp6n8qmmpt8n0ujmzvvmtxcmtxhmtxh
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] gawsh0wji8wnjix3ksxan1xxoryarvyttnz5tr10jtr10j
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142]
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142]
[Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] ---

The user is using this:

[110342@kanji] {10:13 58} public 509 $ grep 116.59.16.159 /home/logs/access_log
116.59.16.159 - - [17/Mar/2014:10:12:33 +0000] "POST /kanji-0.016.cgi HTTP/1.0" 200 2 "-" "Android-WWWJDIC/2.3.5"

The other errors I have also had the 2.3.5 version of the software. Can you please put some asserts in the code to make absolutely sure you aren't sending bad inputs. Thanks.

Re: [kanji.sljfaq.org] Android bad inputs nick 17/03/14 06:32
Hi,

On Mon, Mar 17, 2014 at 7:20 PM, Ben Bullock <benkasmi...@gmail.com> wrote:
> During my recent extended debugging I have been watching the server log
> closely, and I'm getting bad inputs from Android WWWJDIC. An example
> follows:
>
> [Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] [Mon Mar 17
> 10:12:33 2014] /home/public/kanji-0.016.cgi {PID:45786} [client
> 116.59.16.159] /usr/home/ben/kanji16/Recog-Character/character.c.in:1020:
> Call 'character_count_points_36 (p, & n_points)' failed with status '13':
> odd number of coordinates in input

How many of those do you have? It shouldn't really happen, unless
the device is sending weird/unbalanced touch events.

>
> The other errors I have also had the 2.3.5 version of the software. Can you
> please put some asserts in the code to make absolutely sure you aren't
> sending bad inputs. Thanks.
>

I haven't changed the handwriting code for ages, so it's not something
introduced in the latest version. I'll look into it and add some safeguards,
but it looks device related.
Re: [kanji.sljfaq.org] Android bad inputs Ben Bullock 17/03/14 07:43
On 17 March 2014 22:32, Nikolay Elenkov <nikolay...@gmail.com> wrote:
> Hi,
>
> On Mon, Mar 17, 2014 at 7:20 PM, Ben Bullock <benkasmi...@gmail.com> wrote:
>> During my recent extended debugging I have been watching the server log
>> closely, and I'm getting bad inputs from Android WWWJDIC. An example
>> follows:
>>
>> [Mon Mar 17 10:12:33 2014] [error] [client 172.17.0.142] [Mon Mar 17
>> 10:12:33 2014] /home/public/kanji-0.016.cgi {PID:45786} [client
>> 116.59.16.159] /usr/home/ben/kanji16/Recog-Character/character.c.in:1020:
>> Call 'character_count_points_36 (p, & n_points)' failed with status '13':
>> odd number of coordinates in input
>
> How many of those do you have? It shouldn't really happen, unless
> the device is sending weird/unbalanced touch events.

Surely the events are processed in your system into the format before
being sent out? If the device is sending bad inputs to your system
then it's strange to just send the bad inputs on to my system.

>> The other errors I have also had the 2.3.5 version of the software. Can you
>> please put some asserts in the code to make absolutely sure you aren't
>> sending bad inputs. Thanks.
>>
>
> I haven't changed the handwriting code for ages, so it's not something
> introduced in the latest version. I'll look into it and add some safeguards,
> but it looks device related.

I don't know how many there are each day because I have only just
noticed them. But regardless of how many there are, you need to wrap
your sender with some assert statement that the input is meaningful.
It should not be sending odd number of coordinates. You'll have to
deal with the device problems within your system rather than sending
them to me.
Re: [kanji.sljfaq.org] Android bad inputs nick 18/03/14 08:26
On Mon, Mar 17, 2014 at 11:59 PM, Nikolay Elenkov
<nikolay...@gmail.com> wrote:
> On Mon, Mar 17, 2014 at 11:43 PM, Ben Bullock
> <benkasmi...@gmail.com> wrote:
>
>>
>> I don't know how many there are each day because I have only just
>> noticed them. But regardless of how many there are, you need to wrap
>> your sender with some assert statement that the input is meaningful.
>> It should not be sending odd number of coordinates. You'll have to
>> deal with the device problems within your system rather than sending
>> them to me.
>
> Yes, sure. I'll upload an updated version that deals with this.

I've released WWWJDIC for Android 2.3.6 which checks and normalized
the number of points before sending. The error shouldn't happen with
2.3.6 but it might take some time for people to update.

Let me know if you see any errors caused by 2.3.6.