Debugging with apport for proprietary program (ubuntu) - debugging

A program I compiled and executed (by a shell script, as another user) sometimes crashes:
./run.sh: line 19: 7964 Segmentation fault (core dumped) ./Program ARG1 ARG2 ARG3 2>&1
I wanted to take a look at the core file to figure out where the crash might have happened. Unfortunately, there's no standard core file to be found, but apparently Ubuntu called it's default crash handler apport, which says in its log:
ERROR: apport (pid 8841) Mon Jun 2 17:59:04 2014: called for pid 7964, signal 11, core limit 0
ERROR: apport (pid 8841) Mon Jun 2 17:59:04 2014: executable: /path/to/Program (command line "./Program ARG1 ARG2 ARG3")
ERROR: apport (pid 8841) Mon Jun 2 17:59:04 2014: is_closing_session(): no DBUS_SESSION_BUS_ADDRESS in environment
ERROR: apport (pid 8841) Mon Jun 2 17:59:16 2014: wrote report /var/crash/_path_to_Program.1001.crash
I've been trying to process the crash dump file with apport-retrace, but apport doesn't handle the file very well because it apparently expects Ubuntu-specific packages:
ERROR: report file does not contain one of the required fields: CoreDump DistroRelease Package ExecutablePath
Looking at the crash dump file, I think there's important debugging information inside, so my question: is there another way to process this file, either with gdb, or extract a core dump file from it if the core dump is indeed stored inside?
For reference, here's (partially) the .crash file:
ProblemType: Crash
Architecture: amd64
Date: Mon Jun 2 17:59:04 2014
DistroRelease: Ubuntu 13.04
ExecutablePath: /path/to/Program
ExecutableTimestamp: 1401723071
ProcCmdline: ./Program ARG1 ARG2 ARG3
ProcCwd: /path/to
ProcEnviron: PATH=(custom, no user)
ProcMaps:
... (memory map left out)
ProcStatus:
Name: Program
State: S (sleeping)
Tgid: 7964
Pid: 7964
PPid: 7963
TracerPid: 0
Uid: 1001 1001 1001 1001
Gid: 1001 1001 1001 1001
FDSize: 64
Groups: 4 27 1001
VmPeak: 1009888 kB
VmSize: 1009884 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 205400 kB
VmRSS: 205400 kB
VmData: 762620 kB
VmStk: 136 kB
VmExe: 3312 kB
VmLib: 64144 kB
VmPTE: 852 kB
VmSwap: 0 kB
Threads: 9
SigQ: 0/127009
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000001206
SigCgt: 0000000180000000
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 0000001fffffffff
Seccomp: 0
Cpus_allowed: ff
Cpus_allowed_list: 0-7
Mems_allowed: 00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 3669360
nonvoluntary_ctxt_switches: 85456
Signal: 11
Uname: Linux 3.8.0-35-generic x86_64
UserGroups: adm sudo
CoreDump: base64
H4sICAAAAAAC/0NvcmVEdW1wAA==
... (huge base64 encoded string left out)

Related

how to config u-boot for imx6?

When I am trying to make u-boot for apalis-aimx6-quad board, and below list is shows the details of my configuration:
CROSS_COMPILER = aarch64-unknown-linux-gnu
1.1 it already exported to path
1.2 menuconfig of the cross compiler remains as before.
Host Linux version = 5.4.0-109-generic #123~18.04.1-Ubuntu
version of the cross compiler : crosstool-ng-1.25-rc2
according to the mentioned software and hardware properties, I faced with the following error when i try to make the boot-loader for my board using u-boot:
cc1: error: bad value (‘generic-armv7-a’) for ‘-mtune=’ switch
cc1: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem corei7
westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell
skylake skylake-avx512 bonnell atom silvermont slm knl intel x86-64 eden-x2
nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron
opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3
bdver4 znver1 btver1 btver2 generic
scripts/Makefile.build:147: recipe for target 'lib/asm-offsets.s' failed
make[1]: *** [lib/asm-offsets.s] Error 1
Makefile:1965: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
what can be the error solution?
and the Second question is:
in the ./ct-ng list-samples what type of samples are suitable for my board?
CPU-NAME = NXP® i.MX 6Quad
CPU-TYPE : 4x Arm Cortex™-A9
CPU-CLOCK : 800MHz
FLOATING-POINT-UNIT : VFPv3
You are using the wrong compiler, i.e. the gcc from your Linux PC, this is why the error message is suggesting to use values such as corei7 for the -mtune option.
This being said, because your apalis-aimx6-quad SoC is a Cortex-A9,its architecture is Armv7-a and you therefore cannot use a compiler targeting the Armv8-a architecture, such as the aarch64-unknown-linux-gnu-gcc you are using. You should rather use, say, arm-unknown-linux-gnu-gcc or arm-none-eabi-gcc.I would strongly suggest to use an official Arm toolchain, such as this one (available here), for building u-boot, and to avoid using the latest 11.2 version: I have been unable to build u-boot when using it because of an internal compiler error.
You should use CROSS_COMPILE=, and not CROSS_COMPILER= in your build command,and this is the reason why you were using your system gcc instead of aarch64-unknown-linux-gnu-gcc for building u-boot.
Bottom line, your build command should be something like:
CROSS_COMPILE=arm-none-eabi- make mrproper apalis_imx6_defconfig all
After completion of the build command, you should see the u-boot artefacts:
ll u-boot*
-rwxrwxr-x 1 user user 4988448 May 13 07:56 u-boot*
-rw-rw-r-- 1 user user 569504 May 13 07:56 u-boot-dtb.bin
-rw-rw-r-- 1 user user 569568 May 13 07:56 u-boot-dtb.img
-rwxrwxr-x 1 user user 512920 May 13 07:56 u-boot-nodtb.bin*
-rw-rw-r-- 1 user user 639200 May 13 07:56 u-boot-with-spl.imx
-rw-rw-r-- 1 user user 569504 May 13 07:56 u-boot.bin
-rw-rw-r-- 1 user user 18081 May 13 07:55 u-boot.cfg
-rw-rw-r-- 1 user user 10858 May 13 07:55 u-boot.cfg.configs
-rw-rw-r-- 1 user user 56584 May 13 07:56 u-boot.dtb
-rw-rw-r-- 1 user user 569568 May 13 07:56 u-boot.img
-rw-rw-r-- 1 user user 1719 May 13 07:56 u-boot.lds
-rw-rw-r-- 1 user user 1100407 May 13 07:56 u-boot.map
-rwxrwxr-x 1 user user 1538914 May 13 07:56 u-boot.srec*
-rw-rw-r-- 1 user user 195657 May 13 07:56 u-boot.sym
I also do the same thing for RPI 4 which the following command lines do:
wget https://dev.iopsys.eu/fork/uboot.git
tar -xf u-boot.tar.gz
ls ./configs
ls ./configs|grep rpi
make rpi_4_defconfig
export PATH=/home/<your user name>/x-tools/aarch64-rpi4-linux-gnu/bin/:$PATH
type aarch an hit tab if system recognize the compiler continue else
go back and export the compiler path.
export CROSS_COMPILE=aarch64-rpi4-linux-gnu-
make menuconfig
make
------------------------------------------------------------------------
cd ..
mkdir sdcard
sudo cp ../u-boot/u-boot.bin .
wget
------------------------------------------------------------------------
PREPARE MEMORY FOR BOOT
connect your memory to pc.
lsblk --> to know what is the name of the memory (assume it is sdb)
sudo umount /dev/sdb1
sudo cfdisk /dev/sdb --> erase older partitions and clear on 100M partition
-- note : type of the partition have to be fat32
once the partition is created.
sudo mkfs.vfat /dev/sdb1
sudo mount /dev/sdb1 /mnt
wget https://github.com/raspberrypi/firmware/raw/master/boot/start4.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-4-b.dtb
gedit config.txt
--#######################
IN THE CONFIG
enable_uart=1
kernel=u-boot.bin
arm_64bit=1
--#######################
cat config.txt
sudo cp * /mnt
sudo umount /mnt
unconnect the memory and connect it to the target machine.

GODEBUG=memprofilerate env variable not taking effect with pprof

ubuntu$ echo $GODEBUG
memprofilerate=1024
I set this var in my bashrc. But still when I do heap profiling only allocs > 512kb are seen in top command. What am I missing?
More outputs:
ubuntu$ env | grep '^GODEBUG='
GODEBUG=memprofilerate=1024
ubuntu$ env | grep '^GODEBUG=' | xxd
00000000: 474f 4445 4255 473d 6d65 6d70 726f 6669 GODEBUG=memprofi
00000010: 6c65 7261 7465 3d31 3032 340a lerate=1024.
Edit: This is a long running process running over 4 days. The linux top -p command is showing a steady increase in memory used by this process but pprof is not able to catch newly allocated space.
Last 2 profile collections:
Jul 26 2pm : Top shows used KiB mem - 3145692. pprof profile heap1.out
Jul 28 7pm : Top shows used KiB mem - 3915992. pprof profile heap2.out
go tool pprof of heap1.out and heap2.out show the same top 27 inuse_space numbers.

Jmeter run in ubuntu server none gui mode not show nothing result

I try to run command ./jmeter.sh -n -t ../../apache-jmeter-4.0/test-case-2018/jmeter_cron.jmx and i got log message :
Starting the test # Mon Jul 09 17:44:48 ICT 2018 (1531133088159)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary = 0 in 00:00:00 = ******/s Avg: 0 Min: 9223372036854775807 Max: -9223372036854775808 Err: 0 (0.00%)
Tidying up ... # Mon Jul 09 17:44:48 ICT 2018 (1531133088762)
... end of run
It's seem nothing run .
PS: But i run in my desktop ( Windows 10) it's show result as normal . it's the log message from my desktop :
Starting the test # Mon Jul 09 17:09:03 ICT 2018 (1531130943233)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port
4445 summary + 1 in 00:00:01 = 1.4/s Avg: 346 Min: 346
Max: 346 Err: 1 (100.00%) Active: 1 Started: 1 Finished: 0
summary + 6 in 00:00:01 = 5.1/s Avg: 179 Min: 176 Max:
184 Err: 0 (0.00%) Active: 0 Started: 2 Finished: 2 summary =
7 in 00:00:02 = 3.7/s Avg: 203 Min: 176 Max: 346 Err: 1
(14.29%) Tidying up ... # Mon Jul 09 17:09:05 ICT 2018
(1531130945291) ... end of run
Could anyone can help me ?
CSV Data Set Config filename can be tricky in different environments,
Notice you can use absolute path (not in distributed test) but it may be specific for each OS.
You can use Relative path according to path of the active test plan
Notice that Linux can be case sensitive so make sure driven_data.csv all in lower case
Filename Name of the file to be read. Relative file names are resolved with respect to the path of the active test plan. For distributed testing, the CSV file must be stored on the server host system in the correct relative directory to where the JMeter server is started. Absolute file names are also supported, but note that they are unlikely to work in remote mode, unless the remote server has the same directory structure. If the same physical file is referenced in two different ways - e.g. csvdata.txt and ./csvdata.txt - then these are treated as different files. If the OS does not distinguish between upper and lower case, csvData.TXT would also be opened separately.
Double check that:
The file /data/driven_data.csv exists, you will have to copy it from the master node as JMeter doesn't do this automatically
The user account has read access to the /data/driven_data.csv path, if not - grant it using the following command:
sudo chmod -R a+rX /data/driven_data.csv
See online chmod manual page or type man chmod in your terminal to get full help on the command.
Just FYI: the easiest way to implement the data-driven distributed testing in JMeter is using HTTP Simple Table Server which allows sharing the same data file between multiple slave instances so you will not have to copy the file to the remote slaves.
You can install HTTP Simple Table Server using JMeter Plugins Manager

How do systemd journal cursors work?

I'm having trouble with systemd journal cursors.
If I SeekTail(), I get a value for the cursor and can keep calling Next() and it behaves exactly as expected.
However, if I SeekCursor() and then call Next() entry it jumps back to the Head() and starts reading over again. Why would it do that? I can verify that it did locate the cursor correctly. But it's as though SeekCursor only worked for the specific item and thats all. This is not what I would expect reading the man pages and other documentation.
I'm using go-systemd from the CoreOS project which is a simple wrapper for the systemd C-API.
But the go wrapper is not the issue, the C library is. I can see that journalctl is doing the same thing on Ubuntu.
e.g. append to journal, show tail output, get full entry detail in json. Jump to cursor and show tail
matthewh#xen:~$ echo "Cursor example" | systemd-cat
matthewh#xen:~$ journalctl -f
-- Logs begin at Mon 2017-07-03 08:56:12 NZST. --
May 31 17:50:31 xen code.desktop[6771]: [main 17:50:31] update#setState idle
May 31 17:55:01 xen CRON[4468]: pam_unix(cron:session): session opened for user root by (uid=0)
May 31 17:55:01 xen CRON[4469]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
May 31 17:55:01 xen CRON[4468]: pam_unix(cron:session): session closed for user root
May 31 17:55:03 xen smokeping[2839]: RRDs::update ERROR: /var/lib/smokeping/Local/LocalMachine.rrd: illegal attempt to update using time 1527746103 when last update time is 4073847643 (minimum one second step)
May 31 17:55:22 xen cat[4479]: Hello
May 31 17:59:28 xen cat[4539]: Cursor example
May 31 18:00:03 xen smokeping[2839]: RRDs::update ERROR: /var/lib/smokeping/Local/LocalMachine.rrd: illegal attempt to update using time 1527746403 when last update time is 4073847643 (minimum one second step)
May 31 18:00:06 xen cat[4547]: Cursor example
May 31 18:01:09 xen cat[4597]: Cursor example
^C
matthewh#xen:~$ journalctl -f -o json-pretty -n1
{
"__CURSOR" : "s=b7f2a0f19c9946abab26788729a244c5;i=52a5;b=1ba1d5cabb5840adb02eedc4aba5b4d6;m=2d96b77f94;t=56d7a319ee462;x=8afac4ada39ae1fb",
"__REALTIME_TIMESTAMP" : "1527746469487714",
"__MONOTONIC_TIMESTAMP" : "195802136468",
"_BOOT_ID" : "1ba1d5cabb5840adb02eedc4aba5b4d6",
"_UID" : "1000",
"_GID" : "1000",
"_CAP_EFFECTIVE" : "0",
"_MACHINE_ID" : "f899a862e4aa4775b8995564d8da565d",
"_HOSTNAME" : "xen",
"_TRANSPORT" : "stdout",
"PRIORITY" : "6",
"_COMM" : "cat",
"MESSAGE" : "Cursor example",
"_STREAM_ID" : "d1fbcc3ff027401e9dc95b5648f9322e",
"_PID" : "4597"
}
^C
matthewh#xen:~$ journalctl -f --cursor="s=b7f2a0f19c9946abab26788729a244c5;i=52a5;b=1ba1d5cabb5840adb02eedc4aba5b4d6;m=2d96b77f94;t=56d7a319ee462;x=8afac4ada39ae1fb"
-- Logs begin at Mon 2017-07-03 08:56:12 NZST. --
May 31 18:01:09 xen cat[4597]: Cursor example
-- Reboot --
Feb 04 13:03:03 xen systemd-journald[420]: Runtime journal (/run/log/journal/) is 8.0M, max 241.0M, 233.0M free.
Feb 04 13:03:03 xen kernel: Initializing cgroup subsys cpuset
Feb 04 13:03:03 xen kernel: Initializing cgroup subsys cpu
Feb 04 13:03:03 xen kernel: Initializing cgroup subsys cpuacct
Feb 04 13:03:03 xen kernel: Linux version 4.4.0-116-generic (buildd#lgw01-amd64-021) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) ) #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 (Ubuntu 4.4.0-116.140-generic 4.4.98)
Feb 04 13:03:03 xen kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-116-generic root=UUID=f95a581f-2afb-4428-bade-c913f1c51741 ro quiet splash vt.handoff=7
Feb 04 13:03:03 xen kernel: KERNEL supported cpus:
Feb 04 13:03:03 xen kernel: Intel GenuineIntel
Feb 04 13:03:03 xen kernel: AMD AuthenticAMD
^C
Note the "--reboot--" text and the fact that it jumped back several days in the past. But prior to that, it located my entry via systemd-cat so it was found.
What am I doing wrong? is it a bug or an oversight on my part?
Oddly enough, I have a CoreOS server I was able to test this on and it behaves differently. It behaves as expected. The version of journalctl is the same on both. All the configuration is untouched stock standard.

My command-line program does not find its config directory on CMD shell, but it does on PowerShell

I am using in my script a command-line program that does not find its config directory on CMD shell, but it does on PowerShell.
Even when this question seems to correspond to the behavior of some specific program (a command line hash analyzer tool named OCLHashCat), I think this is mostly a matter of Windows shells behavior and/or variables involved. Let me explain it.
This is the contents of the command line program's directory (OCLHashCat):
d:\Programas\HashCat\OCLHashCat>dir
El volumen de la unidad D es Datos
El número de serie del volumen es: 57E9-ACA0
Directorio de d:\Programas\HashCat\OCLHashCat
07/10/2014 09:28 am <DIR> .
07/10/2014 09:28 am <DIR> ..
06/10/2014 11:56 pm <DIR> charsets
06/10/2014 11:56 pm <DIR> docs
06/10/2014 11:57 pm 4 eula.accepted
02/10/2014 12:11 pm 1.210.228 example.dict
02/10/2014 12:11 pm 220.796 example0.hash
02/10/2014 12:11 pm 36 example400.hash
02/10/2014 12:11 pm 36 example500.hash
06/10/2014 11:56 pm <DIR> extra
02/10/2014 12:11 pm 33.685.504 hashcat.hcstat
06/10/2014 11:56 pm <DIR> kernels
06/10/2014 11:56 pm <DIR> masks
02/10/2014 12:11 pm 72 oclExample0.cmd
02/10/2014 12:11 pm 66 oclExample0.sh
02/10/2014 12:11 pm 68 oclExample400.cmd
02/10/2014 12:11 pm 61 oclExample400.sh
02/10/2014 12:11 pm 61 oclExample500.cmd
02/10/2014 12:11 pm 55 oclExample500.sh
15/11/2014 11:46 pm 128 oclHashcat.dictstat
07/10/2014 02:52 am 11.448 oclHashcat.log
07/10/2014 02:52 am <DIR> oclHashcat.outfiles
07/10/2014 02:03 am 0 oclHashcat.pot
07/10/2014 09:28 am 400 oclHashcat.restore
02/10/2014 12:11 pm 388.744 oclHashcat32.bin
02/10/2014 12:11 pm 419.840 oclHashcat32.exe
02/10/2014 12:11 pm 383.136 oclHashcat64.bin
02/10/2014 12:11 pm 432.128 oclHashcat64.exe
06/10/2014 11:56 pm <DIR> rules
As you can see, the directory kernels is right there.
And the home dir of OCLHashCat is in my path:
C:\>oclhashcat64
oclHashcat v1.31 starting...
Usage: oclhashcat64 [options]... hash|hashfile|hccapfile [dictionary|mask|direct
ory]...
Try --help for more help.
But if I try to run, it can not find some of its own files/directories:
C:\Temporal>oclhashcat64 Test.hccap -m 2500 -a 3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel ./kernels/4098/m02500.Bonaire_1573.4_1573.4 (VM).kernel not fo
und in cache! Building may take a while...
ERROR: ./kernels/4098/m02500.VLIW1.llvmir: No such file or directory
Note the final error: it can not find a file, but I have checked that such file exists:
C:\Temporal>dir d:\Programas\HashCat\OCLHashCat\kernels\4098\m02500.VLIW1.llvmir
El volumen de la unidad D es Datos
El número de serie del volumen es: 57E9-ACA0
Directorio de d:\Programas\HashCat\OCLHashCat\kernels\4098
02/10/2014 12:11 pm 326.912 m02500.VLIW1.llvmir
1 archivos 326.912 bytes
And, if I CHDir into the program's directory:
d:\Programas\HashCat\OCLHashCat>oclhashcat64 -m 2500 "c:\Temporal\Test.hccap" -a
3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel ./kernels/4098/m02500.Bonaire_1573.4_1573.4 (VM).kernel (25932
0 bytes)
Device #1: Kernel ./kernels/4098/markov_le_v1.Bonaire_1573.4_1573.4 (VM).kernel
(92404 bytes)
Device #1: Kernel ./kernels/4098/bzero.Bonaire_1573.4_1573.4 (VM).kernel (30496
bytes)
Device #2: Kernel ./kernels/4098/m02500.Tahiti_1573.4_1573.4 (VM).kernel (259428
bytes)
Device #2: Kernel ./kernels/4098/markov_le_v1.Tahiti_1573.4_1573.4 (VM).kernel (
92388 bytes)
Device #2: Kernel ./kernels/4098/bzero.Tahiti_1573.4_1573.4 (VM).kernel (30492 b
ytes)
[s]tatus [p]ause [r]esume [b]ypass [q]uit =>
That is: everything works like a charm.
In Powershell everything works perfect wherever I call the program from. Example:
PS C:\Temporal> oclHashcat64.exe Test.hccap -m 2500 -a 3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Bonaire_1573.4_1573.4 (VM).kernel (259320 bytes)
Device #1: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Bonaire_1573.4_1573.4 (VM).kernel (92404 bytes)
Device #1: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Bonaire_1573.4_1573.4 (VM).kernel (30496 bytes)
Device #2: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Tahiti_1573.4_1573.4 (VM).kernel (259428 bytes)
Device #2: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Tahiti_1573.4_1573.4 (VM).kernel (92388 bytes)
Device #2: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Tahiti_1573.4_1573.4 (VM).kernel (30492 bytes)
[s]tatus [p]ause [r]esume [b]ypass [q]uit =>
, but there are some reasons that make me need the classic CMD shell, like usage with CygWin (that should allow me to use GNU Screen, but this is another matter).
I think the problem comes from that ./kernels... reference, that makes the command line program (OCLHashCat) try to search the directory in the running path, instead of searching for it in the origin path (the program`s path tree).
Could anyone please give me some idea to try?
EXTRA INFO: The program OCLHashCat has Linux and Windows versions, so it could be some compilation/programming problem or equivalent.
EXTRA INFO 2: This program has changed version 4-5 times in the last year, and I keep having this problem with it.
EXTRA INFO under requestion:
PS C:\Temporal> get-command oclHashcat64.exe | fl *
HelpUri :
FileVersionInfo : File: d:\Programas\HashCat\OCLHashCat\oclHashcat6
4.exe
InternalName:
OriginalFilename:
FileVersion:
FileDescription:
Product:
ProductVersion:
Debug: False
Patched: False
PreRelease: False
PrivateBuild: False
SpecialBuild: False
Language:
Path : d:\Programas\HashCat\OCLHashCat\oclHashcat64.exe
Extension : .exe
Definition : d:\Programas\HashCat\OCLHashCat\oclHashcat64.exe
Visibility : Public
OutputType : {System.String}
Name : oclHashcat64.exe
CommandType : Application
ModuleName :
Module :
Parameters :
ParameterSets :
So, the path in PowerShell seems correct.
EXTRA INFO about SSH: By SSHing into my computer (Windows 7 SP1 running Bitvise SSH Server) the behavior is exactly the same. It doesn't work for standard shell:
login as: Luis-
Luis-#Windu-'s password:
Microsoft Windows [Versión 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.
C:\Users\Luis->cd \Temporal
C:\Temporal>oclhashcat64 Test.hccap -m 2500 -a 3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
WARN: ADL_Overdrive6_FanSpeed_Get(): -5
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel ./kernels/4098/m02500.Bonaire_1573.4_1573.4 (VM).kernel not found
in cache! Building may take a while...
ERROR: ./kernels/4098/m02500.VLIW1.llvmir: No such file or directory
and does for powershell:
login as: Luis-
Luis-#Windu-'s password:
Microsoft Windows [Versión 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.
C:\Users\Luis->powershell
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. Reservados todos los derechos.
PS C:\Users\Luis-> cd \
PS C:\> cd .\Temporal
PS C:\Temporal> oclHashcat64.exe Test.hccap -m 2500 -a 3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
WARN: ADL_Overdrive6_FanSpeed_Get(): -5
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Bonaire_1573.
4_1573.4 (VM).kernel (259320 bytes)
Device #1: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Bonaire
_1573.4_1573.4 (VM).kernel (92404 bytes)
Device #1: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Bonaire_1573.4
_1573.4 (VM).kernel (30496 bytes)
Device #2: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Tahiti_1573.4
_1573.4 (VM).kernel (259428 bytes)
Device #2: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Tahiti_
1573.4_1573.4 (VM).kernel (92388 bytes)
Device #2: Kernel d:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Tahiti_1573.4_
1573.4 (VM).kernel (30492 bytes)
[s]tatus [p]ause [r]esume [b]ypass [q]uit =>
EXTRA INFO upon requestion:
C:\Temporal>oclhashcat64 "c:\Temporal\Test.hccap" -m 2500 -a 3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel ./kernels/4098/m02500.Bonaire_1573.4_1573.4 (VM).kernel not fo
und in cache! Building may take a while...
ERROR: ./kernels/4098/m02500.VLIW1.llvmir: No such file or directory
EXTRA INFO about running on CygWin:
Luis#Windu /cygdrive/c/Temporal
$ oclhashcat64 Test.hccap -m 2500 -a 3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Bonaire_1573.4_1573.4 (VM).kernel (259320 bytes)
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Bonaire_1573.4_1573.4 (VM).kernel (92404 bytes)
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Bonaire_1573.4_1573.4 (VM).kernel (30496 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Tahiti_1573.4_1573.4 (VM).kernel (259428 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Tahiti_1573.4_1573.4 (VM).kernel (92388 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Tahiti_1573.4_1573.4 (VM).kernel (30492 bytes)
[s]tatus [p]ause [r]esume [b]ypass [q]uit =>
So we can say that the program works OK under CygWin. Due to it was possibly programmed initially for Linux?
Maybe I could use this at least as some sort of workaround.
This program apparently find its home from the command-line instead of calling GetModuleFileName. Unlike cmd, PowerShell doesn't use the lpApplicationName parameter of CreateProcess. Instead it modifies the command line to use the full path. For example, it replaces "oclHashcat64.exe" with "d:\Programas\HashCat\OCLHashCat\oclHashcat64.exe". In cmd you'd have to actually type out the full path.
As a workaround you can use the console API to add an input alias for cmd.exe. The old doskey program provides a command-line interface for this API. This way when you type oclHashcat64 into the console, cmd.exe will instead read the full path that's set in the alias:
doskey /exename=cmd.exe oclHashcat64="D:\Programas\HashCat\OCLHashCat\oclHashcat64.exe" $*
You can save aliases (i.e. macros) to a file using doskey /macros:all > aliases. Then load them using doskey /macrofile=aliases. You can also add a command in HKCU\Software\Microsoft\Command Processor\AutoRun to load your aliases when cmd.exe starts.
Another option is to create a Windows shortcut (i.e. a shell32 link file) in some directory that's on your PATH. Use the full path to the executable in the command line, and leave the start in directory empty (i.e. inherit the shell's working directory). Append .LNK to the PATHEXT environment variable to avoid having to type the .lnk extension. (I find link files to be more convenient than using a batch file as a glorified shortcut. Plus they don't install a Ctrl-C handler like batch files do, which is one less thing to annoy me.)

Resources