From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 69E03385782B; Sat, 5 Dec 2020 07:35:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69E03385782B From: "ppluzhnikov at google dot com" To: gdb-prs@sourceware.org Subject: [Bug python/27021] New: Python Exception 'NoneType' object has no attribute 'pointer': when using pretty-printer Date: Sat, 05 Dec 2020 07:35:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: 9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppluzhnikov at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2020 07:35:17 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27021 Bug ID: 27021 Summary: Python Exception 'NoneType' object has no attribute 'pointer': when using pretty-printer Product: gdb Version: 9.1 Status: NEW Severity: normal Priority: P2 Component: python Assignee: unassigned at sourceware dot org Reporter: ppluzhnikov at google dot com Target Milestone: --- Not sure whether this reproduces at head, but suspect it does. gdb ./a.out core.111836=20 GNU gdb (GDB) Fedora 9.1-6.fc32 ... Reading symbols from ./a.out... [New LWP 111836] Core was generated by `./a.out'. Program terminated with signal SIGABRT, Aborted. #0 0x00007f8589eb89e5 in raise () from /lib64/libc.so.6 Missing separate debuginfos, use: dnf debuginfo-install glibc-2.31-4.fc32.x86_64 libgcc-10.2.1-6.fc32.x86_64 libstdc++-10.2.1-6.fc32.x86_64 (gdb) p foo_map $1 =3D std::map with 2 elements =3D {[1] =3D 10, [2] =3D 20} <<<=3D=3D=3D= expected output (gdb) q Now install debuginfo and try again (same binary and core): sudo dnf debuginfo-install glibc-2.31-4.fc32.x86_64 libgcc-10.2.1-6.fc32.x8= 6_64 libstdc++-10.2.1-6.fc32.x86_64 gdb ./a.out core.111836=20 GNU gdb (GDB) Fedora 9.1-6.fc32 ... Reading symbols from ./a.out... [New LWP 111836] Core was generated by `./a.out'. Program terminated with signal SIGABRT, Aborted. #0 __GI_raise (sig=3Dsig@entry=3D6) at ../sysdeps/unix/sysv/linux/raise.c:= 50 50 return ret; (gdb) p foo_map Python Exception 'NoneType' object has no attribute 'pointer': <<<=3D=3D=3D bug $1 =3D std::map with 2 elements (gdb) up #1 0x00007f8589ea1895 in __GI_abort () at abort.c:79 79 raise (SIGABRT); (gdb) p foo_map Python Exception 'NoneType' object has no attribute 'pointer': <<<=3D=3D=3D bug $2 =3D std::map with 2 elements (gdb) up #2 0x000000000040123b in foo () at foo.cc:10 10 abort(); (gdb) p foo_map $3 =3D std::map with 2 elements =3D {[1] =3D 10, [2] =3D 20} <<<=3D=3D=3D= now works! (gdb) down #1 0x00007f8589ea1895 in __GI_abort () at abort.c:79 79 raise (SIGABRT); (gdb) p foo_map Python Exception 'NoneType' object has no attribute 'pointer': <<<=3D=3D=3D bug $4 =3D std::map with 2 elements It looks like GDB is trying to look up std::map::pointer in the DSO for cur= rent frame despite the symbol being defined in a.out and having nothing to do wi= th current frame. Source for a.out: --- main.cc --- int foo(); int main() { return foo(); } --- foo.cc --- #include #include std::map foo_map; int foo() { foo_map[1] =3D 10; foo_map[2] =3D 20; abort(); } Build with 'g++ -g main.cc foo.cc' --=20 You are receiving this mail because: You are on the CC list for the bug.=