You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(58) |
Apr
(261) |
May
(169) |
Jun
(214) |
Jul
(201) |
Aug
(219) |
Sep
(198) |
Oct
(203) |
Nov
(241) |
Dec
(94) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(137) |
Feb
(149) |
Mar
(150) |
Apr
(193) |
May
(95) |
Jun
(173) |
Jul
(137) |
Aug
(236) |
Sep
(157) |
Oct
(150) |
Nov
(136) |
Dec
(90) |
2005 |
Jan
(139) |
Feb
(130) |
Mar
(274) |
Apr
(138) |
May
(184) |
Jun
(152) |
Jul
(261) |
Aug
(409) |
Sep
(239) |
Oct
(241) |
Nov
(260) |
Dec
(137) |
2006 |
Jan
(191) |
Feb
(142) |
Mar
(169) |
Apr
(75) |
May
(141) |
Jun
(169) |
Jul
(131) |
Aug
(141) |
Sep
(192) |
Oct
(176) |
Nov
(142) |
Dec
(95) |
2007 |
Jan
(98) |
Feb
(120) |
Mar
(93) |
Apr
(96) |
May
(95) |
Jun
(65) |
Jul
(62) |
Aug
(56) |
Sep
(53) |
Oct
(95) |
Nov
(106) |
Dec
(87) |
2008 |
Jan
(58) |
Feb
(149) |
Mar
(175) |
Apr
(110) |
May
(106) |
Jun
(72) |
Jul
(55) |
Aug
(89) |
Sep
(26) |
Oct
(96) |
Nov
(83) |
Dec
(93) |
2009 |
Jan
(97) |
Feb
(106) |
Mar
(74) |
Apr
(64) |
May
(115) |
Jun
(83) |
Jul
(137) |
Aug
(103) |
Sep
(56) |
Oct
(59) |
Nov
(61) |
Dec
(37) |
2010 |
Jan
(94) |
Feb
(71) |
Mar
(53) |
Apr
(105) |
May
(79) |
Jun
(111) |
Jul
(110) |
Aug
(81) |
Sep
(50) |
Oct
(82) |
Nov
(49) |
Dec
(21) |
2011 |
Jan
(87) |
Feb
(105) |
Mar
(108) |
Apr
(99) |
May
(91) |
Jun
(94) |
Jul
(114) |
Aug
(77) |
Sep
(58) |
Oct
(58) |
Nov
(131) |
Dec
(62) |
2012 |
Jan
(76) |
Feb
(93) |
Mar
(68) |
Apr
(95) |
May
(62) |
Jun
(109) |
Jul
(90) |
Aug
(87) |
Sep
(49) |
Oct
(54) |
Nov
(66) |
Dec
(84) |
2013 |
Jan
(67) |
Feb
(52) |
Mar
(93) |
Apr
(65) |
May
(33) |
Jun
(34) |
Jul
(52) |
Aug
(42) |
Sep
(52) |
Oct
(48) |
Nov
(66) |
Dec
(14) |
2014 |
Jan
(66) |
Feb
(51) |
Mar
(34) |
Apr
(47) |
May
(58) |
Jun
(27) |
Jul
(52) |
Aug
(41) |
Sep
(78) |
Oct
(30) |
Nov
(28) |
Dec
(26) |
2015 |
Jan
(41) |
Feb
(42) |
Mar
(20) |
Apr
(73) |
May
(31) |
Jun
(48) |
Jul
(23) |
Aug
(55) |
Sep
(36) |
Oct
(47) |
Nov
(48) |
Dec
(41) |
2016 |
Jan
(32) |
Feb
(34) |
Mar
(33) |
Apr
(22) |
May
(14) |
Jun
(31) |
Jul
(29) |
Aug
(41) |
Sep
(17) |
Oct
(27) |
Nov
(38) |
Dec
(28) |
2017 |
Jan
(28) |
Feb
(30) |
Mar
(16) |
Apr
(9) |
May
(27) |
Jun
(57) |
Jul
(28) |
Aug
(43) |
Sep
(31) |
Oct
(20) |
Nov
(24) |
Dec
(18) |
2018 |
Jan
(34) |
Feb
(50) |
Mar
(18) |
Apr
(26) |
May
(13) |
Jun
(31) |
Jul
(13) |
Aug
(11) |
Sep
(15) |
Oct
(12) |
Nov
(18) |
Dec
(13) |
2019 |
Jan
(12) |
Feb
(29) |
Mar
(51) |
Apr
(22) |
May
(13) |
Jun
(20) |
Jul
(13) |
Aug
(12) |
Sep
(21) |
Oct
(6) |
Nov
(9) |
Dec
(5) |
2020 |
Jan
(13) |
Feb
(5) |
Mar
(25) |
Apr
(4) |
May
(40) |
Jun
(27) |
Jul
(5) |
Aug
(17) |
Sep
(21) |
Oct
(1) |
Nov
(5) |
Dec
(15) |
2021 |
Jan
(28) |
Feb
(6) |
Mar
(11) |
Apr
(5) |
May
(7) |
Jun
(8) |
Jul
(5) |
Aug
(5) |
Sep
(11) |
Oct
(9) |
Nov
(10) |
Dec
(12) |
2022 |
Jan
(7) |
Feb
(13) |
Mar
(8) |
Apr
(7) |
May
(12) |
Jun
(27) |
Jul
(14) |
Aug
(27) |
Sep
(27) |
Oct
(17) |
Nov
(17) |
Dec
|
2023 |
Jan
(10) |
Feb
(18) |
Mar
(9) |
Apr
(26) |
May
|
Jun
(13) |
Jul
(18) |
Aug
(5) |
Sep
(12) |
Oct
(16) |
Nov
(1) |
Dec
|
2024 |
Jan
(4) |
Feb
(3) |
Mar
(6) |
Apr
(17) |
May
(2) |
Jun
(33) |
Jul
(13) |
Aug
(1) |
Sep
(6) |
Oct
(8) |
Nov
(6) |
Dec
(15) |
2025 |
Jan
(5) |
Feb
(11) |
Mar
(8) |
Apr
(20) |
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Paul F. <pj...@wa...> - 2020-08-17 08:53:53
|
> This is incorrect for C99 and indeed any compiler that supports "long long". On such systems, the integer constant 3222829167 > has type "long long", and it is absolutely guaranteed to preserve that value when cast to unsigned. Assuming 32-bit int, of course. It is also incorrect for C90. See here https://en.cppreference.com/w/c/language/integer_constant. For C90 an integer constant without suffix can be int, long int or unsigned long int. In this case is it would be unsigned long int. A+ Paul |
From: Patrick J. L. <lop...@gm...> - 2020-08-17 02:13:32
|
On Sat, Aug 15, 2020 at 10:59 AM John Reiser <jr...@bi...> wrote: > > The fact that you write '0xc018786f' here, but '3222829167' in the code, > shows that you are not sufficiently paranoid. First, if the bit pattern is important > then you should write hex. If you insist on decimal, then you should write '3222829167u' > to remind yourself and the compiler that the value is unsigned; otherwise because > 3222829167 exceeds INT_MAX then a compiler is allowed to interpret it as -1072138129 > (or ANY VALUE WHATSOEVER!!!) This is incorrect for C99 and indeed any compiler that supports "long long". On such systems, the integer constant 3222829167 has type "long long", and it is absolutely guaranteed to preserve that value when cast to unsigned. Assuming 32-bit int, of course. I agree it is poor style, but there is essentially zero chance it is causing a problem here. Although 32-bit vs. 64-bit confusion elsewhere certainly might. - Pat |
From: John R. <jr...@bi...> - 2020-08-16 14:16:07
|
> long mgr_compat_ioctl(struct file *pFile, unsigned int cmd, unsigned long arg) > { > int err = -EFAULT; > //unsigned int openLink = kIoctlOpenEthernetLink; > unsigned int openLink = 3222829167; "3222829167" is not a legal 32-bit value in source code. You MUST use "3222829167u" with a trailing 'u'. Do not post or reply to this mailing list until you have changed the source, re-compiled, re-linked, and re-run the test. > > printk("cmd 0x%x/%u, openLink 0x%x/%u\n", cmd, cmd, openLink, openLink); // [409204.415924/1] cmd 0xc018786f/3222829167, openLink 0xc018786f/3222829167 The documentation for ioctl(), as shown by running the command "man 2 ioctl", says that the prototype is: int ioctl(int fd, unsigned long request, ...); Notice that the second parameter has type "unsigned long", which is 64 bits. In contrast, the definition of this function 'mgr_compat_ioctl' has a second parameter type of "unsigned int", which is 32 bits. Beware of this difference. [Also note that the width of the return value differs: 'int' in the documentation, 'long' in the implementation; but this should not matter here.] Try an experiment: change the implementation to: long mgr_compat_ioctl(struct file *pFile, unsigned long cmd, unsigned long arg) where the second parameter has 'long' width instead of 'int'. If necessary, (for instance, in the "struct file_operations mgr_fops" table of function pointers) then cast the type of the function pointer &mgr_compat_ioctl to hide the difference in the type of the second parameter. At the same time, change the printk format conversions corresponding to 'cmd' to become "0x%lx/%lu" which has two 'l' modifiers. The experiment might reveal that the second parameter to mgr_compat_ioctl is being passed a 64-bit value whose upper 32 bits are not all zero. > > if (openLink == cmd) { > printk("match\n"); > } else { > printk("no match: cmd 0x%x/%u, openLink 0x%x/%u\n", cmd, cmd, openLink, openLink); > } Post the assembly-language code for the function mgr_compat_ioctl. The safest way is to use "(gdb) disassemble mgr_compat_ioctl" or "objdump --disaassemble", but "gcc -S" usually is OK. We need to see EXACTLY what instructions are generated. -- |
From: Manomugdha B. <man...@ke...> - 2020-08-15 19:35:11
|
Hi John, Valgrind version: valgrind-3.14.0 compat_ioctl prototype: /* File operations core */ struct file_operations mgr_fops = { owner: THIS_MODULE, open: mgr_open_common, FILE_OPS_IOCTL(mgr_ioctl_common), #ifdef CONFIG_COMPAT compat_ioctl: mgr_compat_ioctl, #endif poll: mgr_poll_common, release: mgr_close_common }; long mgr_compat_ioctl(struct file *pFile, unsigned int cmd, unsigned long arg) { int err = -EFAULT; //unsigned int openLink = kIoctlOpenEthernetLink; unsigned int openLink = 3222829167; printk("cmd 0x%x/%u, openLink 0x%x/%u\n", cmd, cmd, openLink, openLink); if (openLink == cmd) { printk("match\n"); } else { printk("no match: cmd 0x%x/%u, openLink 0x%x/%u\n", cmd, cmd, openLink, openLink); } } Output is: [409204.415924/1] cmd 0xc018786f/3222829167, openLink 0xc018786f/3222829167 [409204.415933/1] no match: cmd 0xc018786f/3222829167, openLink 0xc018786f/3222829167 Note1: it fails at MSB. If i do memcmp instead of "if" then it works. Note2: this is happening only under valgrind. When I run it without valgrind then it works fine. Note3: this is a kernel module and ioctl is called from user space application. Regards, Mano -----Original Message----- From: John Reiser <jr...@bi...> Sent: Saturday, August 15, 2020 11:28 PM To: val...@li... Subject: Re: [Valgrind-users] compat_ioctl cmd does not match even if it shows same value [EXTERNAL] > I have a 32 bit application (user space) which communicate with a > kernel module through compat_ioctl(). My system is > > # uname -a > > Linux chassis1-board1-port5 3.10 #1 SMP Fri Apr 24 02:31:48 PDT 2020 > mips64 GNU/Linux Which version of valgrind? The source code of valgrind: commit 24b247aec5397cad5f6cfcf885f118e90fea8735 (HEAD -> master, origin/master, origin/HEAD) Date: Sat Aug 15 16:54:14 2020 +0200 does not contain the string 'compat_ioctl' anywhere, so you must show us the prototype and the environment (32-bit or 64-bit) for compat_ioctl. > Ioctl function is following: > > long mgr_compat_ioctl(struct file *pFile, unsigned int cmd, unsigned > long arg) > > inside this function definition, I am getting correct cmd value e.g. 0xc018786f. The fact that you write '0xc018786f' here, but '3222829167' in the code, shows that you are not sufficiently paranoid. First, if the bit pattern is important then you should write hex. If you insist on decimal, then you should write '3222829167u' to remind yourself and the compiler that the value is unsigned; otherwise because 3222829167 exceeds INT_MAX then a compiler is allowed to interpret it as -1072138129 (or ANY VALUE WHATSOEVER!!!) Then, it is very likely that your problem lies in a mismatch of width (64-bit vs 32-bit) and/or signedness at one or more interfaces (subroutine call or system call). You say "printk shows same value" but you did not say what format conversion you specified to printk, therefore no one can determine what the actual value is. This is likely to be important, because printk is implemented using "..." varargs, and on most 64-bit machines that means that most scalar actual arguments are promoted to 64-bit width upon the transition into the varargs mechanism, and it is UNSPECIFIED whether the conversion from 32-bit to 64-bit is sign-extended or zero-extended. That makes it extremely important that each varargs access uses the desired width and signedness. Due to the possibility of bugs, the only way to be sure of what is happening is to look at the assembly-language code, and examine registers and values while single-stepping actual execution. -- _______________________________________________ Valgrind-users mailing list Val...@li... https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/valgrind-users__;!!I5pVk4LIGAfnvw!w9ZQebKExIzQOBnXRp0AgAnSuApBAKyRQwK8-da-j4Y9NjzgGTYvJNpMt7LSIX7caCZHaZDi$ |
From: John R. <jr...@bi...> - 2020-08-15 17:58:00
|
> I have a 32 bit application (user space) which communicate with a kernel module through compat_ioctl(). My system is > > # uname -a > > Linux chassis1-board1-port5 3.10 #1 SMP Fri Apr 24 02:31:48 PDT 2020 mips64 GNU/Linux Which version of valgrind? The source code of valgrind: commit 24b247aec5397cad5f6cfcf885f118e90fea8735 (HEAD -> master, origin/master, origin/HEAD) Date: Sat Aug 15 16:54:14 2020 +0200 does not contain the string 'compat_ioctl' anywhere, so you must show us the prototype and the environment (32-bit or 64-bit) for compat_ioctl. > Ioctl function is following: > > long mgr_compat_ioctl(struct file *pFile, unsigned int cmd, unsigned long arg) > > inside this function definition, I am getting correct cmd value e.g. 0xc018786f. The fact that you write '0xc018786f' here, but '3222829167' in the code, shows that you are not sufficiently paranoid. First, if the bit pattern is important then you should write hex. If you insist on decimal, then you should write '3222829167u' to remind yourself and the compiler that the value is unsigned; otherwise because 3222829167 exceeds INT_MAX then a compiler is allowed to interpret it as -1072138129 (or ANY VALUE WHATSOEVER!!!) Then, it is very likely that your problem lies in a mismatch of width (64-bit vs 32-bit) and/or signedness at one or more interfaces (subroutine call or system call). You say "printk shows same value" but you did not say what format conversion you specified to printk, therefore no one can determine what the actual value is. This is likely to be important, because printk is implemented using "..." varargs, and on most 64-bit machines that means that most scalar actual arguments are promoted to 64-bit width upon the transition into the varargs mechanism, and it is UNSPECIFIED whether the conversion from 32-bit to 64-bit is sign-extended or zero-extended. That makes it extremely important that each varargs access uses the desired width and signedness. Due to the possibility of bugs, the only way to be sure of what is happening is to look at the assembly-language code, and examine registers and values while single-stepping actual execution. -- |
From: Manomugdha B. <man...@ke...> - 2020-08-15 13:36:50
|
Hi, I have a 32 bit application (user space) which communicate with a kernel module through compat_ioctl(). My system is # uname -a Linux chassis1-board1-port5 3.10 #1 SMP Fri Apr 24 02:31:48 PDT 2020 mips64 GNU/Linux Ioctl function is following: long mgr_compat_ioctl(struct file *pFile, unsigned int cmd, unsigned long arg) inside this function definition, I am getting correct cmd value e.g. 0xc018786f. the variable to which this cmd is to be matched has exactly same value of 0xc018786f (printk shows same value). But still if check fails. Sample code is like this: int mgr_ioctl_common (struct inode *pInode, struct file *pFile, unsigned int cmd, unsigned long arg) { int err = -EFAULT; int minor; void *pUserStruct = (void *)arg; SkixpppMgrDevDesc *pDev = NULL; tKHandle retHandle; unsigned int openLink = 3222829167; if (openLink == cmd) { //printk shows value of cmd is 3222829167 printk("matches\n"); } else { printk("no matche\n"); } } Why this if check fails here? Regards, Mano |
From: Manomugdha B. <man...@ke...> - 2020-08-15 13:36:00
|
(openLink - cmd) shows zero still if check fails. Note: this is happening only under valgrind! Regards, Mano, IxNetwork [Keysight-signature-block-5]<http://www.keysight.com/> From: Manomugdha Biswas Sent: Saturday, August 15, 2020 6:38 PM To: val...@li... Subject: compat_ioctl cmd does not match even if it shows same value Hi, I have a 32 bit application (user space) which communicate with a kernel module through compat_ioctl(). My system is # uname -a Linux chassis1-board1-port5 3.10 #1 SMP Fri Apr 24 02:31:48 PDT 2020 mips64 GNU/Linux Ioctl function is following: long mgr_compat_ioctl(struct file *pFile, unsigned int cmd, unsigned long arg) inside this function definition, I am getting correct cmd value e.g. 0xc018786f. the variable to which this cmd is to be matched has exactly same value of 0xc018786f (printk shows same value). But still if check fails. Sample code is like this: int mgr_ioctl_common (struct inode *pInode, struct file *pFile, unsigned int cmd, unsigned long arg) { int err = -EFAULT; int minor; void *pUserStruct = (void *)arg; SkixpppMgrDevDesc *pDev = NULL; tKHandle retHandle; unsigned int openLink = 3222829167; if (openLink == cmd) { //printk shows value of cmd is 3222829167 printk("matches\n"); } else { printk("no matche\n"); } } Why this if check fails here? Regards, Mano |
From: Philippe W. <phi...@sk...> - 2020-08-15 08:15:25
|
On Fri, 2020-08-14 at 19:16 +0200, Mark Wielaard wrote: > Hi Shachar, > > On Fri, Aug 14, 2020 at 06:35:14PM +0300, Shachar Shemesh wrote: > > I am writing my own C++ microthreading library. At the very first switch, I > > get the following message from Valgrind: > > > > ==15122== Warning: client switching stacks? SP change: 0x1ffeffe788 --> > > 0x75d0f80 > > ==15122== to suppress, use: --max-stackframe=137298630664 or > > greater > > > > > > I understand that valgrind needs to know where the stack starts and ends. I > > am wondering whether is any way I can tell it that information. Since I'm > > writing the library, what I was thinking was compiling the library with a > > special flag saying "you're running with valgrind", and then have my library > > call a valgrind function that says "This is the new stack range, this is the > > old one". > > > > Is there such a thing? If so, how do I interface with it? > > Yes, there is such a thing. The valgrind client request mechanism: > https://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.clientreq > > It does have various VALGRIND_STACK_* macros to signal use of user > threads/stacks. But note that the documentations says: > Warning: Unfortunately, this client request is unreliable and best avoided. > Unfortunately I don't know why that is, or what alternative mechanisms there are. I also do not know what the 'unreliable' doc warning points at. Searching in bugzilla, there are a few bugs that are related to such STACK requests: Bug 202463 - VALGRIND_STACK_{REGISTER,DEREGISTER,CHANGE} are unreliable Bug 133154 - crash when using client requests to register/deregister stack However, some years ago, I did various improvements to the stack handling code in order to better support running valgrind under valgrind: the inner valgrind is using such client requests to inform the outer valgrind about the inner stacks. So, IMO, these requests should (could?) work reasonably well. Philippe |
From: Mark W. <ma...@kl...> - 2020-08-14 17:33:32
|
Hi Shachar, On Fri, Aug 14, 2020 at 06:35:14PM +0300, Shachar Shemesh wrote: > I am writing my own C++ microthreading library. At the very first switch, I > get the following message from Valgrind: > > ==15122== Warning: client switching stacks? SP change: 0x1ffeffe788 --> > 0x75d0f80 > ==15122== to suppress, use: --max-stackframe=137298630664 or > greater > > > I understand that valgrind needs to know where the stack starts and ends. I > am wondering whether is any way I can tell it that information. Since I'm > writing the library, what I was thinking was compiling the library with a > special flag saying "you're running with valgrind", and then have my library > call a valgrind function that says "This is the new stack range, this is the > old one". > > Is there such a thing? If so, how do I interface with it? Yes, there is such a thing. The valgrind client request mechanism: https://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.clientreq It does have various VALGRIND_STACK_* macros to signal use of user threads/stacks. But note that the documentations says: Warning: Unfortunately, this client request is unreliable and best avoided. Unfortunately I don't know why that is, or what alternative mechanisms there are. Cheers, Mark |
From: Shachar S. <sh...@sh...> - 2020-08-14 15:53:15
|
Hi all, I am writing my own C++ microthreading library. At the very first switch, I get the following message from Valgrind: ==15122== Warning: client switching stacks? SP change: 0x1ffeffe788 --> 0x75d0f80 ==15122== to suppress, use: --max-stackframe=137298630664 or greater I understand that valgrind needs to know where the stack starts and ends. I am wondering whether is any way I can tell it that information. Since I'm writing the library, what I was thinking was compiling the library with a special flag saying "you're running with valgrind", and then have my library call a valgrind function that says "This is the new stack range, this is the old one". Is there such a thing? If so, how do I interface with it? Thank you, Shachar |
From: <pj...@wa...> - 2020-08-05 08:53:28
|
<div dir='auto'><div dir="auto">Maybe. Can you try --soname-synonyms=malloc=NONE ?</div><div><br><div class="elided-text">Paul</div></div></div> |
From: Foelsche, P. <Pet...@me...> - 2020-08-04 16:10:18
|
Could this be caused by some smart* using -static-libstdc To create one of the involved shared libraries? Peter From: Foelsche, Peter Sent: Tuesday, August 4, 2020 10:28 To: val...@li... Subject: [Valgrind-users] Mismatched free() / delete / delete[] -- false positives * Valgrind-3.13.0 * CentOS release 6.5 (Final) * g++ (GCC) 5.3.0 * no usage of tcmalloc I checked by cat /proc/<PID>/maps |sed -e 's/[a-zA-Z0-9_:-]*[ \t][ \t]*//g'|sort -u|xargs nm -A|grep '\<free\>'|grep -v '\<U\>' output was /lib64/ld-2.12.so:0000003bfba16090 W free /lib64/libc-2.12.so:0000003bfc27b520 T free /path/executable:000000000f9f3c50 W free * positives for both directions o free used for memory allocated with new o delete used for memory allocated with malloc 1) ==11679== Mismatched free() / delete / delete [] ==11679== at 0x127ECAFE: free (vg_replace_malloc.c:530) ==11679== by 0x1CC871A1: void std::_Destroy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) (stl_construct.h:93) ==11679== by 0x1CC82295: void std::_Destroy_aux<false>::__destroy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) (stl_construct.h:103) ... ==11679== Address 0x2633aeb0 is 0 bytes inside a block of size 155 alloc'd ==11679== at 0x127EDBE7: operator new(unsigned long) (vg_replace_malloc.c:334) ==11679== by 0x54B81C3: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forwar d_iterator_tag) (basic_string.tcc:223) 2) ==11679== Mismatched free() / delete / delete [] ==11679== at 0x127EC64E: operator delete(void*) (vg_replace_malloc.c:576) ==11679== by 0x8172EC3: __gnu_cxx::new_allocator<Sdi::StateVar const*>::deallocate(Sdi::StateVar const**, unsigned long) (new_allocator.h:110) ==11679== by 0x8172767: std::allocator_traits<std::allocator<Sdi::StateVar const*> >::deallocate(std::allocator<Sdi::StateVar const*>&, Sdi::StateVar const**, unsigned long) (alloc_traits.h:386) ... ==11679== Address 0x2a5e08b0 is 0 bytes inside a block of size 32 alloc'd ==11679== at 0x127ED104: malloc (vg_replace_malloc.c:299) ==11679== by 0x206F33E7: operator new(unsigned long) (new_op.cc:50) ==11679== by 0x1CCE9829: __gnu_cxx::new_allocator<Sdi::StateVar const*>::allocate(unsigned long, void const*) (new_allocator.h:104) There are only a 7 of the 1) messages and 3 of the 2) despite there are many more such allocations. As you can see, both places are inside STL and thus are likely to be correct. I think vg_replace_malloc.c is coming from valgrind, isn't it? Peter Mogan : Hey Bruno. What are you? A 65? Bruno : Model 63. Deluxe. Kelp : 63? Talk about ancient. Bruno : Your sister didn't seem to mind. |
From: Foelsche, P. <Pet...@me...> - 2020-08-04 15:43:19
|
* Valgrind-3.13.0 * CentOS release 6.5 (Final) * g++ (GCC) 5.3.0 * no usage of tcmalloc I checked by cat /proc/<PID>/maps |sed -e 's/[a-zA-Z0-9_:-]*[ \t][ \t]*//g'|sort -u|xargs nm -A|grep '\<free\>'|grep -v '\<U\>' output was /lib64/ld-2.12.so:0000003bfba16090 W free /lib64/libc-2.12.so:0000003bfc27b520 T free /path/executable:000000000f9f3c50 W free * positives for both directions o free used for memory allocated with new o delete used for memory allocated with malloc 1) ==11679== Mismatched free() / delete / delete [] ==11679== at 0x127ECAFE: free (vg_replace_malloc.c:530) ==11679== by 0x1CC871A1: void std::_Destroy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) (stl_construct.h:93) ==11679== by 0x1CC82295: void std::_Destroy_aux<false>::__destroy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) (stl_construct.h:103) ... ==11679== Address 0x2633aeb0 is 0 bytes inside a block of size 155 alloc'd ==11679== at 0x127EDBE7: operator new(unsigned long) (vg_replace_malloc.c:334) ==11679== by 0x54B81C3: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forwar d_iterator_tag) (basic_string.tcc:223) 2) ==11679== Mismatched free() / delete / delete [] ==11679== at 0x127EC64E: operator delete(void*) (vg_replace_malloc.c:576) ==11679== by 0x8172EC3: __gnu_cxx::new_allocator<Sdi::StateVar const*>::deallocate(Sdi::StateVar const**, unsigned long) (new_allocator.h:110) ==11679== by 0x8172767: std::allocator_traits<std::allocator<Sdi::StateVar const*> >::deallocate(std::allocator<Sdi::StateVar const*>&, Sdi::StateVar const**, unsigned long) (alloc_traits.h:386) ... ==11679== Address 0x2a5e08b0 is 0 bytes inside a block of size 32 alloc'd ==11679== at 0x127ED104: malloc (vg_replace_malloc.c:299) ==11679== by 0x206F33E7: operator new(unsigned long) (new_op.cc:50) ==11679== by 0x1CCE9829: __gnu_cxx::new_allocator<Sdi::StateVar const*>::allocate(unsigned long, void const*) (new_allocator.h:104) There are only a 7 of the 1) messages and 3 of the 2) despite there are many more such allocations. As you can see, both places are inside STL and thus are likely to be correct. I think vg_replace_malloc.c is coming from valgrind, isn't it? Peter Mogan : Hey Bruno. What are you? A 65? Bruno : Model 63. Deluxe. Kelp : 63? Talk about ancient. Bruno : Your sister didn't seem to mind. |
From: Jay N. <nja...@gm...> - 2020-08-03 11:54:13
|
Hi, I have a program, which i am monitoring with linux top command(CentOS). The virt memory remains the same. There is increase IN RES memory and SHR memory. How can i analyze the rise in RES and shr memory with valgrind. How does valgrind points out the increase in RES and SHR memory. Please let me know. Thanks, Jayshankar |
From: John B. <all...@gm...> - 2020-08-01 23:26:58
|
I found this blog post interesting enough to share. https://kristerw.blogspot.com/2020/02/watching-for-software-inefficiencies.html It's post on writing a small valgrind tool for looking for dead stores. |
From: John R. <jr...@bi...> - 2020-07-21 02:06:17
|
On 7/20/20 23:14 UTC, Chithkala Dhulipati wrote: > I wanted to use valgrind for profiling my programs. What I am looking for is a list of functions called and a path to those functions. When I previously used gprof for this, there was no option that could produce the original path where the functions where found. Is there a way I can achieve this? The terms "path to those functions" and "original path where the functions were found" are not well-defined. Please provide actual literal examples of what you seek, as well as an explanation of how the existing valgrind tracebacks are not sufficient. |
From: Chithkala D. <chithkaladhulipa@u.boisestate.edu> - 2020-07-20 23:39:52
|
Hello! I wanted to use valgrind for profiling my programs. What I am looking for is a list of functions called and a path to those functions. When I previously used gprof for this, there was no option that could produce the original path where the functions where found. Is there a way I can achieve this? Thanks! Chithkala |
From: Paul F. <pj...@wa...> - 2020-07-17 10:10:21
|
Hi again OK, a few more details. There is nothing that you can do about SIGKILL. Your process gets terminated and you get no chance to do anything about it. Valgrind cannot do it’s final resource leak checks and your log is probably truncated. SIGTERM, on the other hand, gives you a chance to do something - handle it or ignore it. You could write some code like this #include “valgrind.h” static void handle_terminate_valgrind(int signo) { /* exit cleanly */ /* * if not possible to exit cleanly * use VALGRIND_DO_LEAK_CHECK from memcheck.h */ } /* somewhere In your startup code */ if (RUNNING_ON_VALGRIND) { signal(SIGTERM, handle_terminate_valgrind); /* alternatively to ignore signalSIGTERM, SIG_IGN); /* } A+ Paul |
From: Paul F. <pj...@wa...> - 2020-07-17 07:30:34
|
De : "Shemin Aboobacker" > > if we are using automated gui testing tool with valgrind and automated testing tool kills > the application after GUI testing ,valgrind gives incomplete report.Is there any solution for this? On Linux I suppose? Which signal is being used for the kill? SIGTERM (15) or SIGKILL (9)? If it is the latter, there's nothing you can do other than changing your tests to do something else. If it's SIGTERM you could add a signal handler that is only active when running under Valgrind. A+ Paul |
From: Shemin A. <she...@gm...> - 2020-07-17 07:15:11
|
if we are using automated gui testing tool with valgrind and automated testing tool kills the application after GUI testing ,valgrind gives incomplete report.Is there any solution for this? |
From: Mark R. <ma...@cs...> - 2020-06-29 20:00:50
|
||You can iterate over the statements contained within a superblock, add new statements, remove statements, etc. I am successfully instrumenting code with Valgrind and I don’t really need super blocks (as yet). I was just curious about the Valgrind implementation. Traditionally, given: Inst-1 Inst-2 Cond branch Inst-4 Inst-5 All five instructions would be in the same super block, but Valgrind appears to create two basic blocks with Inst-1 to Cond branch in one ant Inst-4 and Inst-5 in a separate IRSB. So it appears to me as if these are basic blocks, not super blocks - what am I missing? Thanks, Mark -----Original Message----- From: Derrick McKee [mailto:der...@gm...] Sent: Monday, June 29, 2020 12:36 PM To: Mark Roberts Cc: val...@li... Subject: Re: [Valgrind-users] valgrind IR and super blocks You can iterate over the statements contained within a superblock, add new statements, remove statements, etc. Which super block gets translated next will likely depend on the computation done by the super block itself, which is what you are seeing with the branch termination. What are you trying to do? On Mon, Jun 29, 2020 at 3:02 PM Mark Roberts <ma...@cs...> wrote: > > I am confused by Valgrind's use of the IRSB data structure. The notes > say these are super blocks, but every case I've seen they terminate > with a conditional branch. What is that magic I'm missing in order to > operate on a traditional super block? > > Thank you > Mark Roberts > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users -- Derrick McKee Phone: (703) 957-9362 Email: der...@gm... |
From: Derrick M. <der...@gm...> - 2020-06-29 19:36:40
|
You can iterate over the statements contained within a superblock, add new statements, remove statements, etc. Which super block gets translated next will likely depend on the computation done by the super block itself, which is what you are seeing with the branch termination. What are you trying to do? On Mon, Jun 29, 2020 at 3:02 PM Mark Roberts <ma...@cs...> wrote: > > I am confused by Valgrind's use of the IRSB data structure. The notes say > these are super blocks, but every case I've seen they terminate with a > conditional branch. What is that magic I'm missing in order to operate on a > traditional super block? > > Thank you > Mark Roberts > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users -- Derrick McKee Phone: (703) 957-9362 Email: der...@gm... |
From: Mark R. <ma...@cs...> - 2020-06-29 19:00:37
|
I am confused by Valgrind's use of the IRSB data structure. The notes say these are super blocks, but every case I've seen they terminate with a conditional branch. What is that magic I'm missing in order to operate on a traditional super block? Thank you Mark Roberts |
From: François-Xavier C. <fx....@ya...> - 2020-06-25 23:21:08
|
On Thu, Jun 25, 2020 at 09:49:35PM +0200, Paul FLOYD wrote: > > > De : "François-Xavier Carton via Valgrind-users" > > > Hi, I have a program that calls exec without forking. I would like to run that program under valgrind > > and get a summary report for the code before the call to exec. > > I don't want to trace the exec'ed program, so the --trace-children option does not do what I want. > > Is there a way to have valgrind output the error/leak summary before exec (without tracing after exec)? > > Hi Francois-Xavier > > Sure, this is possible. There are two possible things that you can do > > 1. Use vgdb. To do this you run Valgrind and your test app in one terminal and in a second > terminal you run gdb which connects to the first. In the gdb terminal you can issue > most of the usual commands like 'break' and 'continue'. Before the exec you can do > 'monitor leak_check full'. See > https://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.monitor-commands > for details. > > 2. Use client requests. To do this you need to make some small changes to your code. > You need to include memcheck.h, then just before your exec() insert > > VALGRIND_DO_LEAK_CHECK; > > For more details, see also the manual. > > A+ > Paul > Hi Paul, Thanks! I will try to go with 2., because I would like to automate that. François-Xavier |
From: Paul F. <pj...@wa...> - 2020-06-25 19:49:48
|
> De : "François-Xavier Carton via Valgrind-users" > Hi, I have a program that calls exec without forking. I would like to run that program under valgrind > and get a summary report for the code before the call to exec. > I don't want to trace the exec'ed program, so the --trace-children option does not do what I want. > Is there a way to have valgrind output the error/leak summary before exec (without tracing after exec)? Hi Francois-Xavier Sure, this is possible. There are two possible things that you can do 1. Use vgdb. To do this you run Valgrind and your test app in one terminal and in a second terminal you run gdb which connects to the first. In the gdb terminal you can issue most of the usual commands like 'break' and 'continue'. Before the exec you can do 'monitor leak_check full'. See https://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.monitor-commands for details. 2. Use client requests. To do this you need to make some small changes to your code. You need to include memcheck.h, then just before your exec() insert VALGRIND_DO_LEAK_CHECK; For more details, see also the manual. A+ Paul |