Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kai Tietz <ktietz70@googlemail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: brobecker@adacore.com, maillist-gdbpatches@barfooze.de,
		gdb-patches@sourceware.org
Subject: Re: [RFC] Crash sourcing Python script on Windows
Date: Thu, 29 Sep 2011 09:51:00 -0000	[thread overview]
Message-ID: <CAEwic4bXWsq6H-auvEK4fuXWkXffQ4usckMs=aMLaBacSOOEwg@mail.gmail.com> (raw)
In-Reply-To: <83r52zelj5.fsf@gnu.org>

2011/9/29 Eli Zaretskii <eliz@gnu.org>:
>> Date: Thu, 29 Sep 2011 10:38:51 +0200
>> From: Kai Tietz <ktietz70@googlemail.com>
>> Cc: Joel Brobecker <brobecker@adacore.com>, maillist-gdbpatches@barfooze.de,
>>       gdb-patches@sourceware.org
>>
>> The issue here is not the definition of the FILE type itself in this
>> case.  The problem is that python (if built with VC) uses different
>> runtime-version (msvcr100.dll or lower), but mingw uses by well know
>> reasons the msvcrt.dll.  So by loading this python-DLL into a
>> mingw-built executable, we have two different runtimes at the same
>> time.
>
> Thanks, this makes sense.
>
> What are the reasons that we build GDB against msvcrt.dll?

The issue is a legal thing.  The newer runtimes mvcrXX.dlls aren't
part of the OS itself.  The msvcrt.dll is present on all WIndows OSes
(well always in a different version).  So we can assume that everybody
has a working msvcrt.dll present on his OS.  Due the fact that
msvcrXX.dll aren't part of runtime, you would need to distribute those
DLLs to end-user, which would be (INAL) a violation of EULA as far as
I understood it, if you haven't a VC license for it.

>> By the way, the same issue can lead also for different C-runtime
>> functions pretty funny results.
>
> Exactly.  If we have such an incompatibility once python's DLL is
> loaded, it can lead to similar crashes elsewhere.  So, unless we can
> find a way of linking against msvcrNNN.dll or build our own Python
> with MinGW, it sounds like using Python on Windows is unsafe?

Well, not necessarily.  You need just to take care that file-I/O and
memory-functions are used only in context of one of those libraries
and no exchange of those pointers/file-handles (on C-level, not
OS-level) happens.  For example Java-VM-Runtime works that way pretty
nice with msvcrt, as long as you take care not to do here those
failures.

Regards,
Kai


  reply	other threads:[~2011-09-29  9:48 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
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 [this message]
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='CAEwic4bXWsq6H-auvEK4fuXWkXffQ4usckMs=aMLaBacSOOEwg@mail.gmail.com' \
    --to=ktietz70@googlemail.com \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=maillist-gdbpatches@barfooze.de \
    /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