Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API at port 4068 sends extra 0x00 byte #4

Open
PSLLSP opened this issue Dec 15, 2023 · 0 comments
Open

API at port 4068 sends extra 0x00 byte #4

PSLLSP opened this issue Dec 15, 2023 · 0 comments

Comments

@PSLLSP
Copy link
Owner

PSLLSP commented Dec 15, 2023

I assume this is a bug, that end of string, byte 0x00, is sent in the reply to the client.

Examples, notice that answer from ccminer is terminated with 0x00:

$ echo "meminfo" | nc localhost 4068
STATS=4;HASHLOG=2;MEM=288|

$ echo "meminfo" | nc localhost 4068 | hd
00000000  53 54 41 54 53 3d 34 3b  48 41 53 48 4c 4f 47 3d  |STATS=4;HASHLOG=|
00000010  32 3b 4d 45 4d 3d 32 38  38 7c 00                 |2;MEM=288|.|
0000001b
$ echo "hwinfo" | nc localhost 4068
OS=linux 5.15.0-91-generic;NVDRIVER=;CPUS=4;CPUTEMP=0;CPUFREQ=0|

$ echo "hwinfo" | nc localhost 4068 | hd
00000000  4f 53 3d 6c 69 6e 75 78  20 35 2e 31 35 2e 30 2d  |OS=linux 5.15.0-|
00000010  39 31 2d 67 65 6e 65 72  69 63 3b 4e 56 44 52 49  |91-generic;NVDRI|
00000020  56 45 52 3d 3b 43 50 55  53 3d 34 3b 43 50 55 54  |VER=;CPUS=4;CPUT|
00000030  45 4d 50 3d 30 3b 43 50  55 46 52 45 51 3d 30 7c  |EMP=0;CPUFREQ=0||
00000040  00                                                |.|
00000041
$ echo "help" | nc localhost 4068
summary
threads
pool
histo
hwinfo
meminfo
scanlog
seturl
switchpool
quit
|

$ echo "help" | nc localhost 4068 | hd
00000000  73 75 6d 6d 61 72 79 0a  74 68 72 65 61 64 73 0a  |summary.threads.|
00000010  70 6f 6f 6c 0a 68 69 73  74 6f 0a 68 77 69 6e 66  |pool.histo.hwinf|
00000020  6f 0a 6d 65 6d 69 6e 66  6f 0a 73 63 61 6e 6c 6f  |o.meminfo.scanlo|
00000030  67 0a 73 65 74 75 72 6c  0a 73 77 69 74 63 68 70  |g.seturl.switchp|
00000040  6f 6f 6c 0a 71 75 69 74  0a 7c 00                 |ool.quit.|.|
0000004b
$ echo "summary" | nc localhost 4068
NAME=ccminer_CPU;VER=3.8.3;API=1.9;ALGO=verus;GPUS=1;KHS=1579.82;SOLV=0;ACC=30;REJ=0;ACCMN=2.034;DIFF=2815354890325.682617;NETKHS=0;POOLS=3;WAIT=5;UPTIME=885;TS=1702677400|

$ echo "summary" | nc localhost 4068 | hd
00000000  4e 41 4d 45 3d 63 63 6d  69 6e 65 72 5f 43 50 55  |NAME=ccminer_CPU|
00000010  3b 56 45 52 3d 33 2e 38  2e 33 3b 41 50 49 3d 31  |;VER=3.8.3;API=1|
00000020  2e 39 3b 41 4c 47 4f 3d  76 65 72 75 73 3b 47 50  |.9;ALGO=verus;GP|
00000030  55 53 3d 31 3b 4b 48 53  3d 31 35 38 30 2e 32 37  |US=1;KHS=1580.27|
00000040  3b 53 4f 4c 56 3d 30 3b  41 43 43 3d 33 32 3b 52  |;SOLV=0;ACC=32;R|
00000050  45 4a 3d 30 3b 41 43 43  4d 4e 3d 32 2e 31 32 39  |EJ=0;ACCMN=2.129|
00000060  3b 44 49 46 46 3d 32 38  31 35 33 35 34 38 39 30  |;DIFF=2815354890|
00000070  33 32 35 2e 36 38 32 36  31 37 3b 4e 45 54 4b 48  |325.682617;NETKH|
00000080  53 3d 30 3b 50 4f 4f 4c  53 3d 33 3b 57 41 49 54  |S=0;POOLS=3;WAIT|
00000090  3d 35 3b 55 50 54 49 4d  45 3d 39 30 32 3b 54 53  |=5;UPTIME=902;TS|
000000a0  3d 31 37 30 32 36 37 37  34 31 37 7c 00           |=1702677417|.|
000000ad

BTW, command threads returns empty answer. And there is no way to find how many threads are used for CPU mining...

$ echo "threads" | nc localhost 4068 | hd
00000000  00                                                |.|
00000001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant