> I get a segfault when trying to decode this file. I get this stack
> trace, but I'm having a very strange debug session. When I go to stack
> frame 4, I try to print the values for tree and label and I get 0x0 for both.
> But both have non-zero values... look at the function call in the trace below.
If those variables are dead by 215, and they're stored in registers, the
compiler may well have recycled those registes for other purposes. (I
seem to remember seeing on one of the GDB mailing lists that they're
looking into putting into the debugger symbol table information about
the range of lines in which a variable is live, or something such as
that - unless it's already there - and having GDB make use of that
information. We see that a lot here analyzing crash dumps from our
appliances....)
"tree" and "label" aren't use in any lines *after* that one, so perhaps
the compiler reused them by the time of the crash - except that I'd
expect it to have pushed "tree" on the stack last, so there might not be
enough code left before the call to reuse it, and I *think* the x86
calling sequence is callee-save, so I'd expect "proto_tree_add_text()"
to have saved that register, were it in a register.
(Then again, unless the Linux you're using isn't x86 Linux, we're not
exactly talking the most register-rich instruction set architecture on
the planet; if it's x86, it may well *not* have left them in registers.)