Comment #19 on issue 15261 by [email protected]: Crash in  
history::TextDatabase::GetTextMatches
http://code.google.com/p/chromium/issues/detail?id=15261

Issue 19124 might be relevant to this one.

I dug into issue 19124 a little and found a very interesting thing.
First I compiled sqlite_shell with following patch:
Index: third_party/sqlite/src/shell.c
===================================================================
--- third_party/sqlite/src/shell.c(版本 24054)
+++ third_party/sqlite/src/shell.c(工作副本)
@@ -18,6 +18,7 @@
  #include <string.h>
  #include <stdio.h>
  #include <assert.h>
+#include <locale.h>
  #include "sqlite3.h"
  #include <ctype.h>
  #include <stdarg.h>
@@ -1918,6 +1919,8 @@
    int i;
    int rc = 0;

+  setlocale(LC_ALL, "");
+
    /* Begin evanm patch. */
  #ifdef SQLITE_GEARS_DISABLE_SHELL_ICU
    /* Gears doesn't use this. */

Then, I opened my History Index database file with the sqlite_shell and  
executed sql
command:

select url, title, time, offsets(pages), body from pages left outer join  
info on
pages.rowid = info.rowid where pages match "i" order by time desc limit 1;

which is similar than the one used in TextDatabase::GetTextMatches().

Very interesting that the result of above command were different when  
running
sqlite_shell under different locales.
Under locale en_US.UTF-8 and zh_CN.UTF-8, the result was:

            url = http://www.google.cn/search?q=%E4%B8%AD%E6%96%87
          title = 中文 - Google 搜索
           time = 1250822030915112
offsets(pages) = 2 0 976 1
           body = 网页 图片 视频 地图 资讯 音乐 问答...


Under locale tr_TR.UTF-8, the result became:

            url = 中文 - Google 搜索
          title = 网页 图片 视频 地图 资讯 音乐 问答...
           time = 1250822030915112
offsets(pages) =
           body =

You may notice the contents were completely messed up. The content of title  
was
returned as url, the content of body was returned as title and body became  
empty.
Please note that, the database file is not corrupted, everything are ok  
when using
en_US.UTF-8 or zh_CN.UTF-8 locale.

I confirmed that it's the reason of issue 19124, and I believe it's also  
the reason
of this issue.

This problem is reproducible every time even there is only one row in  
History Index
database.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to