Skip to content

snake segfault #39

@dasl-

Description

@dasl-

This appears to be a rarely occuring issue. I've only encountered it once.

Just playing a friendly 2 player game of snake. We had eaten 14 out of 15 apples. Suddenly a segfault and the game freezes:

% sudo strace -p 30063
strace: Process 30063 attached
sigreturn({mask=[]})                    = 2
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1} ---
sigreturn({mask=[]})                    = 2
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1} ---
sigreturn({mask=[]})
... etc ...

Nothing useful in logs.

Install python3 debug symbols: sudo apt-get install python3-dbg

gdb backtrace: https://gist.github.com/dasl-/03c2571ff1f12d3500b3bc90ee5c597a

This appears to be different than the segfault we encountered in https://github.com/dasl-/pifi/issues/26. Here it looks like the segfault occurs on this line:

pifi/bin/snake

Line 57 in 39760ca

logger.error(f'Caught exception: {traceback.format_exc()}')

And it looks like the exception that was caught was: TypeError("'range_iterator' object is not subscriptable",). I am confused for a couple reasons:

  1. Why is catching an exception and printing the traceback causing a segfault?
  2. What is causing this TypeError to be thrown in the first place?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions