Run pprof on data collected from remote machine? - pprof

I have a program that runs on a remote headless machine (ie no X server) that has a memory leak. I was able to install gperftools and ran the heap checker which found the leak.
My problem is I can't install pprof on the remote machine because of all the graphics libraries required so I copied the generated .heap file onto a different machine that does have pprof installed. This machine also has all the same libraries as the rmote machine.
I tried running the pprof command suggested by the heap checker, but with --text instead of --gv
$ pprof <my_bin> <heap_file> --inuse_objects --lines --heapcheck --text
but it complains about a failed curl command
Using local file <my_bin>.
Use of uninitialized value $host in substitution (s///) at
/usr/bin/pprof line 3195. Use of uninitialized value $hostport in
concatenation (.) or string at /usr/bin/pprof line 3197. Use of
uninitialized value $prefix in concatenation (.) or string at
/usr/bin/pprof line 3197. Use of uninitialized value $host in
substitution (s///) at /usr/bin/pprof line 3195. Use of uninitialized
value $hostport in concatenation (.) or string at /usr/bin/pprof line
3197. Use of uninitialized value $prefix in concatenation (.) or string at /usr/bin/pprof line 3197. Use of uninitialized value $host
in sprintf at /usr/bin/pprof line 3364. Gathering CPU profile from
http:///pprof/profile?seconds=30 for 30 seconds to
/home/developer/pprof/<my_bin>.1640195244. Be patient...
curl: (6) Couldn't resolve host 'http' Failed to get profile: curl
'http:///pprof/profile?seconds=30' >
/home/developer/pprof/.tmp.<my_bin>.1640195244.: No such
file or directory
So my questions are:
is what I am attempting even possible?
is there a different pprof command I should be using?
what is the curl command about?
Thanks,

Simply use go version of pprof. In this case I suspect what happens is that arg parsing doesn't really support flags at the end (I suspect go's has this bug as well). This use case of pprofing with binary and pprof file is definitely supported.

Related

tcpdump command line step issue, argument is not permitted

i am trying to capture packets to resolve a proxychains access denied issue. I am stuck on this command...any help?
sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
Failed to set capabilities on file `/usr/sbin/tcpdump' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

gdb: unknown target exception

When trying to run a program using gdb I get
[New Thread 4612.0x158c]
[New Thread 4612.0x1cb8]
[New Thread 4612.0x11e8]
[New Thread 4612.0x1190]
gdb: unknown target exception 0x406d1388 at 0x746623d2
Program received signal ?, Unknown signal.
0x746623d2 in RaiseException () from /cygdrive/c/WINDOWS/System32/KERNELBASE.dll
I researched this and found three possible causes: (1) path environment variable not set, (2) drive not mapped, and (3) using the wrong version of gdb (32-bit or 64-bit). So I added C:\cygwin\bin to the path environment variable, typed mount and got
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
When I type show configuration get
This GDB was configured as follows:
configure --host=i686-pc-cygwin --target=i686-pc-cygwin
--with-auto-load-dir=$debugdir:$datadir/auto-load
--with-auto-load-safe-path=$debugdir:$datadir/auto-load
--with-expat
--with-gdb-datadir=/usr/share/gdb (relocatable)
--with-jit-reader-dir=/usr/lib/gdb (relocatable)
--without-libunwind-ia64
--with-lzma
--with-python=/usr (relocatable)
--without-guile
--with-separate-debug-dir=/usr/lib/debug (relocatable)
--without-babeltrace
and my computer is 32 bits, so it appears to be the correct version.
gdb itself seems to work, e.g. I can type watch followed by an address and it will set a watchpoint; gcc and g++ work fine, and the program I am debugging will start if I run it from the command line but not from gdb.
What other things should I check?
This is a special technical exception that communicates thread name to supporting debugger (Delphi RAD Studio, Visual Mess etc.). It is convenient to look at the thread list in the debugger and understand what is going on by looking at names. Threads throw this exception and instantly catch it, doing nothing in the handler. Until recent SetThreadName introduction, it was the only common way to set thread name. SetThreadName is Unicode, but SetThreadName not widely supported yet, so many libraries use supported method. It can be IME, OLE, whatever spawns threads.
I guess, gdb is aware of neither method. Just ignore this exception.
I had the same problem. I am also using x86 with eclipse mars.2 on a Vista, and by default, gdb 7.10 was downloaded by setup. I also tried all you have tried to no avail.
Lastly, I noticed the link below and upgraded gdb to 7.11 and the problem was fixed.
https://cygwin.com/ml/cygwin/2016-10/msg00243.html

eval/exec can not be executed in TCL script

I am using TCL to control a traffic generator. When the traffic received, I want to use shark command to convert the .pcap file to a .txt file, and then I can do some other job.
But when run the exec in the program the following info print out:
while executing
"exec tshark -Vxr /var/tmp/PCRF/create_req.pcap"
("eval" body line 1)
invoked from within
"eval exec {tshark -Vxr /var/tmp/PCRF/create_req.pcap}"
(file "./tcp_test.tcl" line 7)
The following is the TCL script:
# Radius accounting request start packets
# Version 1.0
# Date 2014/4/16 16:38
puts "\n Begin to decode the capture file\n"
#source /var/tmp/PCRF/convert_pcap.tcl
eval exec {tshark -Vxr /var/tmp/PCRF/create_req.pcap}
puts "\n end of the file decode and the result is rrr\n"
Tcl's exec can throw an error for two reasons. It does so if either:
The subprocess returns a non-zero exit code.
The subprocess writes to standard error.
The first one can be annoying, but it is genuinely how programs are supposed to indicate real errors. It can be a problem if the program also uses it in other ways (e.g., to say that nothing was found, like grep does) but that. However, in this case you get the error message child process exited abnormally so it is easy to at least figure out what happened.
More problematic is when something is written to standard error; the message written there is used as the error message after newline stripping. Even just a newline will trigger a failure, and that failure overwrites any chance of getting the real out from the program (and in the case of just a newline, is highly mysterious). Here's a (possibly) reproduction of your problem:
% exec /bin/sh -c {echo >&2}
% set errorInfo
while executing
"exec /bin/sh -c {echo >&2}"
How to fix this? Well, you can try the -ignorestderr option (if supported by your version of Tcl, which you don't mention):
exec -ignorestderr tshark -Vxr /var/tmp/PCRF/create_req.pcap
Or you can try merging the standard output and standard error channels with 2>#1, so that the error messages are part of the overall output stream (and picked up as a normal result):
exec tshark -Vxr /var/tmp/PCRF/create_req.pcap 2>#1
Or you could use a merge-pipe (needed for older Tcl versions):
exec tshark -Vxr /var/tmp/PCRF/create_req.pcap |& cat
Or you can even direct the subprocess's standard error to the main standard error: the user (or exterior logger) will see the “error” output, but Tcl won't (and the exec won't fail):
exec tshark -Vxr /var/tmp/PCRF/create_req.pcap 2>#stderr
More elaborate things are possible with Tcl 8.6, which can make OS pipes with chan pipe, and you can (in all Tcl versions) run subprocesses as pipelines with open |… but these are probably overkill.
You don't need eval exec {stuff…}; plain old exec stuff… is precisely equivalent, shorter to write and a bit easier to get correct.

Passing connection string properties when using DTEXEC

I am wondering what the correct format is for passing connection string properties on the command line when using dtexec:
dtexec.exe /Ser IpAddress\Instance /IS "\SSISDB\Data Warehouse\MyProject\MyPackage.dtsx" /DumpOnError /Set \Package.Variables[DW_ConnectionString].Properties[Value];\""Data Source=IpAddress;Initial Catalog=DWDB;Provider=SQLNCLI10.1;IntegratedSecurity=SSPI;"\"
I have defined the above command line configuration where I am attempting to pass override properties for the default connection string properties. The packages I'm targeting are not using package connections, but instead project level parameters/properties have been defined to store the DB connections.
For some reason I can't get this to work . I am getting an error message on the server saying
Failed to configure an overridden property that has the
following path: \Package.Variables
[DW_ConnectionString].Properties
[Value]. An error occurred while setting the value of
property "Value". The error returned is 0x80020009
Is my format correct for overriding properties?
The packages are hosted on a remote server
Try using DTEXECUI next time to generate your command string. It has places for all of the variables, connection managers etc. All you have to do is bring up your package and it fills everything in. You then enter any changes you want in the GUI then go to the Command line tab and it will give you the string to put after DTEXEC.EXEC. You can of course also run the package from DTEXECUI also.
It turns out that my format was wrong:
It's incorrect to use /Set Package Variable in this context:
The correct format is:
/Par "$Project::DW_ConnectionString";\""Data Source=Server\Instance;Initial Catalog=myDb;Provider=SQLNCLI11.1;Integrated Security=SSPI;AutoTranslate=False;"\"

xilinx: Failed executing Tcl generator during memory synthesis

I am trying to produce a memory (simple dual port ram) using core generator in xilinx 14.2. The problem is that during synthesis says :
ERROR:sim - Failed to run command ' -p xc3s100e-5cp132 -sd
"C:/Users/ORiON/register_file/ipcore_dir/tmp/_cg/_dbg/" -sd
"C:/Users/ORiON/register_file/ipcore_dir/tmp/_cg/" -dd
"C:/Users/ORiON/register_file/ipcore_dir/tmp/_cg/_dbg/" "MEM_aRd_sWr_16x32"
"C:/Users/ORiON/register_file/ipcore_dir/tmp/_cg/MEM_aRd_sWr_16x32.ngc"
-intstyle xflow'. Executable file not found.
ERROR:sim - Failed executing Tcl generator.
Wrote CGP file for project 'MEM_aRd_sWr_16x32'.
Core Generator create command failed.
ERROR:sim - Failed to generate 'MEM_aRd_sWr_16x32'. Failed executing Tcl
generator.
The command itself is missing.
Failed to run command 'A_COMMAND_SHOULD_BE_HERE -p xc3s100e-5cp132 -sd
I assume it's a kind of script or makefile who is calling this command and the command is defined as a variable. And the variable is not assigned. Something like that?