From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7FB033858426; Fri, 10 Sep 2021 19:36:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FB033858426 From: "mehmetgelisin at aol dot com" To: glibc-bugs@sourceware.org Subject: [Bug string/17279] strncat(..., ..., SIZE_MAX) behaves incorrectly Date: Fri, 10 Sep 2021 19:36:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: string X-Bugzilla-Version: 2.19 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mehmetgelisin at aol dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 19:36:49 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D17279 Mehmet gelisin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mehmetgelisin at aol dot c= om --- Comment #3 from Mehmet gelisin --- In collect_register() function of arc-linux-tdep.c, the "eret" (exception return) register value is not being reported correctly. Background: https://komiya-dental.com/=20 When asked for the "pc" value, we have to update the "eret" register with GDB's STOP_PC. The "eret" instructs the kernel code where to jump back when an instruction has stopped due to a breakpoint. This is how collect_register() is doing so: --------------8<-------------- if (regnum =3D=3D gdbarch_pc_regnum (gdbarch)) regnum =3D ARC_ERET_REGNUM; regcache->raw_collect (regnum, buf + arc_linux_core_reg_offsets[regnum]); -------------->8-------------- Root cause: http://www.iu-bloomington.com/ Although this is using the correct offset (ERET register's), it is also changing the REGNUM itself. Therefore, raw_collect (regnum, ...) is not reading from "pc" anymore. Consequence: This bug affects the "native ARC gdb" badly and causes kernel code to jump to addresses after the breakpoint and not executing the "breakpoint"ed instructions at all. That "native ARC gdb" feature is not upstream yet and is in review at the time of writing [1]. https://www.webb-dev.co.uk/=20 In collect_register() function of arc-linux-tdep.c, the "eret" (exception return) register value is not being reported correctly. Background: https://waytowhatsnext.com/=20=20 When asked for the "pc" value, we have to update the "eret" register with GDB's STOP_PC. The "eret" instructs the kernel code where to jump back when an instruction has stopped due to a breakpoint. This is how collect_register() is doing so: --------------8<-------------- if (regnum =3D=3D gdbarch_pc_regnum (gdbarch)) regnum =3D ARC_ERET_REGNUM; http://www.acpirateradio.co.uk/=20 regcache->raw_collect (regnum, buf + arc_linux_core_reg_offsets[regnum]); -------------->8-------------- Root cause: Although this is using the correct offset (ERET register's), it is also changing the REGNUM itself. Therefore, raw_collect (regnum, ...) is not reading from "pc" anymore. http://www.logoarts.co.uk/=20 Consequence: This bug affects the "native ARC gdb" badly and causes kernel code to jump to addresses after the breakpoint and not executing the "breakpoint"ed instructions at all. That "native ARC gdb" feature is not upstream yet and is in review at the time of writing [1]. In collect_register() function of arc-linux-tdep.c, the "eret" http://www.slipstone.co.uk/=20 (exception return) register value is not being reported correctly. Background: When asked for the "pc" value, http://embermanchester.uk/ we have to update the "eret" register with GDB's STOP_PC. The "eret" instructs the kernel code where to jump back when an instruction has stopped due to a breakpoint. This is how collect_register() is doing so: http://connstr.net/=20 --------------8<-------------- if (regnum =3D=3D gdbarch_pc_regnum (gdbarch)) http://joerg.li/ regnum =3D ARC_ERET_REGNUM; regcache->raw_collect (regnum, buf + arc_linux_core_reg_offsets[regnum]); -------------->8-------------- http://www.jopspeech.com/ Root cause: Although this is using the correct offset (ERET register's), it is also changing the REGNUM itself. Therefore, raw_collect (regnum, ...) is not reading from "pc" anymore. http://www.wearelondonmade.com/ Consequence: This bug affects the "native ARC gdb" badly and causes kernel code to jump to addresses http://www.compilatori.com/ after the breakpoint and not executing the "breakpoint"ed instructions at all. That "native ARC gdb" feature is not upstream yet and is in review at the time of writing [1]. http://www-look-4.com/ --=20 You are receiving this mail because: You are on the CC list for the bug.=