https://bugs.kde.org/show_bug.cgi?id=480405

Paul Floyd <pjfl...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pjfl...@wanadoo.fr

--- Comment #1 from Paul Floyd <pjfl...@wanadoo.fr> ---
First problem, your code didn't compile straight away. Here is a diff.

diff --git a/finddups.cpp b/finddups.cpp
index ec44c03..f22dba5 100644
--- a/finddups.cpp
+++ b/finddups.cpp
@@ -11,6 +11,7 @@
 #include <iostream>
 #include <sys/mman.h>
 #include <unordered_map>
+#include <unistd.h>

 constexpr unsigned long PAGESZ = 4096UL;

@@ -194,7 +195,7 @@ int main(int argc, char *argv[]) {
   }
   std::cerr << "Total time: "
             << std::chrono::duration_cast<std::chrono::milliseconds>(
-                   std::chrono::high_resolution_clock::now() - start)
+                   std::chrono::high_resolution_clock::now() - start).count()
             << "\n";
   return 0;
 }

There are also a few warnings

/home/paulf/scratch/finddups-cpp/finddups.cpp:49:31: warning: missing field
'includes' initializer [-Wmissing-field-initializers]
  return Config{min_sz, max_sz};
                              ^
/home/paulf/scratch/finddups-cpp/finddups.cpp:93:69: warning: unused parameter
'cfg' [-Wunused-parameter]
entry_hash_map hashmap(const entry_size_map &sizemap, const Config &cfg) {
                                                                    ^
/home/paulf/scratch/finddups-cpp/finddups.cpp:16:25: warning: unused variable
'PAGESZ' [-Wunused-const-variable]
constexpr unsigned long PAGESZ = 4096UL;
                        ^


Second problem, from your report

host stacktrace:
==6333== at 0x58065812: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)

It looks like you are using a crappy distro that has a package maintainer that
believes that they know better than the Valgrind developers and has ignored our
advice not to strip the Valgrind binaries. Your distro may have a
"valgrind-dbg" or "valgrind-dbgsym" package or something like that which would
contain the split debuginfo files.

Reproducing the error may depend where you are running the exe. When I run it
on the project build directory I get no problem. When I run it as non-root on
"/usr" I get an abort.  I had to make several changes to use the overloads that
use std::error_code since you don't catch exceptions in your directory
iterating code. However, in your case "sizemap size" is only 181 (for my /usr
it is 24699, my build directory is 176). So I assume that you're running it in
your project build directory.

On my system, no problem (FreeBSD 13.2, clang 14.0.5).

Now looking at the source code. There are 5 calls to set_Cent. I can't tell
which one it is in your case because of your stripped binary. 

Can you try again, either with the Valgrind debuginfo package (if your distro
has one and it works) or with Valgrind built from source?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to