On Thu, 2013-02-21 at 22:41 +0000, Ian Malone wrote:
On 21 February 2013 18:24, David Malcolm <dmalcolm(a)redhat.com>
wrote:
> On Wed, 2013-02-20 at 08:04 +0000, Ian Malone wrote:
>> On 19 February 2013 12:13, David Malcolm <dmalcolm(a)redhat.com> wrote:
>>
>> Question: does a python segfault from a broken script indicate a
>> python bug as well? The scripting engine shouldn't really be crashing.
>
> python -c "from ctypes import string_at; string_at(0xDEADBEEF)"
>
Point.
(sorry about my terseness btw)
I could try and argue that a scripting language should stop you
doing this by catching it somehow, but that's unrealistic for this
case and, as you (sorry, not 100% sure, but going to guess you're the
same DMalcolm) say here,
http://dmalcolm.livejournal.com/4545.html [Yes I am. FWIW
the prettyprinting C backtrace hooks I talked about
there are in our python-debuginfo package, and set up so that they're
automatically used by gdb on such backtraces if you have
python-debuginfo installed]
it's a consequence of being able to run native code. Could also
be
viewed as a bug in the bindings rather than python, but, again, it's
what they're supposed to do.
Yeah, ctypes is a big source of crashes in my experience: you get all of
the responsibility of dealing with C datatypes, pointers, etc, but
there's no type system to guarantee that you got it correct. Gah.
However hopefully most python programmes aren't doing things
like
this. And of course it'll be better all round if the bugs go to the
programme that caused them.
+1000
Cheers
Dave