Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101468

Re: Strange crash while running a script with a embedded python interpreter

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Strange crash while running a script with a embedded python interpreter
Date Mon, 11 Jan 2016 19:09:40 +1100
Lines 37
Message-ID <mailman.6.1452499783.13488.python-list@python.org> (permalink)
References <4ac97a67-2527-424e-90e2-b714528977c8@googlegroups.com> <mailman.80.1452292120.2305.python-list@python.org> <c0a4d342-f8b5-48a6-b260-89d0458137cd@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de evVn7q6lCSHdmVS+FT4NiQ7YUQGAnETVIMvCQlk6RrqA==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'compiler': 0.05; 'friday,': 0.07; 'incompatible': 0.07; 'interpreter.': 0.07; 'api': 0.09; 'cc:addr:python-list': 0.09; 'subject:script': 0.09; 'subject:while': 0.09; 'subtle': 0.09; 'wrong,': 0.09; 'python': 0.10; 'jan': 0.11; 'subject:python': 0.14; '(also': 0.16; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'msvcrt': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'should.': 0.16; 'sorts': 0.16; 'with?': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'module,': 0.18; 'pointer': 0.18; 'settings': 0.20; 'windows': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'first,': 0.20; 'not,': 0.22; '3.x': 0.22; 'am,': 0.23; 'seems': 0.23; 'downloaded': 0.24; 'somewhere': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; "i've": 0.25; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; 'idea': 0.28; 'values': 0.28; 'crash': 0.29; 'disabling': 0.29; 'expose': 0.29; 'creating': 0.30; 'code': 0.30; 'related': 0.32; 'compiled': 0.32; 'though,': 0.32; 'problem': 0.33; 'source': 0.33; 'michael': 0.33; 'though.': 0.33; 'info': 0.34; 'gets': 0.35; 'received:google.com': 0.35; 'trouble': 0.35; 'could': 0.35; 'something': 0.35; 'comment': 0.35; 'but': 0.36; 'project': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'modules': 0.36; 'projects.': 0.36; 'visual': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'itself': 0.38; 'january': 0.38; 'version': 0.38; 'received:209': 0.38; 'self': 0.38; 'several': 0.38; 'or,': 0.38; 'goes': 0.39; 'along': 0.39; 'build': 0.40; 'where': 0.40; 'subject:with': 0.40; 'still': 0.40; 'some': 0.40; 'your': 0.60; 'our': 0.64; 'led': 0.72; '2013)': 0.84; '3.5.1': 0.84; 'chrisa': 0.84; 'versions)': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=IgDfO74npxZap+1q8bzhccX59JOeDflmYpYW6/ox+yM=; b=fUq6/G+vjSUR0Bz7NXMMU75AdyDyw/qWj3XbgzGXcH205XWAeE5skHgW/OdXuU4T+f 1hZc3Y30W/TlrQSjgQ+42SghLaeeStgsqzqfnNV7Ui4pVvdhAWv1m7zUphyq/++FsQ6Z JI0ZXK+vnKS0wdltUhAUJHh4xyhgsb++HcgCWJAoVckjgFEMOc8AZXllegFd5hHZJZSQ q5g/iEynvwwRJFtVQZ9BR05lcvdJf95CjG2SddNkZ4y7e+MNKI6I1Wzs6Gyhq5MEzJVS 98qBBlLeQ4eSgk1q43zLMvAYlU3yDcRs73go1l2sJsr7gLqhvtI52d8G/35H48cqlLmD 9ofw==
X-Received by 10.50.70.38 with SMTP id j6mr10747482igu.13.1452499780148; Mon, 11 Jan 2016 00:09:40 -0800 (PST)
In-Reply-To <c0a4d342-f8b5-48a6-b260-89d0458137cd@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:101468

Show key headers only | View raw


On Mon, Jan 11, 2016 at 6:55 PM, Rickard Englund
<gefle.rickard@gmail.com> wrote:
> On Friday, January 8, 2016 at 11:28:53 PM UTC+1, Michael Torrie wrote:
>> On 01/08/2016 09:18 AM, Rickard Englund wrote:
>> > First, some system info
>> > * Windows 7 (also tested on 8 and 10)
>> > * Python 3.5.1 64bit (previously also tested using several 3.x versions)  (also tested with 32 bit, but with 3.4.2)
>> > * Microsoft Visual Studio 2015 (earlier version of python also tested with Visual Studio 2013)
>>
>> Are you using the same version of Visual Studio that Python itself was
>> compiled with?  If not there can be subtle problems with incompatible
>> msvcrt dlls.  No idea if this would be contributing to the problem or
>> not, though.
>
> I've just downloaded the python source code and build it myself, the compiler settings in our project is the same as in the python projects.
>
>
> Though, your comment led me in the correct direction. When using the libs/binary I built my self it let me see the values of the PyObjects around the crash and it seems like it is related to our modules and/or how we expose them to the interpreter. When disabling our own modules everything seems to be working as it should.
>

Interesting. So somewhere along the way, you have native code (C
code?) that's creating a module, and that's where the trouble starts?
I would first look at all your refcount management; if that goes
wrong, all sorts of craziness could happen (if you still have a
pointer to a block of memory that gets released and reused, hilarity
will ensue - or, something will). Have you considered using Cython?
That might let you do what you need without worrying about all those
annoying internal API details.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Strange crash while running a script with a embedded python interpreter Rickard Englund <gefle.rickard@gmail.com> - 2016-01-08 08:18 -0800
  Re: Strange crash while running a script with a embedded python interpreter Rickard Englund <gefle.rickard@gmail.com> - 2016-01-08 08:29 -0800
  Re: Strange crash while running a script with a embedded python interpreter Michael Torrie <torriem@gmail.com> - 2016-01-08 15:28 -0700
    Re: Strange crash while running a script with a embedded python interpreter Rickard Englund <gefle.rickard@gmail.com> - 2016-01-10 23:55 -0800
      Re: Strange crash while running a script with a embedded python interpreter Chris Angelico <rosuav@gmail.com> - 2016-01-11 19:09 +1100
      Confused by python-dbus weird behavior Travis Griggs <travisgriggs@gmail.com> - 2016-01-11 14:14 -0800

csiph-web