I am using Twisted 11 with SQLAnywhere 12 through the official sqlanydb driver.
It usually works great.
But sometimes the application crashes on the first request.
If one request worked, all subsequent work also. However, my tests are rarely performed.
It is terrible to develop with and strace does not tell me anything informative. Sometimes it falls inside select (), sometimes in mmap () ...
I am running 64-bit Linux and running locally Sybase as dbeng12 for testing.
Does anyone successfully work with these components? Any suggestions how to solve this? I used to use sqlanydb with Django and it never crashed.
Using fingerprints, I found it to crash inside the DeferredList, the important code is basically the following:
class WhoisDb(object):
def _get_contacts(self, dom):
if not dom:
self.d.errback(UnknownDomain(self._get_limit()))
return
self.dom = Domain._make(dom[0])
dl = defer.DeferredList( [
self.dbpool.runQuery(CON_SQL, (self.dom.dom_owner,)),
self.dbpool.runQuery(CON_SQL, (self.dom.dom_admin,)),
self.dbpool.runQuery(CON_SQL, (self.dom.dom_tech,)),
self.dbpool.runQuery(
LAST_UPDATE_SQL,
( self.dom.domName, )), ] ).addCallback(self._fmt_string)
def get_whois(self, domain):
self.d = defer.Deferred()
if not self._check_limit():
self.d.errback(LimitExceeded(MAX_PER_HOUR))
elif not RE_ALLOWED_TLDS.match(domain):
self.d.errback(UnknownDomain(self._get_limit()))
else:
self.dbpool.runQuery(
'select ' + DOM_FIELDS + ' from domains where '
'domain = ? or domain_idn = ?',
( domain, domain, )) \
.addCallback(self._get_contacts)
return self.d
_fmt_string () is not called if it fails.
gdb SIGSEV:
(gdb) run ~/.virtualenvs/whois/bin/trial test.test_protocol.ProtocolTestCase.test_correct_domain
Starting program: /home/hynek/.virtualenvs/whois/bin/python ~/.virtualenvs/whois/bin/trial test.test_protocol.ProtocolTestCase.test_correct_domain
[Thread debugging using libthread_db enabled]
test.test_protocol
ProtocolTestCase
test_correct_domain ... [New Thread 0x7ffff311a700 (LWP 6685)]
[New Thread 0x7ffff3099700 (LWP 6686)]
[New Thread 0x7ffff27dc700 (LWP 6723)]
[New Thread 0x7ffff1fdb700 (LWP 6724)]
[New Thread 0x7ffff17da700 (LWP 6725)]
[New Thread 0x7ffff0fd9700 (LWP 6729)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1fdb700 (LWP 6724)]
0x00007ffff4d4167c in ?? () from /opt/sqlanywhere12/lib64/libdbcapi_r.so