Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

What is algebra, exactly? Is it one of those three-cornered things? -- J. M. Barrie


devel / comp.lang.python / Re: Embedding Python crash on PyTuple_New

SubjectAuthor
o Re: Embedding Python crash on PyTuple_NewMRAB

1
Re: Embedding Python crash on PyTuple_New

<mailman.17.1637689449.31677.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16180&group=comp.lang.python#16180

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: pyt...@mrabarnett.plus.com (MRAB)
Newsgroups: comp.lang.python
Subject: Re: Embedding Python crash on PyTuple_New
Date: Tue, 23 Nov 2021 17:44:07 +0000
Lines: 32
Message-ID: <mailman.17.1637689449.31677.python-list@python.org>
References: <d0b57569-ef0d-3ab4-9918-9cd498f1e658@sphaero.org>
<4eb693c6-fd5f-7c54-246d-0b081a0488d5@mrabarnett.plus.com>
<c827faf9-0871-fde3-83a0-fa19576b3c62@sphaero.org>
<d6c7a17a-b24c-9a45-a94e-7bbc3d8fb1c1@mrabarnett.plus.com>
<f7711e63-a9a7-eb7a-b2b1-0c7ebd9829af@mrabarnett.plus.com>
<8788bcb1-5e02-b241-3533-43c40d363906@sphaero.org>
<1d070d88-8b19-c1ea-c700-4a47876fe871@mrabarnett.plus.com>
<8bf13799-ebcc-5110-3944-c0ad7e9b933c@mrabarnett.plus.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de Mt6zr1zVoGXRPEQq4kdUMAq2QjznsMpgrXfCe3XlgrSA==
Return-Path: <python@mrabarnett.plus.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=plus.com header.i=@plus.com header.b=bdWr3ABa;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'url-ip:140.82/16': 0.03;
'const': 0.09; 'docs,': 0.09; 'from:addr:python': 0.09;
'received:192.168.1.64': 0.09; 'skip:z 20': 0.09;
'subject:Python': 0.12; 'url:github': 0.14; 'problem.': 0.15;
'url-ip:140/8': 0.15; '"after': 0.16; '[snip]': 0.16; 'char':
0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab':
0.16; 'message-id:@mrabarnett.plus.com': 0.16;
'received:plus.net': 0.16; 'reference,': 0.16; 'times,': 0.16;
'wrote:': 0.16; 'python': 0.16; 'to:addr:python-list': 0.20;
'returns': 0.22; 'skip:_ 10': 0.22; 'else': 0.27; 'function':
0.27; 'header:User-Agent:1': 0.30; 'think': 0.32;
'received:192.168.1': 0.32; 'but': 0.32; "i'm": 0.33; 'header:In-
Reply-To:1': 0.34; 'yes,': 0.35; 'count': 0.36; 'errors': 0.36;
'received:192.168': 0.37; 'way': 0.38; 'could': 0.38; 'enough':
0.39; 'something': 0.40; 'reference': 0.60; 'received:212': 0.62;
'skip:z 10': 0.62; 'drop': 0.69; 'interesting': 0.71; 'attention':
0.71; 'sure.': 0.84; 'surprised': 0.84; 'caused': 0.86
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019;
t=1637689448; bh=GbmxvcZgB6ddKW/0g+ZCQUaj81XJukPB05LfagCGhEs=;
h=Date:Subject:From:To:References:In-Reply-To;
b=bdWr3ABaUPk99hh8U7ZNtIEqOARNdLJozs19B/WMSrjcwcp/WZfRHk6NIDSC6I/X9
frhOW+hY5V9nJCSr0RJD/4tI7WP695azrGKatif8t49F47NKoijE17wCS5NkBhkoql
dvPTPp+CKy/YnDt9mdbwYbvUKrMShVRwY6RG8gKgNWaULl0YkerxB3szvD2JtIb6Cw
3cKf8c4MdkA1dSXUZHUe2VtROX8vt5lXXgmOjeHnLrVWJyKldVpeit2Cg3hQd+fVBF
y9XostVTeZ0BeUXZ/OXDq/dZdVSOzBTsope+QmLRE4wH3FSEE1wQSCdHrZqzEsIurq
UEowDoBmsf/Zw==
X-Clacks-Overhead: "GNU Terry Pratchett"
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.4 cv=Ev+xEQQA c=1 sm=1 tr=0 ts=619d2868
a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17
a=IkcTkHD0fZMA:10 a=NEAV23lmAAAA:8 a=lcxE6Dm_7LhYinPljC4A:9 a=QEXdDO2ut3YA:10
X-AUTH: mrabarnett@:2500
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Content-Language: en-GB
In-Reply-To: <1d070d88-8b19-c1ea-c700-4a47876fe871@mrabarnett.plus.com>
X-CMAE-Envelope: MS4xfG7CA8XLYTHADSymQU1NGZP1Yb2/QJl28Ron2n8c00hhZaj8LT1ZePM7GQQuyHN1FDRgEW2pFUP7QbungNqacegAOOatnrM9CsJAo78Gn5tIo4ip1QoE
kLEB7RYaly7vS84z+c9ib1fYsyymcmeG90ZcJLuvOpeaRw9BgDLCRyxq1XqUWufI51jkHWFCPtkFAEcNEGazMLPIQYPmAU4/ieE=
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.37
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: <https://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>
X-Mailman-Original-Message-ID: <8bf13799-ebcc-5110-3944-c0ad7e9b933c@mrabarnett.plus.com>
X-Mailman-Original-References: <d0b57569-ef0d-3ab4-9918-9cd498f1e658@sphaero.org>
<4eb693c6-fd5f-7c54-246d-0b081a0488d5@mrabarnett.plus.com>
<c827faf9-0871-fde3-83a0-fa19576b3c62@sphaero.org>
<d6c7a17a-b24c-9a45-a94e-7bbc3d8fb1c1@mrabarnett.plus.com>
<f7711e63-a9a7-eb7a-b2b1-0c7ebd9829af@mrabarnett.plus.com>
<8788bcb1-5e02-b241-3533-43c40d363906@sphaero.org>
<1d070d88-8b19-c1ea-c700-4a47876fe871@mrabarnett.plus.com>
 by: MRAB - Tue, 23 Nov 2021 17:44 UTC

On 2021-11-23 17:31, MRAB wrote:
> On 2021-11-23 16:04, Arnaud Loonstra wrote:
[snip]
>>
>> I would turn my attention to s_py_zosc function but I'm not sure. Since
>> the errors are GC related it could caused anywhere?
>>
> Basically, yes, but I won't be surprised if it was due to too few
> INCREFs or too many DECREFs somewhere.
>
>> https://github.com/hku-ect/gazebosc/blob/505b30c46bf3f78d188c3f575c80e294d3db7e5d/Actors/pythonactor.c#L286
>>
> Incidentally, in s_py_zosc_tuple, you're not doing "assert(rc == 0);"
> after "after zosc_pop_float" or "zosc_pop_double".
>
Here's something interesting in s_py_zosc:

PyTypeObject* type = Py_TYPE(item);
const char * typename = _PyType_Name(type);
if (streq(typename, "c_int"))
{
zsys_warning("Unsupported ctypes.c_int until we find a
way to access the value :S");
}
else
zsys_warning("unsupported python type");

Py_DECREF(type);

According to the docs, Py_TYPE returns a borrowed reference, but you're
DECREFing it. If you call s_py_zosc enough times, the reference count of
the type will drop to 0. I think that might be the problem.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor