Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Spencer <maillist-gdbpatches@barfooze.de>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] Crash sourcing Python script on Windows
Date: Thu, 29 Sep 2011 02:19:00 -0000	[thread overview]
Message-ID: <4E83D440.6000702@barfooze.de> (raw)
In-Reply-To: <09787EF419216C41A903FD14EE5506DD03098D555B@AUSX7MCPC103.AMER.DELL.COM>

On 09/29/2011 03:01 AM, Paul_Koning@Dell.com wrote:
>> At long last, I forced myself to look into this. I had noticed that "source script.py" did not work on Windows, and resulted in the debugger crashing.  It turns out that the problem came from the fact that I was using a binaries from python.org where the definition of type FILE difers from the definition our compiler uses.  The crash occurs when trying to call PyRun_SimpleFile with a FILE created by GDB.
>>
>> The approach we took is to create a new FILE descriptor using Python routines, thus making sure that the FILE is compatible with PyRun_SimpleFile.  There were two such calls, so we wrote a wrapper to that function that only takes a filename, and creates the FILE on the fly.  This avoids code duplication.
> That sounds like a good solution.  I'm puzzled though -- how did FILE end up being different?  One would expect the right header files to be used, producing correct/consistent results.  If that didn't happen in this case, could it happen for other aspects of the GDB to Python API?
>
> 	paul
>
FILE is supposed to be an opaque type and as such noone except of the 
libc which defines it is supposed to "poke" at its internals.
however it is common practice in GNU software to assume everybody uses 
GLIBC and poke around in internal stuff thats not supposed to be 
accessibly at all in userland. another example of such illegal behaviour 
is libevent, which does illegal things with fd_set internals to allow 
more than FD_SETSIZE file descriptors to be used with select().


  reply	other threads:[~2011-09-29  2:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28 23:24 Joel Brobecker
2011-09-29  2:00 ` Paul_Koning
2011-09-29  2:19   ` John Spencer [this message]
2011-09-29  4:47     ` Joel Brobecker
2011-09-29  7:30       ` Eli Zaretskii
2011-09-29  8:54         ` Kai Tietz
2011-09-29  9:48           ` Eli Zaretskii
2011-09-29  9:51             ` Kai Tietz
2011-09-29 10:54       ` Pedro Alves
2011-09-29 12:33         ` Eli Zaretskii
2011-09-29 12:48           ` Kai Tietz
2011-09-29 13:19           ` Pedro Alves
2011-09-29  7:26     ` Eli Zaretskii
2011-10-03 20:05     ` Tom Tromey
2011-09-29  7:20   ` Eli Zaretskii
2011-10-03 20:02 ` Tom Tromey
2011-10-03 20:53   ` Joel Brobecker
2011-10-04 17:08     ` Tom Tromey
2012-01-23 18:14 ` [patch] Do not open Python scripts twice #2 [Re: [RFC] Crash sourcing Python script on Windows] Jan Kratochvil
2012-01-23 18:41   ` Pedro Alves
2012-01-23 21:55     ` Jan Kratochvil
2012-01-23 22:08       ` Doug Evans
2012-01-23 22:47         ` Jan Kratochvil
2012-01-23 23:47           ` Doug Evans
2012-01-24 14:45             ` Jan Kratochvil
2012-01-24 18:56               ` Doug Evans
2012-01-24 19:41                 ` Jan Kratochvil
2012-01-24 22:20                   ` Doug Evans
2012-01-24 23:49                     ` Jan Kratochvil
2012-01-25 22:30                       ` Jan Kratochvil
2012-01-26  7:18                         ` Joel Brobecker
2012-01-26 22:03                           ` [commit] " Jan Kratochvil
2012-01-24 15:15             ` Pedro Alves
2012-01-23 19:57   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E83D440.6000702@barfooze.de \
    --to=maillist-gdbpatches@barfooze.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox