couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Lehnardt (Created) (JIRA)" <>
Subject [jira] [Created] (COUCHDB-1393) badmatch on big binary
Date Wed, 25 Jan 2012 09:54:40 GMT
badmatch on big binary

                 Key: COUCHDB-1393
             Project: CouchDB
          Issue Type: Bug
            Reporter: Jan Lehnardt

via dev@ by Peta Bogdan <>


I have a small database around 120 MB with approximately 16,000 documents.

However, it happens (also from futon) that I get this error:

[Tue, 17 Jan 2012 07:22:01 GMT] [error] [<0.185.0>] {error_report,<0.30.0>,

If this error occurs to frequently causes couch_server to reach its max
restart frequency causing the entire supervision tree to shutdown and hence
the database server instance disappears.

The function couch_file:read_raw_iolist_int/3 calls file:pread which
returns {ok, Binary}. This Binary has almost 9 megabytes in size, which is
very strange.
I think this does mean that the function file:pread/3 is instructed to read
from wrong position.

The only reason I can think of is that the value of 'TotalBytes' from line
(1) doesn't match the value of 'TotalBytes' from line (2)

(1) TotalBytes = calculate_total_read_len(BlockOffset, Len),
(2) {ok, <<RawBin:TotalBytes/binary>>} = file:pread(Fd, Pos, TotalBytes),

The possible answer would be that in certain conditions the function
calculate_total_read_len/2 doesn't return the expected value.

Server: CouchDB/1.1.1 (Erlang OTP/R14B04)
OS: OpenBSD 5.0 GENERIC.MP#63 amd64

Now, the trouble is how to circumvent this situation.

Thank you in advance,


This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message