From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id 137F5240B6 for ; Tue, 23 Jan 2024 01:20:24 +0100 (CET) Received: from mail-qk1-f172.google.com ([209.85.222.172]) by 9front; Mon Jan 22 19:19:24 -0500 2024 Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-7838af983c1so291339885a.3 for <9front@9front.org>; Mon, 22 Jan 2024 16:19:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705969162; x=1706573962; darn=9front.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=iteVk0iEY3eTlg1/PwvLe2nlbD2/tx17dmm5yJhBDos=; b=kqJnEDPsUAXgt0A34KE9LwvNiufNoU+zpNAWXvS79coZdZ6yH/888UosZJcxIRdElB XMnxNfuX/O4vZHPUz+oAkSxJRlxMHmi4TZfN0Pmz8sToFILlucsr0+bmVXhox1jCydKE XOdOEF4UOJtEbo88R/MZy76K3B/TzU3R8M9fZrlu4opLge1BPAm52VwAe6R3v7EP/YZV 0pN3hG/oKhSLPK7DRglzNu0Wfx3tvHD2M4vNzEyKtXBA6qLHtVtyJC5GAUNQxMmqWeYV LPtJ/Nljv6o6OwMTsqBLHq1vq5HjBcuM3iKxhgil8Gh1ZGhb2yIqrjXSgqr9agh8H1bE l0dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705969162; x=1706573962; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iteVk0iEY3eTlg1/PwvLe2nlbD2/tx17dmm5yJhBDos=; b=rXn29yoih9TNyyQhQx4cqAh7q/ftR1Nc7nOdXfKDcofEmkrM5JTcb8T1AmksPlfd3B pDVIkAi/Y0v4X8O4p4gWmXzLwDut0aXyg4uQhOSgZ5jum3KK05bhDt1VemZJSujtMp4x T84hglCSRIfPGaPwgedmqxFY+pd/Jrly3msW96X4pWsfbSjTAJEEvZH5ejqp4W1t4Do5 9UpD1U09Y5SjAQTLCZ26IuT2t2zV2k8Gp9ACsOZrJtisfTY5AG7eQVzmGWo4dzf1bam7 na78XkRGwztcLTwQfb0ctZfg8l8daOLALSVGlpIlnm5GkXSkTPS8ukOu6kDOH1xkPzJx OWOA== X-Gm-Message-State: AOJu0YwrWLzywcGN/TPJYhwAWLsqXYVP6HlU3Qiu5YeIZjS6UB3Fbeft r52UJ0C9CclNRb7+unx+k7SA5YuO6bbSearPxYcclvOkcBdFSMICVmU2xa36 X-Google-Smtp-Source: AGHT+IFDJxCEJYSeggmRdGrTZw64KmG8OxtlSJsLj6LQ/iZ0O42KAlzmkiTZTnjAKY5EBRCD8tIgYQ== X-Received: by 2002:a05:6214:d04:b0:685:d5f3:8b6c with SMTP id 4-20020a0562140d0400b00685d5f38b6cmr54934qvh.97.1705969161621; Mon, 22 Jan 2024 16:19:21 -0800 (PST) Received: from smtpclient.apple (c-73-210-224-225.hsd1.il.comcast.net. [73.210.224.225]) by smtp.gmail.com with ESMTPSA id om8-20020a0562143d8800b006869bc1fc0esm650123qvb.11.2024.01.22.16.19.20 for <9front@9front.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2024 16:19:21 -0800 (PST) From: Xiao-Yong Jin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Message-Id: <62F053FB-B410-4ADA-A066-B2DD1DD70A6D@gmail.com> Date: Mon, 22 Jan 2024 18:19:09 -0600 To: 9front@9front.org X-Mailer: Apple Mail (2.3774.300.61.1.2) List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: lossless property table optimizer Subject: [9front] drawterm gui-cocoa/screen.m display() needs a drawlock Reply-To: 9front@9front.org Precedence: bulk If a screen resize happens between blit command encoding and command buffer execution, drawterm will crash, because the encoded _texture gets replaced by screensize() and no longer points to valid memory. The following patch adds the drawlock to keep _texture consistent. % diff -u gui-metal/screen.m gui-cocoa/screen.m --- a/gui-cocoa/screen.m 2024-01-22 17:59:15 +++ b/gui-cocoa/screen.m 2023-08-22 00:20:02 @@ -937,9 +931,6 @@ } blit = [cbuf blitCommandEncoder]; + + qlock(&drawlock); + [blit copyFromTexture:_texture sourceSlice:0 sourceLevel:0 @@ -961,7 +952,6 @@ }else{ LOG(@"command buffer finished"); } + qunlock(&drawlock); }]; [cbuf commit]; }