public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/26645] New: dwz does not remove a tmp file when working on perf
@ 2020-09-22 10:54 jirislaby at gmail dot com
  2020-10-01 13:19 ` [Bug default/26645] " mark at klomp dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jirislaby at gmail dot com @ 2020-09-22 10:54 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=26645

            Bug ID: 26645
           Summary: dwz does not remove a tmp file when working on perf
           Product: dwz
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: nobody at sourceware dot org
          Reporter: jirislaby at gmail dot com
                CC: dwz at sourceware dot org
  Target Milestone: ---

Our (openSUSE) build of perf results in 2 binaries trace & perf (ls -li):
> 43866954 -rwxr-xr-x 2 abuild abuild 16704336 zář 22 09:15 perf
> 43866954 -rwxr-xr-x 2 abuild abuild 16704336 zář 22 09:15 trace

They are hard links. The same holds for separated debuginfo binaries:
> 43844091 -rwxr-xr-x 3 abuild abuild 28341208 zář 22 09:15 perf-5.8.7-0.x86_64.debug
> 43844091 -rwxr-xr-x 3 abuild abuild 28341208 zář 22 09:15 trace-5.8.7-0.x86_64.debug

Now when dwz is run:
$ dwz -h -r -m .dwz/perf-5.8.7-0.x86_64 -l 10000000 -L 50000000
./usr/bin/perf-5.8.7-0.x86_64.debug ./usr/bin/trace-5.8.7-0.x86_64.debug ....
it results in (strace):
> openat(AT_FDCWD, "./usr/bin/trace-5.8.7-0.x86_64.debug", O_RDONLY) = 8
> fstat(8, {st_mode=S_IFREG|0755, st_size=28341208, ...}) = 0
> getpid()                                = 26887
> openat(AT_FDCWD, "./usr/bin/trace-5.8.7-0.x86_64.debug.#dwz#.maMA6e", O_RDWR|O_CREAT|O_EXCL, 0600) = 9
> close(9)                                = 0
> unlink("./usr/bin/trace-5.8.7-0.x86_64.debug.#dwz#.maMA6e") = 0
> link("./usr/bin/perf-5.8.7-0.x86_64.debug", "./usr/bin/trace-5.8.7-0.x86_64.debug.#dwz#.maMA6e") = 0
> rename("./usr/bin/trace-5.8.7-0.x86_64.debug.#dwz#.maMA6e", "./usr/bin/trace-5.8.7-0.x86_64.debug") = 0

The thing is that the rename is thought to actually remove 'oldpath' (first
argument), but in case of hardlinks, it is documented it does nothing:
> If oldpath and newpath are existing hard links referring to the
> same file, then rename() does nothing, and returns a success status.

Sure, perf-5.8.7-0.x86_64.debug and trace-5.8.7-0.x86_64.debug are hard links
and you create trace-5.8.7-0.x86_64.debug.#dwz#.maMA6e (which links to perf-*)
and then rename it to trace-5.8.7-0.x86_64.debug which is still the same hard
link.

Should you remove newpath first? Or do not create the link if it exists
already?

Note that perf is special: 
> dwz: ./usr/bin/perf-5.8.7-0.x86_64.debug: DWARF compression not beneficial - old size 9932364 new size 9932655

So this is likely reason, why perf-5.8.7-0.x86_64.debug is left unchanged and
trace -> perf hard link still exists.

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

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

* [Bug default/26645] dwz does not remove a tmp file when working on perf
  2020-09-22 10:54 [Bug default/26645] New: dwz does not remove a tmp file when working on perf jirislaby at gmail dot com
@ 2020-10-01 13:19 ` mark at klomp dot org
  2020-10-01 13:19 ` mark at klomp dot org
  2021-02-13 22:57 ` mark at klomp dot org
  2 siblings, 0 replies; 4+ messages in thread
From: mark at klomp dot org @ 2020-10-01 13:19 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=26645

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
I believe this is PR24275
Which has a proposed patch:
https://sourceware.org/legacy-ml/dwz/2019-q1/msg00060.html
But that has never been applied?

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

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

* [Bug default/26645] dwz does not remove a tmp file when working on perf
  2020-09-22 10:54 [Bug default/26645] New: dwz does not remove a tmp file when working on perf jirislaby at gmail dot com
  2020-10-01 13:19 ` [Bug default/26645] " mark at klomp dot org
@ 2020-10-01 13:19 ` mark at klomp dot org
  2021-02-13 22:57 ` mark at klomp dot org
  2 siblings, 0 replies; 4+ messages in thread
From: mark at klomp dot org @ 2020-10-01 13:19 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=26645

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=24275

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

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

* [Bug default/26645] dwz does not remove a tmp file when working on perf
  2020-09-22 10:54 [Bug default/26645] New: dwz does not remove a tmp file when working on perf jirislaby at gmail dot com
  2020-10-01 13:19 ` [Bug default/26645] " mark at klomp dot org
  2020-10-01 13:19 ` mark at klomp dot org
@ 2021-02-13 22:57 ` mark at klomp dot org
  2 siblings, 0 replies; 4+ messages in thread
From: mark at klomp dot org @ 2021-02-13 22:57 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=26645

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
This is indeed PR24275. But the proposed patch there doesn't apply anymore to
the current code.

*** This bug has been marked as a duplicate of bug 24275 ***

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

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

end of thread, other threads:[~2021-02-13 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 10:54 [Bug default/26645] New: dwz does not remove a tmp file when working on perf jirislaby at gmail dot com
2020-10-01 13:19 ` [Bug default/26645] " mark at klomp dot org
2020-10-01 13:19 ` mark at klomp dot org
2021-02-13 22:57 ` mark at klomp dot org

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).