Larry Hastings added the comment:

Here's what I've figured out.  If I build trunk then run:

% gdb --batch -iex "add-auto-load-safe-path 
/home/larry/src/python/buildtrunk/python-gdb.py" --eval-command="set breakpoint 
pending yes" --eval-command="break builtin_id" --eval-command=run 
--eval-command=backtrace --args /home/larry/src/python/buildtrunk/python -S -c 
"id([0, 1, 2, 3, 4])"

I see UnicodeDecodeErrors spat out in the middle of the traceback:

#0  builtin_id (self=<module at remote 0x7ffff7fbfc28>, v=[0, 1, 2, 3, 4]) at 
Python/bltinmodule
.c:991
#1  0x00000000004d8695 in call_function (oparg=<optimized out>, 
pp_stack=0x7fffffffdc00) at Pyth
on/ceval.c:4212
#2  PyEval_EvalFrameEx (f=f@entry=Frame 0x7ffff7f3e788, for file <string>, line 
1, in <module> (
), throwflag=throwflag@entry=0) at Python/ceval.c:2826
Python Exception <class 'UnicodeDecodeError'> 'utf-8' codec can't decode byte 
0x80 in position 0
: invalid start byte: 
Python Exception <class 'UnicodeDecodeError'> 'utf-8' codec can't decode byte 
0x80 in position $: invalid start byte: 
#3  0x00000000004d9809 in PyEval_EvalCodeEx (closure=0x0, [...]

If I run the same sequence of commands manually (remove the --batch and the 
batched commands from the gdb command-line, then type them in myself) I still 
see the decode error.

If I then set a breakpoint on PyUnicodeDecodeError_Create() and run backtrace 
again, it still prints the decode errors, but it doesn't stop on the 
breakpoint.  (I guess this would be like getting to the assault on the ski 
chalet in Inception?)

Most worrisome of all: if I change the Makefile from -O3 to -O0, the decode 
errors go away.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19743>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to