From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106117 invoked by alias); 30 May 2018 20:09:31 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 106073 invoked by uid 89); 30 May 2018 20:09:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM,LOTS_OF_MONEY,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=sessions, AVR, avr, transfer X-HELO: mail-wr0-f175.google.com Received: from mail-wr0-f175.google.com (HELO mail-wr0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 May 2018 20:09:28 +0000 Received: by mail-wr0-f175.google.com with SMTP id f16-v6so15421218wrm.3 for ; Wed, 30 May 2018 13:09:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:mime-version :content-transfer-encoding; bh=W8Qb2AkVUwHRNeMDYlWmO6JrSaiRMBM2G7qCFW/5260=; b=fG4MaEV48qTJ3AUwFD6yq6DNSzJ+OGonQa+GnEIPykx5pSqrkeT2LVqbvRqWSi2grv EWR40rDwoyEPnAMckBeWb51dDq7ksaScX3VAv/McrtwLKKQWDj+nbO9O+J1Drjlf8/B3 2oqLl3hggG6N3z1qYcVML2oyMhy1lgnoX09uxTzV8SlOT7XZ6vsyN8veepXOINwXPkZ2 AaOskwjsWdXwIiyPWFtOe6h78JccAdVhamAW2bOzIJLK9XmeOf8dZqkVt4UCDSYGtafY FzoyazeoMyiVVzQMHbY6I5RhtI+wjxoJXHaWN8e08F+ZYK4edycG9JPtI+GCObe4VFZj rBrQ== X-Gm-Message-State: ALKqPwfDxBb03mxi+XgOxBZSkoHoS9Otl+6Jf9MPruqEIliT6inUIiy8 Ua8+18GOuorTIIDx+4rKfoteyg== X-Google-Smtp-Source: ADUXVKI8fAxGDcnsGMnIDvlz1HMdAUeTtm/RC2UsDdeL1zdmiyYarD2mpfOMfGy/+NKb79IUPdmmGQ== X-Received: by 2002:adf:c98c:: with SMTP id f12-v6mr3311688wrh.272.1527710965861; Wed, 30 May 2018 13:09:25 -0700 (PDT) Received: from [192.168.1.11] ([105.228.14.235]) by smtp.gmail.com with ESMTPSA id t198-v6sm22863797wmt.23.2018.05.30.13.09.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 13:09:25 -0700 (PDT) Message-ID: <1527710950.16578.23.camel@gmail.com> Subject: internal-error: target_xfer_partial: Assertion `*xfered_len > 0' failed From: Christo To: gdb@sourceware.org Cc: christo.crause@gmail.com Date: Wed, 30 May 2018 20:09:00 -0000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00031.txt.bz2 I'm writing a gdbserver that debugs AVR microcontrollers through the debugWIRE protocol. During debugging sessions avr-gdb sometimes generates an error.  From the info below the error appears to be an unexpected length for a reply, possibly caused by receiving the start for a new message before the end of a previous message(?). I suspect that it may have something to do with the remote serial protocol implementation on my side, but cannot figure out what.  Here is a sample gdb session of a simple program (with debug info) loaded into gdb (program is already loaded in microcontroller), the program is continued without break points, the program is interrupted by Ctrl+C.  During the subsequent transfer of memory content the error is triggered (often, but not always): [I interrupt the running code in gdb with Ctrl+C} Program received signal SIGINT, Interrupt. Sending packet: $m80015e,2#2e...Ack Packet received: 0030 Sending packet: $m50,10#5f...Ack Saw new packet start in middle of old one Timed out. Timed out. DELAY_MS (Ignoring packet error, continuing... ../../src/gdb/target.c:1376: internal-error: target_xfer_partial: Assertion `*xfered_len > 0' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) The corresponding traffic from the gdbserver RSP log: 19:08:04.421  Ctrl+C received 19:08:04.533  <- $T0200:12;01:00;02:08;03:00;04:00;05:80;06:10;07:09;08:E2;09:01;0A:00;0B:41;0C:00;0D:00;0E:00;0F :40;10:14;11:00;12:10;13:02;14:0D;15:20;16:00;17:00;18:09;19:00;1A:2A;1B:00;1C:84;1D:00;1E:86;1F :00;20:00;21:5D01;22:7C000000;#98 19:08:04.534  -> m72,a 19:08:04.548  <- $8115910531F0AFECB7E0#75 19:08:04.577  -> qL1160000000000000000 19:08:04.577  <- $qM0010000000000000000#4F 19:08:04.621  -> m80015e,2 19:08:04.628  <- $0030#C3 19:08:04.665  -> m50,10 19:08:04.677  <- $0ED0BC9A18BA20E126BB8AEF912D09D0#59 I don't see any response errors or overlapping replies on the server side... I get this error both on avr-gdb 7.10.1 (Installed by Linux Mint) and gdb 8.0 (which I compiled from source).  I don't see this error if I don't load the file with debug info into gdb. Also no error if I use gdb 7.0.1 or 6.6 (both also compiled by me). Any hints or ideas of where or what the problem may be? Regards, Christo