[valgrind] [Bug 411203] valgrind should have a mean to pass environment variable to target program

2020-01-06 Thread Yann Droneaud
https://bugs.kde.org/show_bug.cgi?id=411203

--- Comment #3 from Yann Droneaud  ---
(In reply to Julian Seward from comment #2)
> (In reply to Yann Droneaud from comment #0)
> 
> > Unfortunately, AFAICT, valgrind doesn't have (yet) support for altering the
> > tracee environment variables.
> 
> Why do you say that?  AFAIK, V passes the env vars to the program it is
> running.

It's not possible to add/remove variables to the tracee's environment only.

For example, if I want to enable LD_VERBOSE=1 (only) for test-program to be
traced, doing "LD_PROFILE=1 valgrind test-program" will affect valgrind too.

strace has the -E option that enable to set environment variables only for the
program to be traced. See
http://man7.org/linux/man-pages/man1/strace.1.html#OPTIONS

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

[valgrind] [Bug 411203] valgrind should have a mean to pass environment variable to target program

2019-08-23 Thread Yann Droneaud
https://bugs.kde.org/show_bug.cgi?id=411203

--- Comment #1 from Yann Droneaud  ---
It shouldn't be difficult to implement, but it's a bit tricky as valgrind
launcher already communicate with each tool through environment variables.
So environment variable to be added/removed from tracee environment have to be
encoded in environment variables passed to valgrind's tool.
I've to find how (and where) to implement this.

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

[valgrind] [Bug 411203] New: valgrind should have a mean to pass environment variable to target program

2019-08-23 Thread Yann Droneaud
https://bugs.kde.org/show_bug.cgi?id=411203

Bug ID: 411203
   Summary: valgrind should have a mean to pass environment
variable to target program
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: wishlist
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: y...@droneaud.fr
  Target Milestone: ---

Under glibc based operating system, I sometimes have to specify option to the
dynamic loader ld.so using environment variables.

strace has -E option to do so.

It useful because sometime environment variables might have unwanted effect on
the wrapper program: LD_LIBRARY_PATH could make the wrapper use libraries that
it shouldn't. In fact any LD_ environment variable is a potential issue for the
tracer.

strace -E is also great because it allows removing environment variables. 

Unfortunately, AFAICT, valgrind doesn't have (yet) support for altering the
tracee environment variables.

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

[valgrind] [Bug 407589] [Linux] Add support for C11 aligned_alloc() and GNU reallocarray()

2019-05-16 Thread Yann Droneaud
https://bugs.kde.org/show_bug.cgi?id=407589

Yann Droneaud  changed:

   What|Removed |Added

 CC||y...@droneaud.fr

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

[valgrind] [Bug 407589] [Linux] Add support for C11 aligned_alloc() and GNU reallocarray()

2019-05-16 Thread Yann Droneaud
https://bugs.kde.org/show_bug.cgi?id=407589

--- Comment #3 from Yann Droneaud  ---
More about those functions in glibc documentation:

http://www.gnu.org/software/libc/manual/html_node/Summary-of-Malloc.html

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

[valgrind] [Bug 407589] [Linux] Add support for C11 aligned_alloc() and GNU reallocarray()

2019-05-16 Thread Yann Droneaud
https://bugs.kde.org/show_bug.cgi?id=407589

--- Comment #2 from Yann Droneaud  ---
(In reply to Yann Droneaud from comment #0)

> But it doesn't have explicit support for C11 aligned allocation function:
> 
> - void *aligned_alloc (size_t alignment, size_t size);
> 

Correct link: http://man7.org/linux/man-pages/man3/aligned_alloc.3.html

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

[valgrind] [Bug 407589] [Linux] Add support for C11 aligned_alloc() and GNU reallocarray()

2019-05-16 Thread Yann Droneaud
https://bugs.kde.org/show_bug.cgi?id=407589

--- Comment #1 from Yann Droneaud  ---
(In reply to Yann Droneaud from comment #0)

> And GNU reallocate array function:
> 
> - void *reallocarray (void *ptr, size_t nmemb, size_t size);
> 
>   http://man7.org/linux/man-pages/man3/reallocarray.3.html

It's originally an OpenBSD extension, which is also available at least in
FreeBSD and NetBSD

OpenBSD: https://man.openbsd.org/reallocarray.3
FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=reallocarray
NetBSD:  http://netbsd.gw.com/cgi-bin/man-cgi?reallocarray

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

[valgrind] [Bug 407589] New: [Linux] Add support for C11 aligned_alloc() and GNU reallocarray()

2019-05-16 Thread Yann Droneaud
https://bugs.kde.org/show_bug.cgi?id=407589

Bug ID: 407589
   Summary: [Linux] Add support for C11 aligned_alloc() and GNU
reallocarray()
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: wishlist
  Priority: NOR
 Component: memcheck
  Assignee: jsew...@acm.org
  Reporter: y...@droneaud.fr
  Target Milestone: ---

According to
http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.together

"Memcheck intercepts calls to malloc, calloc, realloc, valloc, memalign, free,
new, new[], delete and delete[]"

It should be noted Valgrind has support for more calls than listed in
documentation, namely:

- posix_memalign()
- pvalloc()
- valloc()

But it doesn't have explicit support for C11 aligned allocation function:

- void *aligned_alloc (size_t alignment, size_t size);

  http://man7.org/linux/man-pages/man3/reallocarray.3.html

And GNU reallocate array function:

- void *reallocarray (void *ptr, size_t nmemb, size_t size);

  http://man7.org/linux/man-pages/man3/reallocarray.3.html

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