pymongo segfault

48 views
Skip to first unread message

Billy Chasen

unread,
Apr 2, 2012, 7:56:12 PM4/2/12
to mongod...@googlegroups.com
We're having some segfaults randomly occur in our webservers and it seems to correlate with mongo.  Mongo appears to get a bit slow at times and we start seeing this traceback happen.  Any insight would be great, thanks.

Traceback (most recent call last):

File "/mnt/turntable-backend/backend/lib/mongo.py", line 89, in funcwrap

    return work()

File "/mnt/turntable-backend/backend/lib/mongo.py", line 76, in work    

ret = callobj(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/collection.py", line 474, in find_one   

 for result in self.find(spec_or_id, *args, **kwargs).limit(-1):

File "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 609, in next

    if len(self.__data) or self._refresh():

File "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 572, in _refresh

    self.__query_spec(), self.__fields))

File "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/message.py", line 131, in query

    (request_id, query_message) = __pack_message(2004, data)

File "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/message.py", line 58, in __pack_message    

   message = struct.pack("<i", 16 + len(data))\n\nerror: pack requires exactly 3415645423173094629 arguments\n')


Bernie Hackett

unread,
Apr 2, 2012, 9:45:20 PM4/2/12
to mongodb-user
message = struct.pack("<i", 16 + len(data))\n\nerror: pack requires
exactly 3415645423173094629 arguments\n')

This seems like a weird bug in the struct module. The pack format (<i)
only requires one argument and we are only passing one argument. One
thing to try is upgrading your version of PyMongo. 1.11 is really old.
Newer versions will use the _cmessage module instead providing a large
performance increase.

On Apr 2, 4:56 pm, Billy Chasen <bi...@turntable.fm> wrote:
> We're having some segfaults randomly occur in our webservers and it seems
> to correlate with mongo.  Mongo appears to get a bit slow at times and we
> start seeing this traceback happen.  Any insight would be great, thanks.
>
> Traceback (most recent call last):
>
> File "/mnt/turntable-backend/backend/lib/mongo.py", line 89, in funcwrap
>
>     return work()
>
> File "/mnt/turntable-backend/backend/lib/mongo.py", line 76, in work
>
> ret = callobj(*args, **kwargs)
>
> File
> "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg /pymongo/collection.py",
> line 474, in find_one
>
>  for result in self.find(spec_or_id, *args, **kwargs).limit(-1):
>
> File
> "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg /pymongo/cursor.py",
> line 609, in next
>
>     if len(self.__data) or self._refresh():
>
> File
> "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg /pymongo/cursor.py",
> line 572, in _refresh
>
>     self.__query_spec(), self.__fields))
>
> File
> "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg /pymongo/message.py",
> line 131, in query
>
>     (request_id, query_message) = __pack_message(2004, data)
>
> File
> "/usr/local/lib/python2.7/dist-packages/pymongo-1.11-py2.7-linux-x86_64.egg /pymongo/message.py",

Billy Chasen

unread,
Apr 3, 2012, 4:50:55 PM4/3/12
to mongod...@googlegroups.com
thanks, upgraded and monitoring.  we thought it was actually on the latest

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Reply all
Reply to author
Forward
0 new messages