You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Dale Harvey (JIRA)" <ji...@apache.org> on 2011/05/11 06:45:47 UTC

[jira] [Created] (COUCHDB-1158) Log server crashes when view contains unicode and log level is set to debug

Log server crashes when view contains unicode and log level is set to debug
---------------------------------------------------------------------------

                 Key: COUCHDB-1158
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1158
             Project: CouchDB
          Issue Type: Bug
          Components: Database Core
         Environment: OSX, Built from Git - 1.2.0a8a37632-git
            Reporter: Dale Harvey


When a document contains a simple unicode escaped character and the log level is set to debug, running any view over the document crashes the log server

http://pastebin.me/883abdacdb3feca6b4ed965413091458

will investigate further

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (COUCHDB-1158) Log server crashes when view contains unicode and log level is set to debug

Posted by "Filipe Manana (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filipe Manana resolved COUCHDB-1158.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2
                   1.1

Applied fix to trunk and branch 1.1.x
Thanks Dale.

> Log server crashes when view contains unicode and log level is set to debug
> ---------------------------------------------------------------------------
>
>                 Key: COUCHDB-1158
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1158
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>         Environment: OSX, Built from Git - 1.2.0a8a37632-git
>            Reporter: Dale Harvey
>             Fix For: 1.1, 1.2
>
>         Attachments: couch_log_unicode.patch
>
>
> When a document contains a simple unicode escaped character and the log level is set to debug, running any view over the document crashes the log server
> http://pastebin.me/883abdacdb3feca6b4ed965413091458
> will investigate further

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (COUCHDB-1158) Log server crashes when view contains unicode and log level is set to debug

Posted by "Dale Harvey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031662#comment-13031662 ] 

Dale Harvey commented on COUCHDB-1158:
--------------------------------------

Awesome Filipe, confirmed that fixes it for me

> Log server crashes when view contains unicode and log level is set to debug
> ---------------------------------------------------------------------------
>
>                 Key: COUCHDB-1158
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1158
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>         Environment: OSX, Built from Git - 1.2.0a8a37632-git
>            Reporter: Dale Harvey
>         Attachments: couch_log_unicode.patch
>
>
> When a document contains a simple unicode escaped character and the log level is set to debug, running any view over the document crashes the log server
> http://pastebin.me/883abdacdb3feca6b4ed965413091458
> will investigate further

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (COUCHDB-1158) Log server crashes when view contains unicode and log level is set to debug

Posted by "Filipe Manana (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filipe Manana updated COUCHDB-1158:
-----------------------------------

    Attachment: couch_log_unicode.patch

Good finding Dale,
Can you tell me if the following patch fixes the issue for your case?


diff --git a/src/couchdb/couch_log.erl b/src/couchdb/couch_log.erl
index 38a1b56..e7405d4 100644
--- a/src/couchdb/couch_log.erl
+++ b/src/couchdb/couch_log.erl
@@ -170,7 +170,8 @@ get_log_messages(Pid, Level, Format, Args) ->
     ConsoleMsg = io_lib:format(
         "[~s] [~p] " ++ Format ++ "~n", [Level, Pid | Args]),
     FileMsg = ["[", httpd_util:rfc1123_date(), "] ", ConsoleMsg],
-    {iolist_to_binary(ConsoleMsg), iolist_to_binary(FileMsg)}.
+    {unicode:characters_to_binary(ConsoleMsg),
+        unicode:characters_to_binary(FileMsg)}.
 
 read(Bytes, Offset) ->
     LogFileName = couch_config:get("log", "file"),

Thanks

> Log server crashes when view contains unicode and log level is set to debug
> ---------------------------------------------------------------------------
>
>                 Key: COUCHDB-1158
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1158
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>         Environment: OSX, Built from Git - 1.2.0a8a37632-git
>            Reporter: Dale Harvey
>         Attachments: couch_log_unicode.patch
>
>
> When a document contains a simple unicode escaped character and the log level is set to debug, running any view over the document crashes the log server
> http://pastebin.me/883abdacdb3feca6b4ed965413091458
> will investigate further

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira