[valgrind] [Bug 433439] FreeBSD support, part 3

2021-10-06 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=433439

Paul Floyd  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|REPORTED|RESOLVED

--- Comment #8 from Paul Floyd  ---
Code committed as
commit 7774acbc9c9c4caac2e6e2400635ddde667af6c7

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

[valgrind] [Bug 433439] FreeBSD support, part 3

2021-10-05 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=433439

Paul Floyd  changed:

   What|Removed |Added

 Attachment #141834|0   |1
is obsolete||

--- Comment #7 from Paul Floyd  ---
Created attachment 142184
  --> https://bugs.kde.org/attachment.cgi?id=142184=edit
diff in include directory

This is clean

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

[valgrind] [Bug 433439] FreeBSD support, part 3

2021-09-27 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=433439

--- Comment #6 from Paul Floyd  ---

For sysctl the problem is that I created separate patches for include and
coregrind (patch 12)

The definition is

Int VG_(sysctl)(Int *name, UInt namelen, void *oldp, SizeT *oldlenp, const void
*newp, SizeT newlen)
{
   SysRes res;
#  if defined(VGO_darwin) || defined(VGO_freebsd)
   res = VG_(do_syscall6)(__NR___sysctl,
   (UWord)name, namelen, (UWord)oldp, (UWord)oldlenp,
(UWord)newp, newlen);
#  else
   res = VG_(mk_SysRes_Error)(VKI_ENOSYS);
#  endif
   return sr_isError(res) ? -1 : sr_Res(res);
}

It is only called by FreeBSD and Darwin. On other platforms it should never be
called and returns an error.

The calls that I see to this function are:
2 for Darwin in void VG_(print_preamble)(Bool logging_to_fd), m_libcprint.c
lines 297 and 299, both with a MNULL newp.

3 for FreeBSD, read_and_set_osrel() readelf.c line 1177 and 2 in m_libcproc.c,
VG_(sysctlbyname)() lines 1151 and 1155.

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

[valgrind] [Bug 433439] FreeBSD support, part 3

2021-09-26 Thread Mark Wielaard
https://bugs.kde.org/show_bug.cgi?id=433439

--- Comment #5 from Mark Wielaard  ---
(In reply to Paul Floyd from comment #4)
> Why do you think making sysctl newp const might be unsafe?
> 
> The signature on FreeBSD is
> 
>  int
>  sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp,
>  const void *newp, size_t newlen);
> 
> On Darwin it is non--const, but there are only two calls to it both with
> NULL arguments for newp.
> 
> Either way newp gets cast to (UWord).
> 
> I prefer to keep it const as this makes the interface clearer (an optional
> input-only argument).

But it doesn't match the actual VG_(sysctl) function in coregrind/m_libcproc.c
we actually use, so it causes compile errors.

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

[valgrind] [Bug 433439] FreeBSD support, part 3

2021-09-26 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=433439

--- Comment #4 from Paul Floyd  ---
Why do you think making sysctl newp const might be unsafe?

The signature on FreeBSD is

 int
 sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp,
 const void *newp, size_t newlen);

On Darwin it is non--const, but there are only two calls to it both with NULL
arguments for newp.

Either way newp gets cast to (UWord).

I prefer to keep it const as this makes the interface clearer (an optional
input-only argument).


I've removed the include of vki/vki-scnums-freebsd.h in
include/pub_tool_vkiscnums.h. It does no longer seem necessary.

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

[valgrind] [Bug 433439] FreeBSD support, part 3

2021-09-26 Thread Mark Wielaard
https://bugs.kde.org/show_bug.cgi?id=433439

--- Comment #3 from Mark Wielaard  ---
Created attachment 141932
  --> https://bugs.kde.org/attachment.cgi?id=141932=edit
freebsd3 patch

This variant of the patch, with the changes suggested in my previous comment,
works for me on fedora x86_64.

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

[valgrind] [Bug 433439] FreeBSD support, part 3

2021-09-26 Thread Mark Wielaard
https://bugs.kde.org/show_bug.cgi?id=433439

Mark Wielaard  changed:

   What|Removed |Added

 CC||m...@klomp.org

--- Comment #2 from Mark Wielaard  ---
I think the new NSegment field in include/pub_tool_aspacemgr.h should be
guarded by:

#if defined(VGO_freebsd)
  BoolisFF; // True --> is a fixed file mapping
#endif

As it is only used by freebsd.

The types in include/pub_tool_basics.h seem properly guarded.

The _option[2] in include/pub_tool_options.h looks correct.

Adding const to the VG_(sysctl) void *newp would break some code and seems
unnecessary.

The comment and inclusion of vki/vki-scnums-freebsd.h in
include/pub_tool_vkiscnums.h seems unneeded.

The new vki files are only used by freebsd and I assume they describe things
correctly.

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

[valgrind] [Bug 433439] FreeBSD support, part 3

2021-09-23 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=433439

Paul Floyd  changed:

   What|Removed |Added

 Attachment #136052|0   |1
is obsolete||

--- Comment #1 from Paul Floyd  ---
Created attachment 141834
  --> https://bugs.kde.org/attachment.cgi?id=141834=edit
diff in include directory

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

[valgrind] [Bug 433439] FreeBSD support, part 3

2021-03-22 Thread Ed Maste
https://bugs.kde.org/show_bug.cgi?id=433439

Ed Maste  changed:

   What|Removed |Added

 CC||ema...@freebsd.org

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