From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id urjRA2coPmY5Eg0AWB0awg (envelope-from ) for ; Fri, 10 May 2024 10:00:07 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Ymui3qyn; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id F20FB1E0C1; Fri, 10 May 2024 10:00:06 -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 DE5B11E030 for ; Fri, 10 May 2024 10:00:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F12C3842AC1 for ; Fri, 10 May 2024 14:00:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F12C3842AC1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1715349604; bh=pPxVzP91Ga8sfj2X2wiVlE3VECcgxYJJPVPdlYIMUuo=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Ymui3qynOyDUhN5IWShye8KJoWY/Ol2fjCzUIKvhqo1EGg/z5mL2SCBddAJWkT17o uWP+Y++YfopLTyyZ1h8NW9I4inZbyKf8Ut2xUkK7mYqa0rKom1Xv+Wgufu2YcWzgtf 3QoQgfevfbqgMFy1k9GkiqaoyLreQ9rMAkJXMM1I= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7482B38460B2 for ; Fri, 10 May 2024 13:59:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7482B38460B2 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7482B38460B2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715349559; cv=none; b=gSazhPRJs9Q2RDsvdddIFtvm+Zr3DrFhkohwn4tHBYl+R0VqD26kDehk1lvZgPx61uKeD6Zo3AVVDcDkcZecN1L97YBAPWhdlojRswFPJewdM869zgdY1reOeJD5L4C1H+qoWT2De3VncG50lKyyn+gYQ0Hph6MI7iisIg/3Xis= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715349559; c=relaxed/simple; bh=McaOg7iX+Cw/RGLnj8OrL+VvKsBMDvP+VavndJYsrss=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=MiWW1YiwTOvmd4ExU4+asMo3ppGS41nIaVyKdMA7yjof9tom4t3/VanlDWqpk1qDP+uh/Kmz5lPh1TcpWYYRSu9n8Bf8yC5Ez6RAO/qyUweWxekjq95kDE+Bj0nuXOsr78on3zOkfXi0drgZxjof4Y3mFY5/2bnNc4Ot9uaRtXY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-290-ucZOYCYAN9G2xHJbLkQQGw-1; Fri, 10 May 2024 09:59:15 -0400 X-MC-Unique: ucZOYCYAN9G2xHJbLkQQGw-1 Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-6f452eb2035so2072300b3a.0 for ; Fri, 10 May 2024 06:59:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715349554; x=1715954354; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pPxVzP91Ga8sfj2X2wiVlE3VECcgxYJJPVPdlYIMUuo=; b=q4nOqN8dDX8SZrDKwnOxKHGeRcdpAQ/dAhzGl8hHA2KRjCWjMBtwlubEsHeDkcSJnS JBkeUBVk+pPDUMrCPFuMMCHjhnJn3U3h4YYpS0/O2unnlLyUWO6lnRyDjQkbOGXkH/bI ScNuMK3mKdsxKJKkb7V7C4Go19GxrGv3cSGx0u0eSmdf/fORcSHCVl7qOg240zgX7LFg MabLPd0L9pRfliqySiJDGBf94/ZrnpP/HtmFWMNDqymepxWsh4QO0SRukIPrVtGNfORP IQOvs2u1GPWMp7kUAjuOIMeiwBboQhVKkSwoJi1I3G+aB1UMoKGHEzx+9Q+BYDT6bHYm dXig== X-Forwarded-Encrypted: i=1; AJvYcCWrx17W0AvQNEhnkVht84ZVbGPwdazrXQmQT213PtjWtMr/Di+IntZdfDFCaw+YWUdgX/LB7zF0C9KFMxRw07WMm40= X-Gm-Message-State: AOJu0YzC/Y5S7zcGNMll6RMlV34X8K44FP8hIQqa5perEydqt8waNxsE 6bdKgt7l/uswzn98sKfUJhG0ukG1CJ4KNCw37kvFFW+QaEDSbbVfBChGHzQO6hZiLQfAhxU5O4h 8cGBRxdFRrAf8y8tTYqDFX/gbEvvtdtjoiEktNRqOplRTiSylhDFPWlmA X-Received: by 2002:a05:6300:8081:b0:1af:b1d2:f13 with SMTP id adf61e73a8af0-1afde197a06mr2871543637.39.1715349554124; Fri, 10 May 2024 06:59:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFduB2EozoiOedLCxAfz5REx6rhWipRwDX41kFG2mW95GX2Ah6bjsroAeUZVLe6hzqGgYuP8Q== X-Received: by 2002:a05:6300:8081:b0:1af:b1d2:f13 with SMTP id adf61e73a8af0-1afde197a06mr2871519637.39.1715349553640; Fri, 10 May 2024 06:59:13 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:92c5::1000? ([2804:14d:8084:92c5::1000]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2afeafasm2955117b3a.165.2024.05.10.06.59.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 May 2024 06:59:13 -0700 (PDT) Message-ID: <1eba5c31-adc1-4b2b-a2a6-8f6a086d1a82@redhat.com> Date: Fri, 10 May 2024 10:59:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Error record and replay target doesn't support syscall number 435 To: Navin P , gdb@sourceware.org References: In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, SPF_HELO_NONE, SPF_NONE, 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@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Guinevere Larsen via Gdb Reply-To: Guinevere Larsen Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On 5/10/24 05:07, Navin P via Gdb wrote: > Hi, > I tried to record a program calling C++ threads and then did a > break on main , then record and continue it throws the error message > "record and replay target doesn't support syscall number 435" . What > should I do to support syscall number 435 ? Hi! I can't answer everything, since I'm not too familiar with syscalls specifically, but I'll do my best! My first road bump with this is that we record that a clone has happened, but we can only record the process that GDB is following (parent or child, depending on follow-fork-mode). This is counter-intuitive to me, since I would have expected the full inferior to be replayed. It can be enough for some users, and I think changing this behavior would be extremely difficult - if at all possible, but if we're updating this area, I'd like to have this limitations mentioned either in the manual (section 7 - Recording Inferior's Execution and Replaying It) or having an extra warning when GDB detects that a fork has happened and we're recording, or both :) > > I was thinking of adding amd64_sys_clone3 = 435 to amd64-linux-tdep.h > In amd64-linux-tdep.c add case amd64_sys_clone3: return gdb_sys_clone3; > In linux-record.h gdb_sys_clone3=541 in enum gdb_syscall these 3 changes make sense to me > In linux-record.c case gdb_sys_clone3=break; > > > Is it necessary to do the record_mem_at_reg for clone3 ? Why isn't it > done for clone ? This is where my lack of syscall (and possibly clone) knowledge comes in. What did you expect to record with this call? I am guessing the stack that you passed to the child, and if that is the case, I don't think we should. Imagine that you have stayed on the parent process, and started stepping back while the child process is still executing. You would fully rewrite the memory of the child, making it read the wrong values, and if you move forward again, the new writes that the child did will be undone as we reset the stack. If it is something else, do let me know! (and if you have technical descriptions of what's going on that don't include me reading kernel source code, I'd be tankful :3 ) -- Cheers, Guinevere Larsen She/Her/Hers > > Below is gdb log and after that is source code > > gdb ./a.out > GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1 > Copyright (C) 2022 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > Type "show copying" and "show warranty" for details. > This GDB was configured as "x86_64-linux-gnu". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > . > Find the GDB manual and other documentation resources online at: > . > > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from ./a.out... > (gdb) b main > Breakpoint 1 at 0x134b: file race1.cpp, line 30. > (gdb) r > Starting program: /home/navin/cpp/a.out > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > > Breakpoint 1, main () at race1.cpp:30 > 30 int main(){ > (gdb) record full > (gdb) c > Continuing. > Process record and replay target doesn't support syscall number 435 > Process record: failed to record execution log. > > Program stopped. > clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:60 > 60 ../sysdeps/unix/sysv/linux/x86_64/clone3.S: No such file or directory. > (gdb) shell uname -a > Linux Navin-acer-5740 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 > 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux > (gdb) shell cat /etc/lsb-release > DISTRIB_ID=LinuxMint > DISTRIB_RELEASE=21.2 > DISTRIB_CODENAME=victoria > DISTRIB_DESCRIPTION="Linux Mint 21.2 Victoria" > (gdb) > > > Source Code > > #include > #include > using namespace std; > > int g=0; > int *p=&g; > bool run=true; > > void t1() > { > while(run) > { > g++; > if(g==16) > p=nullptr; > > } > } > > void t2() > { > int z; > while(run) > { > g--; > z=*p+1; > } > } > > int main(){ > thread x1{t1}; > thread x2{t2}; > sleep(5); > run=false; > x1.join(); > x2.join(); > cout < } > > > > Regards, > Navin >