This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: uninitialized memory, pretty printers and full backtraces


Paul Pluzhnikov wrote:
On Thu, Jan 22, 2009 at 7:18 AM, Phil Muldoon <pmuldoon@redhat.com> wrote:
I was working on another pretty printing task, when I noted the behaviour
below. I'm not sure how to fix it. Thought it worth discussing here.

The basic premise is that in a "bt full" condition, the pretty printers
appear to try and grok (and pretty print) all local variables in a frame -
even if they are not initialized at the time the "bt full" was requested. I
believe this is not so different from existing GDB behaviour. But with the
Python pretty printers, the problem is magnified as the printers will
attempt to read, and interpret assorted random memory addresses in an
uninitialized class.

I've seen that as well, thanks for bringing this up.


One possible way to fix this is to fall back to "raw print" if the python
pretty printer throws exception.

Yeah, it would solve the exception output interrupting the flow. Would still be printing basically garbage though.


This will make it harder to debug python pretty-printers themselves:
it would make it appear that they are not "firing" if there is a problem
with python code. But perhaps logging exception only when "set verbose on"
is in effect is sufficient to overcome this

I've not had time to look into this deeper, apologies for the delay and that.


I'm still not sure - in the test-case - whether it is just printing out uninitialized memory that has been allocated, or it really is just reading random memory addresses. And if it is the latter, whether rummaging around in these areas is appropriate in the pretty printer sense or the raw print sense (a bug to both upstream and pretty printers).

I'll file this bug when we get an archer component in sourceware bugzilla so we can track it.

Regards

Phil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]