From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id A394F3858C29 for ; Wed, 7 Feb 2024 10:29:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A394F3858C29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A394F3858C29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707301748; cv=none; b=whq9zMZhu+spe2Hl1RXcX7TRgvYW219FqKv17d6U263P+UJtmF2Oi0JETqMeBczEoi7Djqd9x7pHt3NIXht+MSnf39580pq34FMy83D1eHrp3u3/uYeZDy/MEz5gC4gW6y5rE36m5HCfa7Fedf7n6SR/IXDaTPzta9wgHH5gLho= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707301748; c=relaxed/simple; bh=qfWqtPdJba/OeRSXRhMqmZ8lFMd1LVgfW5TojfYrkXU=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=dHJEvb/dKQWUjfjuqi+Vdk6yhPZxqAyJT7ewXeCkDL5pzZZY2INtWe2yWo8KDL0XOXY6XF6ICFztycRe5vx2stwF7uKQ6AdfLg+hVi79BQGYcJ/onvnYCpj7fdfInbHTf+wmxnPunxKdkbNWYsuxAAtGuCMlLn3G67hURBuLksg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (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) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C07FC2213B; Wed, 7 Feb 2024 10:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707301745; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LE/MpHOD5Ti0JA3VL/S18uGePxWlamI00LyBWTIi3Yc=; b=Wd4ACvMGo1WdFkvHXz2vafP1F4+skGwhoWBcw0ejeIw8p8wxQlNITsU92JKEdBcofruOpV /flMYR+EBTrBhj7u+VyhMGfPAlLsKVx4p7dHCCNvcduypp+JJ6UwCn2YbiLyoMhr2sgu9y kDmrG6JuoVGY0SeA7J2bkfe9ieVik5E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707301745; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LE/MpHOD5Ti0JA3VL/S18uGePxWlamI00LyBWTIi3Yc=; b=JcwQBc+LL+nC3BeOVcvhp/m3v0qU+WTetwK/K4JanUiLaXmvCDy1wCseOtl4WS9mbim5wD rCmd+ktQtCF2XWAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707301745; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LE/MpHOD5Ti0JA3VL/S18uGePxWlamI00LyBWTIi3Yc=; b=Wd4ACvMGo1WdFkvHXz2vafP1F4+skGwhoWBcw0ejeIw8p8wxQlNITsU92JKEdBcofruOpV /flMYR+EBTrBhj7u+VyhMGfPAlLsKVx4p7dHCCNvcduypp+JJ6UwCn2YbiLyoMhr2sgu9y kDmrG6JuoVGY0SeA7J2bkfe9ieVik5E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707301745; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LE/MpHOD5Ti0JA3VL/S18uGePxWlamI00LyBWTIi3Yc=; b=JcwQBc+LL+nC3BeOVcvhp/m3v0qU+WTetwK/K4JanUiLaXmvCDy1wCseOtl4WS9mbim5wD rCmd+ktQtCF2XWAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A7B9413931; Wed, 7 Feb 2024 10:29:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id BF6BJ3Fbw2V2YQAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 10:29:05 +0000 Message-ID: <6a588b22-2d3f-4a0d-8a84-b66b68ff9041@suse.de> Date: Wed, 7 Feb 2024 11:29:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 3/3] [gdb/dap] Ignore OSError on stream.flush in JSON writer Content-Language: en-US From: Tom de Vries To: gdb-patches@sourceware.org References: <20240207090224.27521-1-tdevries@suse.de> <20240207090224.27521-4-tdevries@suse.de> Cc: Tom Tromey In-Reply-To: <20240207090224.27521-4-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-0.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-0.61)[81.91%]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Level: X-Spam-Score: -0.70 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/7/24 10:02, Tom de Vries wrote: > Due to the previous two fixes, I can now run test-case gdb.dap/eof.exp without > coredumps happening. > > However, I do run into: > ... > FAIL: gdb.dap/eof.exp: exceptions in log file > ... > due to: > ... > JSON writer: caught exception: err=OSError(5, 'Input/output error'), > type(err)= > Traceback (most recent call last): > File "python/gdb/dap/startup.py", line 72, in thread_wrapper > target(*args) > File "python/gdb/dap/io.py", line 80, in _json_writer > stream.flush() > OSError: [Errno 5] Input/output error > ... > > I can image that the stream.flush would throw an OSError if it races with the > gdb main thread handling a SIGHUP and finalizing python in the process. > > Handle this is in the simplest way I can think of: ignore the OSError, and > terminate the DAP thread. I just found that the JSON reader thread does: ... except OSError: # Reading can also possibly throw an exception. Treat this as # EOF. log_stack(LogLevel.FULL) return None ... If we however threat this is in the JSON writer thread the same way, we get a FAIL from dap_check_log_file, because it checks for ^Traceback, which is generated by the log_stack. Thanks, - Tom