Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72575

Corrputed stacktrace?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <Nikolaus@rath.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'handler': 0.05; 'preferred.': 0.05; '"""': 0.07; 'debug': 0.07; 'debugging': 0.07; 'method.': 0.07; 'skip:" 60': 0.07; 'skip:u 30': 0.07; '__init__': 0.09; 'function,': 0.09; 'python': 0.11; 'thread': 0.14; '(pdb)': 0.16; '126': 0.16; '586': 0.16; '590': 0.16; '610': 0.16; '853': 0.16; 'breakpoint': 0.16; 'called.': 0.16; 'fingerprint:': 0.16; 'fruit': 0.16; 'gpg': 0.16; 'intended.': 0.16; 'pairs': 0.16; 'pairs:': 0.16; 'skip:/ 60': 0.16; 'skip:/ 70': 0.16; 'string:': 0.16; 'trying': 0.19; 'stack': 0.19; 'id:': 0.23; 'this?': 0.23; 'header:User-Agent:1': 0.23; 'module,': 0.24; 'unicode': 0.24; 'skip:" 30': 0.26; 'this:': 0.26; 'skip:" 20': 0.27; 'tried': 0.27; 'point': 0.28; 'rest': 0.29; 'on,': 0.29; 'evaluation': 0.30; "i'm": 0.30; 'gives': 0.31; 'code': 0.31; 'getting': 0.31; 'anyone': 0.31; 'file': 0.32; 'regular': 0.32; 'run': 0.32; 'entirely': 0.33; 'skip:_ 10': 0.34; 'could': 0.34; 'problem.': 0.35; 'skip:s 30': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'executing': 0.36; 'interaction': 0.36; 'skip:" 50': 0.36; 'method': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'should': 0.36; 'handle': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'called': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'skip:* 10': 0.61; 'reach': 0.63; 'close': 0.67; '666': 0.84; '_bootstrap': 0.84; 'characters,': 0.84; 'flies': 0.84; 'self.run()': 0.84; 'trickery': 0.84; '169': 0.91; 'encrypted': 0.91
From Nikolaus Rath <Nikolaus@rath.org>
To python-list@python.org
Subject Corrputed stacktrace?
Mail-Copies-To never
Mail-Followup-To python-list@python.org
Date Tue, 03 Jun 2014 19:20:49 -0700
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10666.1401848454.18130.python-list@python.org> (permalink)
Lines 128
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1401848454 news.xs4all.nl 2829 [2001:888:2000:d::a6]:51217
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:72575

Show key headers only | View raw


Hello,

I'm trying to debug a problem. As far as I can tell, one of my methods
is called at a point where it really should not be called. When setting
a breakpoint in the function, I'm getting this:

> /home/nikratio/in-progress/s3ql/src/s3ql/backends/s3c.py(693)close()
-> if not self.md5_checked:
(Pdb) bt
  /usr/lib/python3.3/threading.py(878)_bootstrap()
-> self._bootstrap_inner()
  /usr/lib/python3.3/threading.py(901)_bootstrap_inner()
-> self.run()
  /usr/lib/python3.3/threading.py(858)run()
-> self._target(*self._args, **self._kwargs)
  /usr/lib/python3.3/socketserver.py(610)process_request_thread()
-> self.finish_request(request, client_address)
  /usr/lib/python3.3/socketserver.py(345)finish_request()
-> self.RequestHandlerClass(request, client_address, self)
  /usr/lib/python3.3/socketserver.py(666)__init__()
-> self.handle()
  /home/nikratio/in-progress/s3ql/tests/mock_server.py(77)handle()
-> return super().handle()
  /usr/lib/python3.3/http/server.py(402)handle()
-> self.handle_one_request()
  /usr/lib/python3.3/http/server.py(388)handle_one_request()
-> method()
  /home/nikratio/in-progress/s3ql/tests/mock_server.py(169)do_GET()
-> q = parse_url(self.path)
  /home/nikratio/in-progress/s3ql/tests/mock_server.py(52)parse_url()
-> p.params = urllib.parse.parse_qs(q.query)
  /usr/lib/python3.3/urllib/parse.py(553)parse_qs()
-> encoding=encoding, errors=errors)
  /usr/lib/python3.3/urllib/parse.py(585)parse_qsl()
-> pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
  /usr/lib/python3.3/urllib/parse.py(585)<listcomp>()
-> pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
  /home/nikratio/in-progress/s3ql/src/s3ql/backends/common.py(853)close()
-> self.fh.close()
> /home/nikratio/in-progress/s3ql/src/s3ql/backends/s3c.py(693)close()
-> if not self.md5_checked:


To me this does not make any sense.

Firstly, the thread that is (apparently) calling close should never ever
reach code in common.py. This thread is executing a socketserver handler
that is entirely contained in mock_server.py and only communicates with
the rest of the program via tcp.

Secondly, the backtrace does not make sense. How can evaluation of 

 pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]

in urllib/parse.py() result in a method call in backends/common.py?
There is no trickery going on, qs is a regular string:

(Pdb) up
(Pdb) up
(Pdb) up
(Pdb) l
580  	        into Unicode characters, as accepted by the bytes.decode() method.
581  	
582  	    Returns a list, as G-d intended.
583  	    """
584  	    qs, _coerce_result = _coerce_args(qs)
585  ->	    pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
586  	    r = []
587  	    for name_value in pairs:
588  	        if not name_value and not strict_parsing:
589  	            continue
590  	        nv = name_value.split('=', 1)
(Pdb) whatis qs
<class 'str'>
(Pdb) p qs
''
(Pdb)

I have also tried to get a backtrace with the faulthandler module, but
it gives the same result:

Thread 0x00007f7dafdb4700:
  File "/usr/lib/python3.3/cmd.py", line 126 in cmdloop
  File "/usr/lib/python3.3/pdb.py", line 318 in _cmdloop
  File "/usr/lib/python3.3/pdb.py", line 345 in interaction
  File "/usr/lib/python3.3/pdb.py", line 266 in user_line
  File "/usr/lib/python3.3/bdb.py", line 65 in dispatch_line
  File "/usr/lib/python3.3/bdb.py", line 47 in trace_dispatch
  File "/home/nikratio/in-progress/s3ql/src/s3ql/backends/s3c.py", line 693 in clos
  File "/home/nikratio/in-progress/s3ql/src/s3ql/backends/common.py", line 853 in c
  File "/usr/lib/python3.3/urllib/parse.py", line 585 in <listcomp>
  File "/usr/lib/python3.3/urllib/parse.py", line 585 in parse_qsl
  File "/usr/lib/python3.3/urllib/parse.py", line 553 in parse_qs
  File "/home/nikratio/in-progress/s3ql/tests/mock_server.py", line 52 in parse_url
  File "/home/nikratio/in-progress/s3ql/tests/mock_server.py", line 169 in do_GET
  File "/usr/lib/python3.3/http/server.py", line 388 in handle_one_request
  File "/usr/lib/python3.3/http/server.py", line 402 in handle
  File "/home/nikratio/in-progress/s3ql/tests/mock_server.py", line 77 in handle
  File "/usr/lib/python3.3/socketserver.py", line 666 in __init__
  File "/usr/lib/python3.3/socketserver.py", line 345 in finish_request
  File "/usr/lib/python3.3/socketserver.py", line 610 in process_request_thread
  File "/usr/lib/python3.3/threading.py", line 858 in run
  File "/usr/lib/python3.3/threading.py", line 901 in _bootstrap_inner
  File "/usr/lib/python3.3/threading.py", line 878 in _bootstrap


Is it possible that the stack got somehow corrupted?

Does anyone have a suggestion how I could go about debugging this?

I am using Python 3.3.

Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Corrputed stacktrace? Nikolaus Rath <Nikolaus@rath.org> - 2014-06-03 19:20 -0700

csiph-web