Josef,

Since you asked, I ran Valgrind with --demangle=no; the SIGSEGV issue I saw
earlier went away. 

However, I had gone to great lengths to insert symbol information into my
image in order to chase down a run time issue I am having with the code.
Therefore, while running with --demangle=no is a good experiment, it is not
a practical option for me. Is there another way in valgrind to restrict the
string size offered to VG_(strcmp)() so that it won't crash? Can there be
canary protection around the valgrind stack to protect it from being overrun
in situations like these?

Just to confirm, my code runs fine with both (--tool=none) or
(--tool=callgrind --demangle=no). Since I have a space crunch, I took out
cachegrind from the valgrind binaries I placed on my target file system.
Therefore, to answer your question on cache simulator, I don't believe I am
running cachesimulator. 

Turning callgrind on interactively is not a valid option since I am chasing
a run time crash and I don't know where the "interesting" piece(s) of code
actually are. For some legacy reason that no one here is clear about, the
file system is read-only; so I don't get a core-dump when the code crashes.
To overcome this read-only file system limitation, I have made a small
change in the callgrind code so that it will redirect the file descriptor
which callgrind uses to write its data, to the valgrind-listener socket
instead. I have also made small changes to the valgrind-listener code to
write the data it receives, to disk instead of on stdout. 

Therefore, in essence, I am using valgrind --tool=callgrind as a "coredump"
instead. So far it seems to be working fine except for the long function
name issue. I am perfectly fine if all I saw was 100 bytes (and maybe even
less) of the function name. That many bytes will be quite enough for me to
make out the exact function I am targeting. So I shall greatly appreciate
your help on resolving the VG_(strcmp) issue with long names.

Thanks

SVG



-----Original Message-----
From: Josef Weidendorfer [mailto:josef.weidendor...@gmx.de] 
Sent: Wednesday, June 16, 2010 1:56 PM
To: valgrind-users@lists.sourceforge.net
Cc: Satya V. Gupta
Subject: Re: [Valgrind-users] Running Valgrind on ELF/ python/ boost based
executables

On Wednesday 16 June 2010, Satya V. Gupta wrote:
> I made the suggested change (bumped up the Stack size to 512 pages 
> instead of the 16) and continue to have another problem.

If it really is a problem with the tools stack size, instead of increasing
to 512 pages, you can also run with "--demangle=no". This will not call into
the
C++ symbol demangler, which is the only part that needs large stack sizes.

> I have only 256MB RAM in my device and when I bumped up the stack to 
> 512 pages as suggested, all processes go to sleep. The change in stack 
> size obviously changed the behavior of Valgrind.
> 
> The original problem I had was that VG_(strcmp) in callgrind caused a 
> SIGSEGV. The reason it was suggested that I bump up the stack size was 
> that Boost libraries use very long names.
> 
> In my mind, I am better off limiting the size of the two strings that 
> are offered to VG_(strcmp) to some MAX_STRING_SIZE instead of 
> increasing the stack size. However, I do not know what is a reasonable 
> value for MAX_STRING_SIZE? Does anyone have a suggestion on what size 
> I should use here?

Does your code run with "--tool=none" on that device at all?
Do you run with cache simulator on or off (off is better for memory usage)?

Instead of playing around with strings used only once, you are better off
restricting the number of cost counters in Callgrind: e.g. you could switch
on instrumentation only when running the interesting parts of your code, see
the macro CALLGRIND_START_INSTRUMENTATION defined in callgrind.h (to be used
in the *client code*).

Josef

> 
> Thanks
> 
> SVG
> 
> -----Original Message-----
> From: bart.vanass...@gmail.com [mailto:bart.vanass...@gmail.com] On 
> Behalf Of Bart Van Assche
> Sent: Sunday, June 13, 2010 6:06 AM
> To: Satya V. Gupta
> Cc: valgrind-users@lists.sourceforge.net
> Subject: Re: [Valgrind-users] Running Valgrind on ELF/ python/ boost 
> based executables
> 
> On Sun, Jun 13, 2010 at 11:47 AM, Satya V. Gupta 
> <guptasa...@netzero.net>
> wrote:
> > I have a supervisory process that is kicked off by an ELF executable 
> > which in turn invokes some ELF/ python script/ executables based 
> > child
> processes.
> > I wish to run valgrind with --tool=callgrind and be able to inject 
> > valgrind into all processes. So far I have tried to run the 
> > supervisory process with --trace-children=yes and of course
> --tool=callgrind switches.
> >
> > Any ELF based executable process stays up but valgrind receives a 
> > SIGSEGV from all the others. It leaves behind an identical call 
> > stack strace with a bunch of exception handlers that pass through 
> > the main python executable and a bunch of boost libraries.
> >
> > Does anyone have recommendations on how to run python/ boost based 
> > executable?
> 
> Instead of asking the same question twice, you should try the 
> suggestion that was posted in reply to your message on the 
> valgrind-developers mailing list (see also 
>
http://sourceforge.net/mailarchive/forum.php?thread_name=201006122144.03178.
> jseward%40acm.org&forum_name=valgrind-developers).
> 
> Bart.
> 
> 
> 
> 
> ____________________________________________________________
> Get Free Email with Video Mail & Video Chat!
> http://www.netzero.net/freeemail?refcd=NZTAGOUT1FREM0210
> 
> ----------------------------------------------------------------------
> -------- ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental 
> unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Valgrind-users mailing list
> Valgrind-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
> 





____________________________________________________________
TODAY: iPads for $123.74?
Alert: iPads are being auctioned on SwipeBids.com for 95% off today!
http://thirdpartyoffers.netzero.net/TGL3241/4c1a01381c9064642b9st02vuc

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to