public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files
@ 2013-08-01 12:16 kdevel at vogtner dot de
  2013-08-01 12:19 ` [Bug corefiles/15810] " kdevel at vogtner dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: kdevel at vogtner dot de @ 2013-08-01 12:16 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

            Bug ID: 15810
           Summary: gdb 7.3.1/7.5 unlink files
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: corefiles
          Assignee: unassigned at sourceware dot org
          Reporter: kdevel at vogtner dot de

./configure --prefix=/tmp/loc2
make
make install
strace -fFeunlink /tmp/loc2/bin/gdb

Output:

unlink("/tmp/loc2/share/gdb/python/gdb/command/__init__.pyc") = 0
unlink("/tmp/loc2/share/gdb/python/gdb/command/explore.pyc") = 0
unlink("/tmp/loc2/share/gdb/python/gdb/command/prompt.pyc") = 0
unlink("/tmp/loc2/share/gdb/python/gdb/prompt.pyc") = 0
unlink("/tmp/loc2/share/gdb/python/gdb/command/pretty_printers.pyc") = 0

Starting or running gdb shall never unlink files in the fs subtree where
software is installed. gdb at least of version 7.3.1 performs some additional
unlinks in the part of the filesystem where the compiler is installed when the
"run" command is issued:

unlink </.../gcc-4.6.4/lib64/../share/gcc-4.6.4/python/libstdcxx/__init__.pyc>
unlink
</.../gcc-4.6.4/lib64/../share/gcc-4.6.4/python/libstdcxx/v6/__init__.pyc>
unlink
</.../gcc-4.6.4/lib64/../share/gcc-4.6.4/python/libstdcxx/v6/printers.pyc>

which cannot be straced but be intercepted with a preloaded shared object.

All this can be circumvented by using "--with-python=no" as configuration
parameter.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug corefiles/15810] gdb 7.3.1/7.5 unlink files
  2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
@ 2013-08-01 12:19 ` kdevel at vogtner dot de
  2013-08-01 12:43 ` [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories kdevel at vogtner dot de
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kdevel at vogtner dot de @ 2013-08-01 12:19 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

Stefan <kdevel at vogtner dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|7.5                         |7.3

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories
  2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
  2013-08-01 12:19 ` [Bug corefiles/15810] " kdevel at vogtner dot de
@ 2013-08-01 12:43 ` kdevel at vogtner dot de
  2013-08-02 14:19 ` tromey at redhat dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kdevel at vogtner dot de @ 2013-08-01 12:43 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

Stefan <kdevel at vogtner dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|gdb 7.3.1/7.5 unlink files  |gdb 7.3.1/7.5 unlinks and
                   |                            |creates .pyc-files in
                   |                            |non-user directories

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories
  2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
  2013-08-01 12:19 ` [Bug corefiles/15810] " kdevel at vogtner dot de
  2013-08-01 12:43 ` [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories kdevel at vogtner dot de
@ 2013-08-02 14:19 ` tromey at redhat dot com
  2013-08-02 14:40 ` kdevel at vogtner dot de
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at redhat dot com @ 2013-08-02 14:19 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tromey at redhat dot com
         Resolution|---                         |INVALID

--- Comment #1 from Tom Tromey <tromey at redhat dot com> ---
These unlinks come from libpython, not gdb.
They are part of Python's byte-compilation approach.
I don't think there is anything we can do about them.
So, I'm closing this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories
  2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
                   ` (2 preceding siblings ...)
  2013-08-02 14:19 ` tromey at redhat dot com
@ 2013-08-02 14:40 ` kdevel at vogtner dot de
  2013-08-02 16:44 ` tromey at redhat dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kdevel at vogtner dot de @ 2013-08-02 14:40 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

Stefan <kdevel at vogtner dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from Stefan <kdevel at vogtner dot de> ---
(In reply to Tom Tromey from comment #1)
> These unlinks come from libpython, not gdb.

libpython is compiled/linked into gdb therefore these unlinks come from gdb.

> They are part of Python's byte-compilation approach.

And who has "bought" that?

> I don't think there is anything we can do about them.

You can to lots of different things only limited by your imagination:

1. You may warn the user who compiles gdb or the end user about this side
   effects.
2. You can make --with-python=no the default.
3. You can remove the python support.

> So, I'm closing this.

Can you tell me a side effect in libpython which would be strong enough to
motivate you not to close this bug?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories
  2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
                   ` (3 preceding siblings ...)
  2013-08-02 14:40 ` kdevel at vogtner dot de
@ 2013-08-02 16:44 ` tromey at redhat dot com
  2013-08-02 18:16 ` kdevel at vogtner dot de
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at redhat dot com @ 2013-08-02 16:44 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Tom Tromey <tromey at redhat dot com> ---
My point is that this is a generic problem with Python.
If a fix must be made, it must be made there.
I don't think any of your proposed solutions are realistic.
Please don't reopen this bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories
  2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
                   ` (4 preceding siblings ...)
  2013-08-02 16:44 ` tromey at redhat dot com
@ 2013-08-02 18:16 ` kdevel at vogtner dot de
  2013-08-02 18:43 ` tromey at redhat dot com
  2013-08-02 19:15 ` kdevel at vogtner dot de
  7 siblings, 0 replies; 9+ messages in thread
From: kdevel at vogtner dot de @ 2013-08-02 18:16 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

--- Comment #4 from Stefan <kdevel at vogtner dot de> ---
(In reply to Tom Tromey from comment #3)
> My point is that this is a generic problem with Python.

I doubt that python considers its own documented behavior [1] as problem. The
problem stems from the integration of python into gdb.

> I don't think any of your proposed solutions are realistic.

This fixes the issue:

gdb/python/python.c:
   1230   setenv ("PYTHONDONTWRITEBYTECODE", "1", 1);
   1231   Py_Initialize ();
   1232   PyEval_InitThreads ();

[1] http://docs.python.org/2/tutorial/modules.html#compiled-python-files

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories
  2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
                   ` (5 preceding siblings ...)
  2013-08-02 18:16 ` kdevel at vogtner dot de
@ 2013-08-02 18:43 ` tromey at redhat dot com
  2013-08-02 19:15 ` kdevel at vogtner dot de
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at redhat dot com @ 2013-08-02 18:43 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

--- Comment #5 from Tom Tromey <tromey at redhat dot com> ---
>>   setenv ("PYTHONDONTWRITEBYTECODE", "1", 1);

Why should gdb in particular do this?
I think most things linked against libpython do not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories
  2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
                   ` (6 preceding siblings ...)
  2013-08-02 18:43 ` tromey at redhat dot com
@ 2013-08-02 19:15 ` kdevel at vogtner dot de
  7 siblings, 0 replies; 9+ messages in thread
From: kdevel at vogtner dot de @ 2013-08-02 19:15 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15810

--- Comment #6 from Stefan <kdevel at vogtner dot de> ---
(In reply to Tom Tromey from comment #5)
> >>   setenv ("PYTHONDONTWRITEBYTECODE", "1", 1);
> 
> Why should gdb in particular do this?

In order to switch off the undesired side effect which may even be a security
issue (i.e. symlink attack, have not checked this yet).

> I think most things linked against libpython do not.

I think most of the things linked against libpython are not debuggers run by
root.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-08-02 19:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01 12:16 [Bug corefiles/15810] New: gdb 7.3.1/7.5 unlink files kdevel at vogtner dot de
2013-08-01 12:19 ` [Bug corefiles/15810] " kdevel at vogtner dot de
2013-08-01 12:43 ` [Bug corefiles/15810] gdb 7.3.1/7.5 unlinks and creates .pyc-files in non-user directories kdevel at vogtner dot de
2013-08-02 14:19 ` tromey at redhat dot com
2013-08-02 14:40 ` kdevel at vogtner dot de
2013-08-02 16:44 ` tromey at redhat dot com
2013-08-02 18:16 ` kdevel at vogtner dot de
2013-08-02 18:43 ` tromey at redhat dot com
2013-08-02 19:15 ` kdevel at vogtner dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).