Zz -----Original Message----- From: valgrind-users-requ...@lists.sourceforge.net Date: Wed, 15 Jun 2011 17:56:00 To: <valgrind-users@lists.sourceforge.net> Reply-To: valgrind-users@lists.sourceforge.net Subject: Valgrind-users Digest, Vol 61, Issue 5
Send Valgrind-users mailing list submissions to valgrind-users@lists.sourceforge.net To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/valgrind-users or, via email, send a message with subject or body 'help' to valgrind-users-requ...@lists.sourceforge.net You can reach the person managing the list at valgrind-users-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Valgrind-users digest..." Today's Topics: 1. noted but unhandled ioctl 0xae03 with no size/direction hints (Oleg Kutkov) 2. Re: noted but unhandled ioctl 0xae03 with no size/direction hints (John Reiser) 3. Re: noted but unhandled ioctl 0xae03 with no size/direction hints (John Reiser) 4. Re: noted but unhandled ioctl 0xae03 with no size/direction hints (Oleg Kutkov) 5. Illegal instruction in armv7 (Nuno Cardoso) 6. Re: Illegal instruction in armv7 (Julian Seward) 7. Device Drivers (Nuno Cardoso) 8. Re: Device Drivers (Eugene Shatokhin) ---------------------------------------------------------------------- Message: 1 Date: Thu, 9 Jun 2011 17:06:16 +0300 From: Oleg Kutkov <elenb...@gmail.com> Subject: [Valgrind-users] noted but unhandled ioctl 0xae03 with no size/direction hints To: valgrind-users@lists.sourceforge.net Message-ID: <BANLkTikzYjQ_hTrAO99zrfDFy=xzvt-...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hello. I'm trying to debug my very big appliction using valgrind. Thank you for this great instrument! But i can't understand one valgrind message: Application startup: ==1019== Warning: noted but unhandled ioctl 0xae03 with no size/direction hints ==1019== This could cause spurious value errors to appear. ==1019== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper. Application shutting down: ==1019== Warning: noted but unhandled ioctl 0xae06 with no size/direction hints ==1019== This could cause spurious value errors to appear. ==1019== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper. I read valgrind documents about MISSING_SYSCALL_OR_IOCTL, but still don't understand. Which and where syscall is unhandled, how to explain this message? Thanks. Best regards, Oleg. ------------------------------ Message: 2 Date: Thu, 09 Jun 2011 08:04:03 -0700 From: John Reiser <jrei...@bitwagon.com> Subject: Re: [Valgrind-users] noted but unhandled ioctl 0xae03 with no size/direction hints To: valgrind-users@lists.sourceforge.net Message-ID: <4df0e0e3.1070...@bitwagon.com> Content-Type: text/plain; charset=ISO-8859-1 > ==1019== Warning: noted but unhandled ioctl 0xae03 with no size/direction > hints > ==1019== This could cause spurious value errors to appear. > ==1019== See README_MISSING_SYSCALL_OR_IOCTL for guidance on > writing a proper wrapper. The syscall is: ioctl(fd, 0xae03, ...) where 'fd' is some file descriptor, and the ellipsis '...' means that there may be more arguments. In most cases, there are three arguments, and the last one is the address of some 'struct' that is specific to the "operation code" 0xae03. Notice that 0==(0xffff0000 & 0xae03) , which means that the operation code 0xae03 has no direction hints (the 0xc0000000 bits) and also omits the size hint (the 0x3fff0000 bits.) There are literally thousands of ioctl opcodes (the 0x0000ffff bits), and knowing the size and direction of data transfer is a big pain. Therefore in most cases the size and direction are part of the high 16 bits of the opcode; but not in this case. You can try searching /usr/include/.../*.h files for "ae03", but this is likely to fail because the source for the opcode probably is something like "(FOO|3)" with a "#define FOO 0xae00". One good way to learn more is to run the app under 'strace'. Strace decodes and prints syscalls as they occur. Strace knows many ioctl already, but perhaps not 0xae03. However, the output from strace will enable you to find the 'fd' and probably its filename. Find the syscall with 0xae03 as the second argument, then search backward for the 'open' whose return value equals the first argument to the ioctl. -- ------------------------------ Message: 3 Date: Fri, 10 Jun 2011 06:45:10 -0700 From: John Reiser <jrei...@bitwagon.com> Subject: Re: [Valgrind-users] noted but unhandled ioctl 0xae03 with no size/direction hints To: Valgrind Users <valgrind-users@lists.sourceforge.net> Message-ID: <4df21fe6.3040...@bitwagon.com> Content-Type: text/plain; charset=ISO-8859-1 On 06/10/2011 05:38 AM, Igmar Palsenberg wrote: > > On Jun 9, 2011, at 5:04 PM, John Reiser wrote: > >>> ==1019== Warning: noted but unhandled ioctl 0xae03 with no size/direction >>> hints >>> ==1019== This could cause spurious value errors to appear. >>> ==1019== See README_MISSING_SYSCALL_OR_IOCTL for guidance on >>> writing a proper wrapper. >> The syscall is: >> ioctl(fd, 0xae03, ...) Igmar Palsenberg <maill...@palsenberg.com> writes: > I would bet my money on KVM_CHECK_EXTENSION. The KVM ioctl() from what I can > remember is two dozens of ioctl()'s, so if no one else volenteers, I'm > willing to supply a patch for this. That is, if Oleg can somehow confirm that > this really is KVM. linux/include/linux/kvm.h has ----- #define KVMIO 0xAE #define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03) ----- and in this particular case there are only two arguments used by the ioctl, so the valgrind Warning is just a warning: the ioctl does not access user address space. -- ------------------------------ Message: 4 Date: Sat, 11 Jun 2011 14:34:23 +0300 From: Oleg Kutkov <elenb...@gmail.com> Subject: Re: [Valgrind-users] noted but unhandled ioctl 0xae03 with no size/direction hints To: valgrind-users@lists.sourceforge.net Message-ID: <BANLkTiky0RB7P8BtZ=s9z_LdYPH9=ow...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On 06/10/2011 05:38 AM, Igmar Palsenberg wrote: > > On Jun 9, 2011, at 5:04 PM, John Reiser wrote: > >>> ==1019== Warning: noted but unhandled ioctl 0xae03 with no size/direction >>> hints >>> ==1019== This could cause spurious value errors to appear. >>> ==1019== See README_MISSING_SYSCALL_OR_IOCTL for guidance on >>> writing a proper wrapper. >> The syscall is: >> ioctl(fd, 0xae03, ...) > Igmar Palsenberg <maillist@...> writes: > I would bet my money on KVM_CHECK_EXTENSION. The KVM ioctl() from what I can > remember is two dozens of ioctl()'s, so if no > one else volenteers, I'm > willing to supply a patch for this. That is, if Oleg can somehow confirm that > this really is KVM. > > linux/include/linux/kvm.h has > ----- > #define KVMIO 0xAE > > #define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03) > ----- > and in this particular case there are only two arguments used by the ioctl, > so the valgrind Warning is just a warning: the ioctl does not access user > address space. Hello. Thanks for this explanations. This is was very helpful for me. And no, this is not KVM. It's just some bad defines in my project. --- Best regards, Oleg Kutkov. ------------------------------ Message: 5 Date: Tue, 14 Jun 2011 23:42:50 +0100 From: Nuno Cardoso <linu...@gmail.com> Subject: [Valgrind-users] Illegal instruction in armv7 To: valgrind-users@lists.sourceforge.net Message-ID: <BANLkTikeNS=oR2Z1ChC+eR_wF=bvv1t...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hi list, I cross-compile valgrind-3.6.0 to run on devkit8000 board (armv7)... when I run "valgrind --tool=cachegrind ls", this error happens: ==702== Cachegrind, a cache and branch-prediction profiler ==702== Copyright (C) 2002-2010, and GNU GPL'd, by Nicholas Nethercote et al. ==702== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info ==702== Command: ls ==702== --702-- Warning: Cannot auto-detect cache config on ARM, using one or more defaults disInstr(arm): unhandled instruction: 0xF421070D cond=15(0xF) 27:20=66(0x42) 4:4=0 3:0=13(0xD) ==702== valgrind: Unrecognised instruction at address 0x401721c. ==702== Your program just tried to execute an instruction that Valgrind ==702== did not recognise. There are two possible reasons for this. ==702== 1. Your program has a bug and erroneously jumped to a non-code ==702== location. If you are running Memcheck and you just saw a ==702== warning about a bad jump, it's probably your program's fault. ==702== 2. The instruction is legitimate but Valgrind doesn't handle it, ==702== i.e. it's Valgrind's fault. If you think this is the case or ==702== you are not sure, please let us know and we'll try to fix it. ==702== Either way, Valgrind will now raise a SIGILL signal which will ==702== probably kill your program. ==702== ==702== Process terminating with default action of signal 4 (SIGILL) ==702== Illegal opcode at address 0x401721C ==702== at 0x401721C: memcpy (in /lib/ld-2.9.so) ... Illegal instruction Do you know what is the problem? Thanks, Nuno Cardoso. ------------------------------ Message: 6 Date: Wed, 15 Jun 2011 01:22:26 +0200 From: Julian Seward <jsew...@acm.org> Subject: Re: [Valgrind-users] Illegal instruction in armv7 To: valgrind-users@lists.sourceforge.net Message-ID: <201106150122.26692.jsew...@acm.org> Content-Type: Text/Plain; charset="iso-8859-1" Try building the svn trunk, as described as http://www.valgrind.org/downloads/repository.html since this problem might already have been fixed there (not sure, but worth a try.) J On Wednesday, June 15, 2011, Nuno Cardoso wrote: > Hi list, > I cross-compile valgrind-3.6.0 to run on devkit8000 board (armv7)... > when I run "valgrind --tool=cachegrind ls", this error happens: > > > ==702== Cachegrind, a cache and branch-prediction profiler > ==702== Copyright (C) 2002-2010, and GNU GPL'd, by Nicholas Nethercote et > al. ==702== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright > info ==702== Command: ls > ==702== > --702-- Warning: Cannot auto-detect cache config on ARM, using one or > more defaults > disInstr(arm): unhandled instruction: 0xF421070D > cond=15(0xF) 27:20=66(0x42) 4:4=0 3:0=13(0xD) > ==702== valgrind: Unrecognised instruction at address 0x401721c. > ==702== Your program just tried to execute an instruction that Valgrind > ==702== did not recognise. There are two possible reasons for this. > ==702== 1. Your program has a bug and erroneously jumped to a non-code > ==702== location. If you are running Memcheck and you just saw a > ==702== warning about a bad jump, it's probably your program's fault. > ==702== 2. The instruction is legitimate but Valgrind doesn't handle it, > ==702== i.e. it's Valgrind's fault. If you think this is the case or > ==702== you are not sure, please let us know and we'll try to fix it. > ==702== Either way, Valgrind will now raise a SIGILL signal which will > ==702== probably kill your program. > ==702== > ==702== Process terminating with default action of signal 4 (SIGILL) > ==702== Illegal opcode at address 0x401721C > ==702== at 0x401721C: memcpy (in /lib/ld-2.9.so) > ... > Illegal instruction > > Do you know what is the problem? > Thanks, > Nuno Cardoso. > > --------------------------------------------------------------------------- > --- EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Valgrind-users mailing list > Valgrind-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/valgrind-users ------------------------------ Message: 7 Date: Wed, 15 Jun 2011 18:24:50 +0100 From: Nuno Cardoso <linu...@gmail.com> Subject: [Valgrind-users] Device Drivers To: valgrind-users@lists.sourceforge.net Message-ID: <banlktinq8dnwkd7nuivlm9z22a34e+o...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hi list, Can I use Valgrind to make some memory leaks tests and performance tests on device drivers? Thanks, Huck. ------------------------------ Message: 8 Date: Wed, 15 Jun 2011 21:55:46 +0400 From: Eugene Shatokhin <dame_eug...@mail.ru> Subject: Re: [Valgrind-users] Device Drivers To: Nuno Cardoso <linu...@gmail.com> Cc: valgrind-users@lists.sourceforge.net Message-ID: <4df8f222.2080...@mail.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, On 15.06.2011 21:24, Nuno Cardoso wrote: > Hi list, > Can I use Valgrind to make some memory leaks tests and performance > tests on device drivers? I guess, you are talking about the device drivers implemented as Linux kernel modules, right? If so, the answer is "you can - to some extent". Valgrind-based tools operate on user-space processes. You can try User-Mode Linux project (http://en.wikipedia.org/wiki/User-mode_Linux) to run a kernel as a whole in a user-space process. That process can probably be analyzed with Valgrind-based tools. Haven't tried this myself though. Apart from that, there are other tools that may be more suitable for you and easier to use depending on what you try to accomplish. They are more oriented towards kernel-mode software. SystemTap (http://sourceware.org/systemtap/) and profiling facilities included into the kernel can help you obtain performance-related information. Ftrace and LTTng might also be helpful here. To detect memory leaks in a kernel module, you can try Kmemleak (included into the kernel) or KEDR (http://kedr.berlios.de/) - both are quite easy to use. You could also try Kmemcheck tool, if you need to detect incorrect memory accesses. Despite its name, Kmemcheck is based on a different technology then Valgrind's Memcheck. The overhead of Kmemcheck is rather high but it is a useful tool nonetheless. Hope this helps. Regards, Eugene ------------------------------ ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ------------------------------ _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users End of Valgrind-users Digest, Vol 61, Issue 5 ********************************************* ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users