From owner-freebsd-usb@freebsd.org Fri Dec 18 22:02:37 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 203314AF5E0 for ; Fri, 18 Dec 2020 22:02:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CyNC007tSz3m0t for ; Fri, 18 Dec 2020 22:02:35 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4747526019C; Fri, 18 Dec 2020 23:02:32 +0100 (CET) Subject: Re: python / pyusb / libusb To: Tomasz CEDRO , "freebsd-usb@FreeBSD.org" References: From: Hans Petter Selasky Message-ID: <5738a2b8-d9e3-9c92-d9b6-9f73564a5f2a@selasky.org> Date: Fri, 18 Dec 2020 23:02:21 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CyNC007tSz3m0t X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.30 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; SPAMHAUS_ZRD(0.00)[2a01:4f8:c17:6c4b::2:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:c17:6c4b::2:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-usb] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2020 22:02:37 -0000 On 12/18/20 8:42 PM, Tomasz CEDRO wrote: > Hello world :-) > > Was there any substantial change in LibUSB / USB implementation in > FreeBSD stacks? I mean somewhere around 12.1 -> 12.2 upgrade? > > I have this nice pyOCD hardware debug utility that I use for embedded > systems debug for my everyday work. It started to segfault Python. All > of its versions even those older ones that worked fine before. So far > I could flash firmwares using other channel (UMS mass storage function > of the debug probe and it works fine), but I am getting to a point > where I need to debug target and it seems blocked for now. I also > reported this issue to the application tracker, but it may as well > look as problem on the OS side. > > This is strange because for instance Yubikey that uses the same Python > environment works fine. > > I have used hardfault module to backtrack Python crash :-) > > (venv37zephyr) pyocd list > Fatal Python error: Segmentation fault > > Current thread 0x0000000800a3a000 (most recent call first): > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/usb/backend/libusb1.py", > line 611 in __init__ > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/usb/backend/libusb1.py", > line 644 in __iter__ > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/usb/core.py", > line 1280 in device_iter > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py", > line 184 in get_all_connected_interfaces > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", > line 68 in _get_interfaces > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", > line 471 in get_connected_devices > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/probe/cmsis_dap_probe.py", > line 73 in get_all_connected_probes > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/probe/aggregator.py", > line 64 in get_all_connected_probes > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/core/helpers.py", > line 82 in get_all_connected_probes > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/core/helpers.py", > line 109 in list_connected_probes > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/__main__.py", > line 462 in do_list > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/__main__.py", > line 402 in run > File "/home/cd/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.28.1.dev97+dirty-py3.7.egg/pyocd/__main__.py", > line 931 in main > File "/home/cd/usr/local/venv37zephyr/bin/pyocd", line 11 in > Segmentation fault > > Any hints welcome :-) Maybe a ktrace / kdump will get you more hints. --HPS