From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 13AF74D915 for ; Wed, 2 Jul 2025 17:21:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 1C95368D546; Wed, 2 Jul 2025 20:21:52 +0300 (EEST) Received: from relay15.mail.gandi.net (relay15.mail.gandi.net [217.70.178.235]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 3208E68D392 for ; Wed, 2 Jul 2025 20:21:45 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9399C4427C for ; Wed, 2 Jul 2025 17:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1751476904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=P8Urd7WZU+MKS4/eSmAPryYcCKnY53iu+5Hiu+0cmaI=; b=W5iLuxsQ5WqyMn3LdEIrwOY1Tq5KlByEFIIjrZUfB4BOoIS/5H+/Gjh3ZzdEVOfVX664eG FUX+IfgWRXZulaYX2q+Gs4s+Vv8JTiw1XZ9C2mKT5dt7HfQH/P++BI1BmMSfyMRRB87s0L V0e1lFSfISrIM7E5HQOjoxHqv39E9Bf+xMvmbGS/oP6Sj4CN21sAHqrSkB6BI41I8cB32V GLzhTc5n9yKYGv1aiEJ8FLHiwUandeVJmWXQUEnm83EhXR4CkiQQjNfwy1nf2aFAUZrUvq U0Auwzi5tcpsN4/1Li7UBeYrVmJ82Vg1pxLLzrSIUISzKKkc+rXRv6RgMPih7Q== Date: Wed, 2 Jul 2025 19:21:43 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250702172143.GG29660@pb2> References: <20250702144355.GE29660@pb2> MIME-Version: 1.0 In-Reply-To: <20250702144355.GE29660@pb2> X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddujeellecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepieegkedtjeduffejhfetgeejtdegteetgfegtdfhjefgvefhteegkeejtddvhfevnecukfhppeeguddrieeirdeiiedrvddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeiiedrvddvjedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh Subject: Re: [FFmpeg-devel] [RFC] Advanced Error Codes X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============8812501762991911397==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8812501762991911397== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uuwGOpzxKTCeE3IN" Content-Disposition: inline --uuwGOpzxKTCeE3IN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 02, 2025 at 04:43:55PM +0200, Michael Niedermayer wrote: > Hi >=20 > People are asking for better error codes > Heres a quick pseodocode design / implementation / brainstorming: > I hope iam not re-doing some past one but i didnt quickly find a past dis= cussion >=20 > Observations. > Errors are for developers debuging or users resolving problems > We rarely care about more then 2-3 independant errors but we care abo= ut their history like from where they came and how and what arguments cause= d them > We also care about the error free case being fast, really fast > We are lazy we dont want maintaince burden > We also dont want to deal with maintaining matching cleanup for each = generated error >=20 > Idea 1 > + very simple > + fully compatible can be freely mixed with existing error codes > - needs a global table > + we never alloc, so we have no cleanup to do > + zero overhead for passing around as its just integers >=20 > Idea 2 (Alternatrive) > This is exactly like Idea 1 but using thread local instead of a globa= l tabl > + No mutex > + no global table > + no denial of service if a thread blasts errors out while another ha= s an occasional error > - Thread local table > - More complex and slow to move errors accross thread boundaries >=20 > For both ideas: > * New error codes are 64bit > * if they are trunctaed to 32bit they are a valid 32bit error code like A= VERROR(EIO) > * That means the new error codes are 32bit (existing error code for compa= tibility) and > 32bit (a identifier into a fixed size table.) [...] After reading Nicolas reply i think this can be described in a different wa= y: I think there are 1. Messages (Human language but also nummeric information) 2. Error codes (categorizing errors, some of which are usefull to programs, some to specific users) 3. Error instance identifiers (which identify the specific error and allow = us to associate messages and other things with it) What my suggestion really was, is to expand error codes in a 100% compatible way to become error instance identifiers. Which can then be used to lookup additional information for this specific instance of an error Or you could see it like this: before my suggestion: returned errors are broad categories after returned errors are identifying a specific individual error (with input= , URL source code location call stack and anything one wants to add to teh st= ruct) [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato --uuwGOpzxKTCeE3IN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaGVqpwAKCRBhHseHBAsP q21EAJ4vWxLawJJgXN8/5UwQPcnaAa6p8wCfex8plU+LkX7QJYdXP/f+Wnj+0ls= =zRxT -----END PGP SIGNATURE----- --uuwGOpzxKTCeE3IN-- --===============8812501762991911397== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============8812501762991911397==--