From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QcP1Lv7W/WWx2xEAWB0awg (envelope-from ) for ; Fri, 22 Mar 2024 15:07:42 -0400 Received: by simark.ca (Postfix, from userid 112) id B09911E0C0; Fri, 22 Mar 2024 15:07:42 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9DA241E08C for ; Fri, 22 Mar 2024 15:07:40 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5BF2E3858418 for ; Fri, 22 Mar 2024 19:07:40 +0000 (GMT) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by sourceware.org (Postfix) with ESMTPS id 7E1363858D1E for ; Fri, 22 Mar 2024 19:07:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E1363858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7E1363858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711134442; cv=none; b=N+bN7VmYPhH0REyBst929k9SB1UxkQujj73O3BXJgOD/XmRT7xZ+rKjWFELSyU+uPeHcOJldx/qytMes8frPcx6JIVxnMVI3rFbn+U1Sm6CCmnkqtZbl7cWXs371/MOlFiIffAWfd4VW0jZeKcOpN5yfqoppO/6/+whw/Y5MnMU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711134442; c=relaxed/simple; bh=qdkVnsOhLLVpk7edynAubSgsbiwExxCEDQ5Nee/q02M=; h=Message-ID:Date:MIME-Version:From:Subject:To; b=BA218SFAvA5iq1ydOzjjDhYPNk/G1Iucw9LsxUG/iJc8BfMhpy4pdDQ/Vh+Il4Qn1R9Rx+Dwgn+eDXj2TMW261P80Wnj3dY61H7JfUHbXdwe92Pj7RyBkQw3Y6V34uR84UO99EEl71HdKSg2s02vGtwoBsCg6jzj4UemWbn24T8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-33ed6078884so2035923f8f.1 for ; Fri, 22 Mar 2024 12:07:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711134431; x=1711739231; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cRs6CRJWaeRhMQmXe8fG2VzLNYLmyH8xaqJ3hOyNwUg=; b=DD1UuQa8gxGR3UJIotNGZLCoqgduRCxs0lPYBirgQ6j5aM0fbUATt4gMpq7kmOGEft te/3diXcs98GnQm0usr021ch2EK1YXQAMqmv8bIGvGefeMi1ItH/KOt0TLwudxk7lzbI 7xAY9SwCWEWi1iB5HiGMdI+Cb56m12RIsja+n1Q6egN6okhX9mOs1IpHw2MaYAYQZss9 bZx8UKBR+Z6Emeb1eMABVrh+nF/Z5BFLXltTegf2dtQH6aZe3sYSIFVV75tbpkAVvJF6 JfAkYmqo2tyU6arsUnOlSaEowfqH0ZsUaF3x4zhBvRu1nUuOfHHjuSM4nn9qF6ruPaoG 5Htw== X-Forwarded-Encrypted: i=1; AJvYcCXd26n/LyCzIkkleWvoxkwfO9Tod8lSBm5fruo5LFL5a8h0tlUyI5IqJ3dHkgzR2x0pub1TEmH7c8/MKy74SUuAXWc6APYpg1jYkA== X-Gm-Message-State: AOJu0Yx4byLer774R9zaiS20vmKWiwZ8oGUz1C5Zm+FM/fec8BIisaYr uVp7i9P2V8VKPmE2Y0F4GULKNgzxhYrVUAvrTOPKXhePSwZvmLdB X-Google-Smtp-Source: AGHT+IGX1Gg531Y5K6PYjD6kX4+kfvwuZFnJfEBSW9BPAWrcbjq2Jjxm9P0kysRpB9cahQV5mE/qkw== X-Received: by 2002:adf:f3cb:0:b0:33d:8c9d:419 with SMTP id g11-20020adff3cb000000b0033d8c9d0419mr409817wrp.24.1711134431311; Fri, 22 Mar 2024 12:07:11 -0700 (PDT) Received: from ?IPV6:2001:8a0:f918:ab00:3ba9:feec:1922:9a68? ([2001:8a0:f918:ab00:3ba9:feec:1922:9a68]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b003418016b04csm2667392wrt.76.2024.03.22.12.07.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Mar 2024 12:07:10 -0700 (PDT) Message-ID: <5eecc470-e96e-4c0e-bffe-464678fa3a94@palves.net> Date: Fri, 22 Mar 2024 19:07:09 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Pedro Alves Subject: Re: [PATCH] Better handling for realpath() failures in windows_make_so() on Cygwin To: Orgad Shaneh Cc: Jon Turney , gdb-patches@sourceware.org References: <20240321065417.1125-1-orgad.shaneh@audiocodes.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org On 2024-03-21 16:31, Orgad Shaneh wrote: > On Thu, Mar 21, 2024 at 6:13 PM Pedro Alves wrote: >> >> On 2024-03-21 14:45, Jon Turney wrote: >>> On 21/03/2024 06:53, Orgad Shaneh wrote: >>>> From: Jon Turney >>> >>> Not sure where this is coming from, but this doesn't seem to be my latest version of this patch. >>> >>>> Fix a memory leak which would occur in the case when the result of realpath() is >>>> greater than or equal to SO_NAME_MAX_PATH_SIZE. >>>> >>>> Distinguish between realpath() failing (returning NULL), and returning a path >>>> longer than SO_NAME_MAX_PATH_SIZE >>>> >>>> Warn rather than stopping with an error in those cases. >>> >>> This line in the patch commentary, and the title, refers to the part of the patch submitted [1], which is already applied as commit a0e9b53238c3033222c53b1654da535c0743ab6e. >>> >>> I separated that out because of the discussion starting at [2] ("Remove SO_NAME_PATH_SIZE instead"...) >>> >>> [1] https://sourceware.org/pipermail/gdb-patches/2020-January/164695.html >>> [2] https://sourceware.org/pipermail/gdb-patches/2016-January/130435.html > > I took it from MSYS2 patches, which were taken from cygwin patches, > but apparently diverged (possibly my fault, in > https://github.com/msys2/MSYS2-packages/pull/2475. Not sure why :)) > > Thanks for the references. I see that some of the work is already done > (so_name, so_original_name and so->name are all std::strings), so it > looks like there's not much left. Indeed. I actually thought the std::string conversion hadn't been merged yet. Should have checked. :-) So we can simplify this code already. I sent a series to clean up things: https://inbox.sourceware.org/gdb-patches/20240322190424.1231540-1-pedro@palves.net/T/ [PATCH 0/4] Down with SO_NAME_MAX_PATH_SIZE and windows_make_so spring cleaning [PATCH 1/4] Remove SO_NAME_MAX_PATH_SIZE limit from core solib code [PATCH 2/4] Simplify windows-nat.c:windows_make_so #ifdefery [PATCH 3/4] windows-nat: Remove SO_NAME_MAX_PATH_SIZE limit [PATCH 4/4] windows-nat: Use gdb_realpath Thanks, Pedro Alves > >> Curiously, after upstreaming your _sigbe unwinder recently, I looked at upstreaming this patch (the version of the 2016 patch >> in downstream cygwin gdb), but then this same thought of removing the limit hit me. (at least I'm consistent over the >> years, eh.) >> >> I then realized that Simon is working on a series that switches the solib path storage to a std::string, which will >> let us easily not use SO_NAME_MAX_PATH_SIZE at all in the Windows code. So I just dropped that patch from >> my upstreaming queue... > > Great! So I'll drop this patch. >