[Python-Dev] bsddb3 imported
Tim Peters
tim.one@comcast.net
Sat, 23 Nov 2002 13:26:06 -0500
[Tim]
> Not here. In a debug build, it [test_ucn] reliably crashes in the
> bowels of strcpy.
> My guess:
>
> strcpy(buffer, hangul_syllables[L][0]);
>
> can't always work because the hangul_syllables array contains
> NULL pointers in some entries instead of empty strings. It blows
> up for me when L is pointing at the
>
> { 0, "YI", "S" },
>
> entry. I'm proceeding on "a fix" to see whether s/0/""/g cures it.
[Martin]
> Are you sure you are up-to-date?
I was at the time.
> For that to happen, L must be 19.
It was.
> Now, L is SIndex / NCount, where NCount is 588. So SIndex must be
> atleast (588*19 =) 11172 (= SCount). However, SIndex is code-SBase,
> so code must be at least SBase+SCount. In that case, the entire if
> statement should not be executed, because the if statement reads
>
> if (SBase <= code && code < SBase+SCount) {
>
> It so happens that the fields which are NULL are never accessed.
It was at the time. It would be a stretch to believe I pasted that line in
by blind luck <wink> -- it's what the debugger was pointing at when the
crash occurred, and hangul_syllables[L][0] was NULL at the time. Maybe
that's been "fixed" in more than one way by now.