Package: libsqlite3-0
Version: 3.7.13-1+deb7u1
Severity: serious

Originally detected I believe on sid installation, but forgot to capture the
version, I will try to replicate/report later.  But very consistent with wheezy
(from which I am reporting now).

Triggered by the backport fail2ban 0.9.1-1~nd70+1 (available from
http://neuro.debian.net/debian-devel/ wheezy/main amd64 Packages  apt repo) it
gets to

#0  sqlite3_value_type (pVal=0x0) at sqlite3.c:63805
#1  0x00007ffff570ee2e in sqlite3_column_type (pStmt=0x114eec8, i=<optimized 
out>) at sqlite3.c:64447
#2  0x00007ffff599b3d4 in _pysqlite_fetch_one_row (self=0x11e3540) at 
/home/jmm/py/python2.7-2.7.3/Modules/_sqlite/cursor.c:363
#3  0x00007ffff599d71d in pysqlite_cursor_iternext (self=0x11e3540) at 
/home/jmm/py/python2.7-2.7.3/Modules/_sqlite/cursor.c:939
#4  0x000000000046d967 in listextend (self=0x107cb28, b=<sqlite3.Cursor at 
remote 0x11e3540>) at ../Objects/listobject.c:872
#5  0x0000000000471932 in list_init (self=0x107cb28, args=(<sqlite3.Cursor at 
remote 0x11e3540>,), kw=0x0) at ../Objects/listobject.c:2458
#6  0x00000000004b2092 in type_call (type=0x86dde0, args=(<sqlite3.Cursor at 
remote 0x11e3540>,), kwds=0x0) at ../Objects/typeobject.c:737
#7  0x00000000004291af in PyObject_Call (func=<type at remote 0x86dde0>, 
arg=(<sqlite3.Cursor at remote 0x11e3540>,), kw=0x0) at 
../Objects/abstract.c:2529
#8  0x000000000052977e in do_call (func=<type at remote 0x86dde0>, 
pp_stack=0x7ffff52a0490, na=1, nk=0) at ../Python/ceval.c:4239
#9  0x0000000000528b3b in call_function (pp_stack=0x7ffff52a0490, oparg=1) at 
../Python/ceval.c:4044
#10 0x0000000000523733 in PyEval_EvalFrameEx (f=
    Frame 0x10f0ba0, for file 
/usr/lib/python2.7/dist-packages/fail2ban/server/database.py, line 467, in 
getBansMerged 
(self=<Fail2BanDb(_dbFilename='/var/lib/fail2ban/fail2ban.sqlite3', 
_db=<sqlite3.Connection at remote 0x11178c0>, _lock=<thread.lock at remote 
0xf2ad10>, _purgeAge=86400, _bansMergedCache={('113.12.202.186', 
<Jail(_Jail__actions=<Actions(active=True, _Thread__ident=140737306576640, 
run=<function at remote 0x1056840>, _jail=<...>, 
_Thread__block=<_Condition(_Verbose__verbose=False, 
_Condition__lock=<thread.lock at remote 0x106f0e0>, acquire=<built-in method 
acquire of thread.lock object at remote 0x106f0e0>, _Condition__waiters=[], 
release=<built-in method release of thread.lock object at remote 0x106f0e0>) at 
remote 0x1070290>, _Thread__name='Thread-5', _Thread__daemonic=False, 
_actions=<OrderedDict(_OrderedDict__root=[[[...], [...], 'iptables-multiport'], 
[...], None], _OrderedDict__map={'iptables-multiport': [...]}) at remote 
0x11181c0>, sleeptime=1, _Thread__start
 ed=<_Event(_Verbose__verbose=F...(truncated), throwflag=0) at 
../Python/ceval.c:2666
#11 0x0000000000526121 in PyEval_EvalCodeEx (co=0xf18670, globals=
    {'locale': <module at remote 0xe4f7b0>, 'commitandrollback': <function at 
remote 0xf2bc30>, 'MyTime': <classobj at remote 0xd51520>, 'Fail2BanDb': <type 
at remote 0xf3a820>, 'shutil': <module at remote 0xf1be98>, 'wraps': <function 
at remote 0xcc1258>, '__package__': 'fail2ban.server', 'json': <module at 
remote 0xeb6f00>, 'sqlite3': <module at remote 0xf1b3a0>, 'FailTicket': 
<classobj at remote 0xd51228>, '__doc__': None, '__license__': 'GPL', 
'__builtins__': {'bytearray': <type at remote 0x85fd20>, 'IndexError': <type at 
remote 0x866360>, 'all': <built-in function all>, 'help': <_Helper at remote 
0xb25fb0>, 'vars': <built-in function vars>, 'SyntaxError': <type at remote 
0x865ce0>, 'unicode': <type at remote 0x87d040>, 'UnicodeDecodeError': <type at 
remote 0x866c80>, 'memoryview': <type at remote 0x870c00>, 'isinstance': 
<built-in function isinstance>, 'copyright': 
<_Printer(_Printer__data='Copyright (c) 2001-2012 Python Software 
Foundation.\nAll Rights Reserved.\n\nCopyright (c
 ) 2000 BeOpen.com.\nAll Rights...(truncated), locals=0x0, args=0x11556b8, 
argcount=1, kws=
    0x11556c0, kwcount=2, defs=0xf28c08, defcount=3, closure=0x0) at 
../Python/ceval.c:3253
#12 0x0000000000528f36 in fast_function (func=<function at remote 0xf58450>, 
pp_stack=0x7ffff52a0950, n=5, na=1, nk=2) at ../Python/ceval.c:4117
#13 0x0000000000528b1f in call_function (pp_stack=0x7ffff52a0950, oparg=512) at 
../Python/ceval.c:4042
#14 0x0000000000523733 in PyEval_EvalFrameEx (f=
    Frame 0x1155520, for file 
/usr/lib/python2.7/dist-packages/fail2ban/server/actions.py, line 274, in 
<lambda> (jail=<Jail(_Jail__actions=<Actions(active=True, 
_Thread__ident=140737306576640, run=<function at remote 0x1056840>, 
_jail=<...>, _Thread__block=<_Condition(_Verbose__verbose=False, 
_Condition__lock=<thread.lock at remote 0x106f0e0>, acquire=<built-in method 
acquire of thread.lock object at remote 0x106f0e0>, _Condition__waiters=[], 
release=<built-in method release of thread.lock object at remote 0x106f0e0>) at 
remote 0x1070290>, _Thread__name='Thread-5', _Thread__daemonic=False, 
_actions=<OrderedDict(_OrderedDict__root=[[[...], [...], 'iptables-multiport'], 
[...], None], _OrderedDict__map={'iptables-multiport': [...]}) at remote 
0x11181c0>, sleeptime=1, _Thread__started=<_Event(_Verbose__verbose=False, 
_Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, 
_Condition__lock=<thread.lock at remote 0x106f090>, acquire=<built-in method 
acquire of thread.lock obj
 ect at remote 0x106f090>, _Con...(truncated), throwflag=0) at 
../Python/ceval.c:2666
... 


here is py-bt stack (ran with python-dbg):

#10 Frame 0x10f0ba0, for file 
/usr/lib/python2.7/dist-packages/fail2ban/server/database.py, line 467, in 
getBansMerged 
(self=<Fail2BanDb(_dbFilename='/var/lib/fail2ban/fail2ban.sqlite3', 
_db=<sqlite3.Connection at remote 0x11178c0>, _lock=<thread.lock at remote 
0xf2ad10>, _purgeAge=86400, _bansMergedCache={('113.12.202.186', 
<Jail(_Jail__actions=<Actions(active=True, _Thread__ident=140737306576640, 
run=<function at remote 0x1056840>, _jail=<...>, 
_Thread__block=<_Condition(_Verbose__verbose=False, 
_Condition__lock=<thread.lock at remote 0x106f0e0>, acquire=<built-in method 
acquire of thread.lock object at remote 0x106f0e0>, _Condition__waiters=[], 
release=<built-in method release of thread.lock object at remote 0x106f0e0>) at 
remote 0x1070290>, _Thread__name='Thread-5', _Thread__daemonic=False, 
_actions=<OrderedDict(_OrderedDict__root=[[[...], [...], 'iptables-multiport'], 
[...], None], _OrderedDict__map={'iptables-multiport': [...]}) at remote 
0x11181c0>, sleeptime=1, _Thread__start
 ed=<_Event(_Verbose__verbose=F...(truncated)
    results = list(self._getBans(ip=ip, jail=jail, bantime=bantime))
#14 Frame 0x1155520, for file 
/usr/lib/python2.7/dist-packages/fail2ban/server/actions.py, line 274, in 
<lambda> (jail=<Jail(_Jail__actions=<Actions(active=True, 
_Thread__ident=140737306576640, run=<function at remote 0x1056840>, 
_jail=<...>, _Thread__block=<_Condition(_Verbose__verbose=False, 
_Condition__lock=<thread.lock at remote 0x106f0e0>, acquire=<built-in method 
acquire of thread.lock object at remote 0x106f0e0>, _Condition__waiters=[], 
release=<built-in method release of thread.lock object at remote 0x106f0e0>) at 
remote 0x1070290>, _Thread__name='Thread-5', _Thread__daemonic=False, 
_actions=<OrderedDict(_OrderedDict__root=[[[...], [...], 'iptables-multiport'], 
[...], None], _OrderedDict__map={'iptables-multiport': [...]}) at remote 
0x11181c0>, sleeptime=1, _Thread__started=<_Event(_Verbose__verbose=False, 
_Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, 
_Condition__lock=<thread.lock at remote 0x106f090>, acquire=<built-in method 
acquire of thread.lock obj
 ect at remote 0x106f090>, _Con...(truncated)
    jail.database.getBansMerged(ip=ip, jail=jail).getAttempt()
#18 Frame 0x1153f50, for file 
/usr/lib/python2.7/dist-packages/fail2ban/server/action.py, line 78, in 
__getitem__ (self=<CallingMap(data={'ipjailmatches': <function at remote 
0x1056a38>, 'matches': u'Nov 27 17:49:58 head1 sshd[30299]: Failed password for 
root from 111.74.239.35 port 4965 ssh2\nNov 27 17:50:00 head1 sshd[30299]: 
Failed password for root from 111.74.239.35 port 4965 ssh2\nNov 27 17:50:03 
head1 sshd[30299]: Failed password for root from 111.74.239.35 port 4965 
ssh2\nNov 27 17:50:05 head1 sshd[30299]: Failed password for root from 
111.74.239.35 port 4965 ssh2\nNov 27 17:50:08 head1 sshd[30299]: Failed 
password for root from 111.74.239.35 port 4965 ssh2', 'ip': '111.74.239.35', 
'ipmatches': <function at remote 0x1056798>, 'ipfailures': '105', 'time': 
'1417128608.39', 'failures': '5', 'ipjailfailures': <function at remote 
0x1056990>}) at remote 0x1061140>, key='ipjailfailures', value=<function at 
remote 0x1056990>)
    return value()
#27 Frame 0x10ef4f0, for file 
/usr/lib/python2.7/dist-packages/fail2ban/server/action.py, line 386, in 
substituteRecursiveTags (cls=<ABCMeta(__module__='fail2ban.server.action', 
actionunban=<property at remote 0xe0da78>, 
_abc_negative_cache=<WeakSet(_remove=<function at remote 0xe103a8>, 
_pending_removals=[], _iterating=set([]), data=set([])) at remote 0xe02bc0>, 
_abc_registry=<WeakSet(_remove=<function at remote 0xe0f258>, 
_pending_removals=[], _iterating=set([]), data=set([])) at remote 0xe02a00>, 
stop=<function at remote 0xe0fed0>, _escapedTags=set(['matches', 
'ipjailmatches', 'ipmatches']), escapeTag=<staticmethod at remote 0xddad60>, 
__subclasshook__=<classmethod at remote 0xdda470>, executeCmd=<staticmethod at 
remote 0xe07198>, actionstop=<property at remote 0xe0db88>, 
actionstart=<property at remote 0xe0d968>, __init__=<function at remote 
0xe0f300>, _abc_cache=<WeakSet(_remove=<function at remote 0xe10300>, 
_pending_removals=[], _iterating=set([]), data=set([])) at remote 0xe0
 2ae0>, replaceTag=<classmethod...(truncated)
    value = str(tags[tag])

(gdb) py-print ip
local 'ip' = '111.74.239.35'
(gdb) py-print bantime
local 'bantime' = None
(gdb) py-down
Unable to find a newer python frame
(gdb) py-print jail


unfortunately we haven't logged the sql queries so not sure on exact one, but I
think it was this one, which if executed from the shell seems to not cause the
segfault... 

n {1..100}; do sqlite3 -list fail2ban.sqlite3 'SELECT ip, timeofban, data FROM 
bans WHERE 1 AND jail="sshd" AND ip="111.74.239.35" ORDER BY ip, timeofban' 
>/dev/null && echo success; done


Please help me to troubleshoot this one if more information is necessary
to point the issue

-- System Information:
Debian Release: 7.7
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libsqlite3-0 depends on:
ii  libc6              2.13-38+deb7u6
ii  multiarch-support  2.13-38+deb7u6

libsqlite3-0 recommends no packages.

libsqlite3-0 suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to