#3 undefined behaviour of `FILE *` on /sys and /proc

Closed
opened 3 years ago by pdls0e · 32 comments
pdls0e commented 3 years ago

it works for a sec when launched then outputs then unknow_str var 'n/a'

  • used to work fine before i updated yesterday ( i was running pre pulseaudio update version not sure what version number)
  • OS: ArchLinux 5.13.13-arch1-1
  • CPU: Intel i5-8250U (8) @ 3.400GHz
  • config of cpu_perc: { cpu_perc, "-[%s%%  ]", NULL, 1 SEC, END },
  • compilation output: http://ix.io/3yGf
  • aslstatus launching strace: http://ix.io/3yGe
it works for a sec when launched then outputs then unknow_str var 'n/a' - used to work fine before i updated yesterday ( i was running pre pulseaudio update version not sure what version number) - OS: ArchLinux 5.13.13-arch1-1 - CPU: Intel i5-8250U (8) @ 3.400GHz - config of cpu_perc: { cpu_perc, "-[%s%%  ]", NULL, 1 SEC, END }, - compilation output: http://ix.io/3yGf - aslstatus launching strace: http://ix.io/3yGe
dm9pZCAq commented 3 years ago
Owner

1c7a5809aa this commit have breaking changes to config.h

please change this defines and accordingly interval column in args array

and sorry for this

https://notabug.org/dm9pZCAq/aslstatus/commit/1c7a5809aac81ba21713b2421b685dd4db44c34d this commit have breaking changes to `config.h` please change [this](https://notabug.org/dm9pZCAq/aslstatus/commit/1c7a5809aac81ba21713b2421b685dd4db44c34d#diff-c2701ee305390e59c2503a4fb78bbb65dde10b0R64) defines and accordingly `interval` column in `args` array and sorry for this
dm9pZCAq commented 3 years ago
Owner

and btw there is "stable" releases

i'm refactoring some components and therefor master may be quiet unstable now

and btw there is "stable" [releases](https://notabug.org/dm9pZCAq/aslstatus/releases) i'm refactoring some components and therefor `master` may be quiet unstable now
pdls0e commented 3 years ago
Poster

I did notice the vars changes and renamed them (forgot to mention it) but that hasn't fixed it , however now that i have tried the latest stable release 0.1.3 it is working. Thanks

I did notice the vars changes and renamed them (forgot to mention it) but that hasn't fixed it , however now that i have tried the latest stable release 0.1.3 it is working. Thanks
dm9pZCAq commented 3 years ago
Owner

I did notice the vars changes and renamed them but that hasn't fixed it

can you show compilation errors or warnings?

hasn't fixed it

still outputs unknow_str?

> I did notice the vars changes and renamed them but that hasn't fixed it can you show compilation errors or warnings? > hasn't fixed it still outputs `unknow_str`?
pdls0e commented 3 years ago
Poster

yes it still outputs that while using the master branch

commands i just ran:

compilation output: http://ix.io/3yGY

yes it still outputs that while using the master branch commands i just ran: - git clone https://notabug.org/dm9pZCAq/aslstatus.git && cd aslstatus - make clean install XKB=0 AUDIO=PULSE - aslstatus compilation output: http://ix.io/3yGY
dm9pZCAq commented 3 years ago
Owner

my testing config.h

/* ... */

static struct arg_t args[] = {
{ cpu_perc,		"%3s%%",	NULL,		 1 _SEC,	END },
};

./aslstatus -s output:

n/a%
  5%
  3%
  6%
  5%
...

can you test it with same config and command?

my testing `config.h` ```c /* ... */ static struct arg_t args[] = { { cpu_perc, "%3s%%", NULL, 1 _SEC, END }, }; ``` `./aslstatus -s` output: ``` n/a% 5% 3% 6% 5% ... ``` can you test it with same config and command?
pdls0e commented 3 years ago
Poster

aslstatus -s outputs using the config above

n/a%
  3%
n/a%

then it just hangs no more output or errors

aslstatus -s outputs using the config above ``` n/a% 3% n/a% ``` then it just hangs no more output or errors
dm9pZCAq commented 3 years ago
Owner

then it just hangs

it's outputs only when status changes, but in your case there are constantly outputs unknow_str, so it waits for changes


can you apply this and test again?

diff --git a/components/cpu/linux.c b/components/cpu/linux.c
index 0d77927..5000f33 100644
--- a/components/cpu/linux.c
+++ b/components/cpu/linux.c
@@ -54,8 +54,10 @@ cpu_perc(char *      out,
           &data->states[6])
        != LEN(data->states))
        ERRRET(out);
+   warnx("fscanf ok");
 
    if (!old_states[0]) ERRRET(out);
+   warnx("old_states ok");
 
 #define SUM7(X)          (X[0] + X[1] + X[2] + X[3] + X[4] + X[5] + X[6])
 #define ABS_DEC(A, B) (MAX((A), (B)) - MIN((A), (B)))
@@ -66,6 +68,7 @@ cpu_perc(char *       out,
 
    if (!(sum = ABS_DEC(SUM7(old_states), SUM7(data->states))))
        ERRRET(out);
+   warnx("sum = %d", sum);
 
 #define SUM01256(X) (X[0] + X[1] + X[2] + X[5] + X[6])
    bprintf(
> then it just hangs it's outputs only [when status changes](https://notabug.org/dm9pZCAq/aslstatus/src/d2c0db535f870d70fada4c5064931bd01032fe5d/aslstatus.c#L128), but in your case there are constantly outputs `unknow_str`, so it waits for changes --- can you apply this and test again? ```diff diff --git a/components/cpu/linux.c b/components/cpu/linux.c index 0d77927..5000f33 100644 --- a/components/cpu/linux.c +++ b/components/cpu/linux.c @@ -54,8 +54,10 @@ cpu_perc(char * out, &data->states[6]) != LEN(data->states)) ERRRET(out); + warnx("fscanf ok"); if (!old_states[0]) ERRRET(out); + warnx("old_states ok"); #define SUM7(X) (X[0] + X[1] + X[2] + X[3] + X[4] + X[5] + X[6]) #define ABS_DEC(A, B) (MAX((A), (B)) - MIN((A), (B))) @@ -66,6 +68,7 @@ cpu_perc(char * out, if (!(sum = ABS_DEC(SUM7(old_states), SUM7(data->states)))) ERRRET(out); + warnx("sum = %d", sum); #define SUM01256(X) (X[0] + X[1] + X[2] + X[5] + X[6]) bprintf( ```
pdls0e commented 3 years ago
Poster

after applying the patch:

aslstatus: fscanf ok
n/a%
aslstatus: fscanf ok
aslstatus: old_states ok
aslstatus: sum = 805
  3%
aslstatus: fscanf ok
aslstatus: old_states ok
n/a%
aslstatus: fscanf ok
aslstatus: old_states ok
aslstatus: fscanf ok
aslstatus: old_states ok
aslstatus: fscanf ok
aslstatus: old_states ok
aslstatus: fscanf ok
aslstatus: old_states ok
aslstatus: fscanf ok
aslstatus: old_states ok
aslstatus: fscanf ok
aslstatus: old_states ok
aslstatus: fscanf ok
aslstatus: old_states ok
...
after applying the patch: ``` aslstatus: fscanf ok n/a% aslstatus: fscanf ok aslstatus: old_states ok aslstatus: sum = 805 3% aslstatus: fscanf ok aslstatus: old_states ok n/a% aslstatus: fscanf ok aslstatus: old_states ok aslstatus: fscanf ok aslstatus: old_states ok aslstatus: fscanf ok aslstatus: old_states ok aslstatus: fscanf ok aslstatus: old_states ok aslstatus: fscanf ok aslstatus: old_states ok aslstatus: fscanf ok aslstatus: old_states ok aslstatus: fscanf ok aslstatus: old_states ok ... ```
dm9pZCAq commented 3 years ago
Owner

ok, i think i found the problem

will fix soon

ok, i think i found the problem will fix soon
pdls0e commented 3 years ago
Poster

cool, thanks

cool, thanks
dm9pZCAq commented 3 years ago
Owner

and thank you very much, for helping with resolving this issue


apply this with latest master commit and try it

diff --git a/components/cpu/linux.c b/components/cpu/linux.c
index e85200c..a55c774 100644
--- a/components/cpu/linux.c
+++ b/components/cpu/linux.c
@@ -36,7 +36,7 @@ cpu_perc(char *	    out,
 {
 	struct cpu_data_t *data = static_ptr;
 
-	__typeof__(*data->states) old_states[7], sum;
+	__typeof__(*data->states) old_states[7], sum, tmp_sum, old_sum;
 
 	memcpy(old_states, data->states, sizeof(old_states));
 
@@ -59,20 +59,18 @@ cpu_perc(char *	    out,
 	if (!old_states[0]) ERRRET(out);
 
 #define SUM7(X)	      (X[0] + X[1] + X[2] + X[3] + X[4] + X[5] + X[6])
-#define ABS_DEC(A, B) (MAX((A), (B)) - MIN((A), (B)))
-	/*
-	 * preprocessor will generate scary code, but it will be very good
-	 * optimized by compiler with any number of optimization, except -O0
-	 */
+#define ABS_DEC(A, B) ((A) > (B) ? ((A) - (B)) : ((B) - (A)))
 
-	if (!(sum = ABS_DEC(SUM7(old_states), SUM7(data->states))))
-		ERRRET(out);
+	tmp_sum = SUM7(data->states);
+	old_sum = SUM7(old_states);
+
+	if (!(sum = ABS_DEC(tmp_sum, old_sum))) ERRRET(out);
 
+/* see /proc/stat in `man 5 proc` */
 #define SUM01256(X) (X[0] + X[1] + X[2] + X[5] + X[6])
-	bprintf(
-	    out,
-	    "%hhu",
-	    (uint8_t)(100
-		      * ABS_DEC(SUM01256(old_states), SUM01256(data->states))
-		      / sum));
+
+	tmp_sum = SUM01256(data->states);
+	old_sum = SUM01256(old_states);
+
+	bprintf(out, "%hhu", (uint8_t)(100 * ABS_DEC(tmp_sum, old_sum) / sum));
 }

hope this will help

(edit: formatting here should be fixed too (or not))

and thank **you** very much, for helping with resolving this issue --- apply this with latest `master` commit and try it ```diff diff --git a/components/cpu/linux.c b/components/cpu/linux.c index e85200c..a55c774 100644 --- a/components/cpu/linux.c +++ b/components/cpu/linux.c @@ -36,7 +36,7 @@ cpu_perc(char * out, { struct cpu_data_t *data = static_ptr; - __typeof__(*data->states) old_states[7], sum; + __typeof__(*data->states) old_states[7], sum, tmp_sum, old_sum; memcpy(old_states, data->states, sizeof(old_states)); @@ -59,20 +59,18 @@ cpu_perc(char * out, if (!old_states[0]) ERRRET(out); #define SUM7(X) (X[0] + X[1] + X[2] + X[3] + X[4] + X[5] + X[6]) -#define ABS_DEC(A, B) (MAX((A), (B)) - MIN((A), (B))) - /* - * preprocessor will generate scary code, but it will be very good - * optimized by compiler with any number of optimization, except -O0 - */ +#define ABS_DEC(A, B) ((A) > (B) ? ((A) - (B)) : ((B) - (A))) - if (!(sum = ABS_DEC(SUM7(old_states), SUM7(data->states)))) - ERRRET(out); + tmp_sum = SUM7(data->states); + old_sum = SUM7(old_states); + + if (!(sum = ABS_DEC(tmp_sum, old_sum))) ERRRET(out); +/* see /proc/stat in `man 5 proc` */ #define SUM01256(X) (X[0] + X[1] + X[2] + X[5] + X[6]) - bprintf( - out, - "%hhu", - (uint8_t)(100 - * ABS_DEC(SUM01256(old_states), SUM01256(data->states)) - / sum)); + + tmp_sum = SUM01256(data->states); + old_sum = SUM01256(old_states); + + bprintf(out, "%hhu", (uint8_t)(100 * ABS_DEC(tmp_sum, old_sum) / sum)); } ``` hope this will help (edit: formatting here should be fixed too (or not))
pdls0e commented 3 years ago
Poster

running git apply patch.diff errors out mind sharing what command you used

error: patch failed: components/cpu/linux.c:36

running git apply patch.diff errors out mind sharing what command you used ``` error: patch failed: components/cpu/linux.c:36 ```
dm9pZCAq commented 3 years ago
Owner

seems that wrong formatting in my comment

try this: https://0x0.st/-x2J.diff

seems that wrong formatting in my comment try this: https://0x0.st/-x2J.diff
pdls0e commented 3 years ago
Poster

it is still not fixed ( i recloned and patched )

it is still not fixed ( i recloned and patched )
dm9pZCAq commented 3 years ago
Owner

ohh, lets "debug" it some more

same as previous (with previous patch) and https://0x0.st/-x2x.diff

ohh, lets "debug" it some more same as previous (with previous patch) and https://0x0.st/-x2x.diff
pdls0e commented 3 years ago
Poster
n/a%
aslstatus: SUM7: tmp = 24605774; old = 24604974
aslstatus: SUM01256: tmp = 925909; old = 925883
  3%
aslstatus: SUM7: tmp = 24605774; old = 24605774
n/a%
aslstatus: SUM7: tmp = 24605774; old = 24605774
aslstatus: SUM7: tmp = 24605774; old = 24605774
aslstatus: SUM7: tmp = 24605774; old = 24605774
``` n/a% aslstatus: SUM7: tmp = 24605774; old = 24604974 aslstatus: SUM01256: tmp = 925909; old = 925883 3% aslstatus: SUM7: tmp = 24605774; old = 24605774 n/a% aslstatus: SUM7: tmp = 24605774; old = 24605774 aslstatus: SUM7: tmp = 24605774; old = 24605774 aslstatus: SUM7: tmp = 24605774; old = 24605774 ```
dm9pZCAq referenced this issue from a commit 3 years ago
dm9pZCAq commented 3 years ago
Owner

please check if it's really fixed :)

please check if it's really fixed :)
pdls0e commented 3 years ago
Poster

Hi, it is still not working aslstatus -s

-[ n/a%]
-[   1%]
-[ n/a%]

then hangs like usual

Hi, it is still not working aslstatus -s ``` -[ n/a%] -[ 1%] -[ n/a%] ``` then hangs like usual
dm9pZCAq commented 3 years ago
Owner

ohh, try to replace cpu_perc with this:

void
cpu_perc(char *     out,
     const char __unused * _a,
     unsigned int __unused _i,
     void *            static_ptr)
{
    struct cpu_data_t *data = static_ptr;

    __typeof__(*data->states) old_states[LEN(data->states)], sum;

    memcpy(old_states, data->states, sizeof(data->states));

    /* or not only sysfs :) */
    if (sysfs_fptr(&data->fptr, "/", "proc", "stat")) ERRRET(out);

    /* cpu user nice system idle iowait irq softirq */
    if (fscanf(data->fptr,
           "%*s %Lf %Lf %Lf %Lf %Lf %Lf %Lf",
           &data->states[0],
           &data->states[1],
           &data->states[2],
           &data->states[3],
           &data->states[4],
           &data->states[5],
           &data->states[6])
        != 7) {
        ERRRET(out);
    }
    if (!old_states[0]) { ERRRET(out); }

    sum = (old_states[0] + old_states[1] + old_states[2] + old_states[3]
           + old_states[4] + old_states[5] + old_states[6])
        - (data->states[0] + data->states[1] + data->states[2]
           + data->states[3] + data->states[4] + data->states[5]
           + data->states[6]);

    if (!sum) ERRRET(out);

    bprintf(out,
        "%.2Lf",
        (100.0
              * ((old_states[0] + old_states[1] + old_states[2]
              + old_states[5] + old_states[6])
             - (data->states[0] + data->states[1] + data->states[2]
                + data->states[5] + data->states[6]))
              / sum));
}

it's just like old version, but with changed variable names and using fscanf instead of pscanf

ohh, try to replace `cpu_perc` with this: ```c void cpu_perc(char * out, const char __unused * _a, unsigned int __unused _i, void * static_ptr) { struct cpu_data_t *data = static_ptr; __typeof__(*data->states) old_states[LEN(data->states)], sum; memcpy(old_states, data->states, sizeof(data->states)); /* or not only sysfs :) */ if (sysfs_fptr(&data->fptr, "/", "proc", "stat")) ERRRET(out); /* cpu user nice system idle iowait irq softirq */ if (fscanf(data->fptr, "%*s %Lf %Lf %Lf %Lf %Lf %Lf %Lf", &data->states[0], &data->states[1], &data->states[2], &data->states[3], &data->states[4], &data->states[5], &data->states[6]) != 7) { ERRRET(out); } if (!old_states[0]) { ERRRET(out); } sum = (old_states[0] + old_states[1] + old_states[2] + old_states[3] + old_states[4] + old_states[5] + old_states[6]) - (data->states[0] + data->states[1] + data->states[2] + data->states[3] + data->states[4] + data->states[5] + data->states[6]); if (!sum) ERRRET(out); bprintf(out, "%.2Lf", (100.0 * ((old_states[0] + old_states[1] + old_states[2] + old_states[5] + old_states[6]) - (data->states[0] + data->states[1] + data->states[2] + data->states[5] + data->states[6])) / sum)); } ``` it's just like [old version](https://notabug.org/dm9pZCAq/aslstatus/src/35449897b1b9d01724697fcb35680611aa71910c/components/cpu.c#L31), but with changed variable names and using `fscanf` instead of `pscanf`
pdls0e commented 3 years ago
Poster

same issue

-[ n/a%]
-[ 1.13%]
-[ n/a%]
same issue ``` -[ n/a%] -[ 1.13%] -[ n/a%] ```
dm9pZCAq commented 3 years ago
Owner

add this at the top of function

void
cpu_perc(char *     out,
     const char __unused *_a,
     unsigned int         interval,
     void *           static_ptr)
{
    warnx("interval: %u", interval);

/* ... */
add this at the top of function ```c void cpu_perc(char * out, const char __unused *_a, unsigned int interval, void * static_ptr) { warnx("interval: %u", interval); /* ... */ ```
dm9pZCAq commented 3 years ago
Owner
void
cpu_perc(char *     out,
     const char __unused *_a,
     unsigned int         interval, /* it is here */
     void *           static_ptr)
```c void cpu_perc(char * out, const char __unused *_a, unsigned int interval, /* it is here */ void * static_ptr) ```
pdls0e commented 3 years ago
Poster

yeah just noticed xd

aslstatus: interval: 1000
-[ n/a%]
aslstatus: interval: 1000
-[ 1.75%]
aslstatus: interval: 1000
-[ n/a%]
aslstatus: interval: 1000
aslstatus: interval: 1000
aslstatus: interval: 1000
yeah just noticed xd ``` aslstatus: interval: 1000 -[ n/a%] aslstatus: interval: 1000 -[ 1.75%] aslstatus: interval: 1000 -[ n/a%] aslstatus: interval: 1000 aslstatus: interval: 1000 aslstatus: interval: 1000 ```
dm9pZCAq commented 3 years ago
Owner

ok, lets try some shell script...

for _ in $(seq 10); do sed 1q </proc/stat && sleep 1; done
ok, lets try some shell script... ```sh for _ in $(seq 10); do sed 1q </proc/stat && sleep 1; done ```
pdls0e commented 3 years ago
Poster
cpu  123558 43 55364 9873269 8884 14477 7602 0 1041 0
cpu  123564 43 55369 9874056 8884 14479 7603 0 1041 0
cpu  123573 43 55371 9874841 8884 14480 7604 0 1041 0
cpu  123579 43 55378 9875626 8884 14482 7605 0 1041 0
cpu  123583 43 55384 9876415 8884 14484 7605 0 1041 0
cpu  123587 43 55388 9877203 8884 14485 7606 0 1041 0
cpu  123603 43 55391 9877981 8884 14487 7607 0 1041 0
cpu  123617 43 55401 9878756 8884 14489 7608 0 1041 0
``` cpu 123558 43 55364 9873269 8884 14477 7602 0 1041 0 cpu 123564 43 55369 9874056 8884 14479 7603 0 1041 0 cpu 123573 43 55371 9874841 8884 14480 7604 0 1041 0 cpu 123579 43 55378 9875626 8884 14482 7605 0 1041 0 cpu 123583 43 55384 9876415 8884 14484 7605 0 1041 0 cpu 123587 43 55388 9877203 8884 14485 7606 0 1041 0 cpu 123603 43 55391 9877981 8884 14487 7607 0 1041 0 cpu 123617 43 55401 9878756 8884 14489 7608 0 1041 0 ```
dm9pZCAq commented 3 years ago
Owner

yet another debug patch https://0x0.st/-xJU.diff

yet another debug patch https://0x0.st/-xJU.diff
pdls0e commented 3 years ago
Poster
aslstatus: old_states[CPU_STATE_USER], 0.000000
aslstatus: old_states[CPU_STATE_NICE], 0.000000
aslstatus: old_states[CPU_STATE_SYSTEM], 0.000000
aslstatus: old_states[CPU_STATE_IDLE], 0.000000
aslstatus: old_states[CPU_STATE_IOWAIT], 0.000000
aslstatus: old_states[CPU_STATE_IRQ], 0.000000
aslstatus: old_states[CPU_STATE_SOFTIRQ], 0.000000
aslstatus: old_states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(old_states), 0.000000
aslstatus: data->states[CPU_STATE_USER], 175789.000000
aslstatus: data->states[CPU_STATE_NICE], 43.000000
aslstatus: data->states[CPU_STATE_SYSTEM], 79492.000000
aslstatus: data->states[CPU_STATE_IDLE], 12199390.000000
aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: data->states[CPU_STATE_IRQ], 20902.000000
aslstatus: data->states[CPU_STATE_SOFTIRQ], 11415.000000
aslstatus: data->states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(data->states), 12510206.000000
aslstatus: ==================
-[ n/a%]
aslstatus: old_states[CPU_STATE_USER], 175789.000000
aslstatus: old_states[CPU_STATE_NICE], 43.000000
aslstatus: old_states[CPU_STATE_SYSTEM], 79492.000000
aslstatus: old_states[CPU_STATE_IDLE], 12199390.000000
aslstatus: old_states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: old_states[CPU_STATE_IRQ], 20902.000000
aslstatus: old_states[CPU_STATE_SOFTIRQ], 11415.000000
aslstatus: old_states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(old_states), 12510206.000000
aslstatus: data->states[CPU_STATE_USER], 175794.000000
aslstatus: data->states[CPU_STATE_NICE], 43.000000
aslstatus: data->states[CPU_STATE_SYSTEM], 79496.000000
aslstatus: data->states[CPU_STATE_IDLE], 12200176.000000
aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: data->states[CPU_STATE_IRQ], 20904.000000
aslstatus: data->states[CPU_STATE_SOFTIRQ], 11416.000000
aslstatus: data->states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(data->states), 12511004.000000
aslstatus: ==================
-[   1%]
aslstatus: old_states[CPU_STATE_USER], 175794.000000
aslstatus: old_states[CPU_STATE_NICE], 43.000000
aslstatus: old_states[CPU_STATE_SYSTEM], 79496.000000
aslstatus: old_states[CPU_STATE_IDLE], 12200176.000000
aslstatus: old_states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: old_states[CPU_STATE_IRQ], 20904.000000
aslstatus: old_states[CPU_STATE_SOFTIRQ], 11416.000000
aslstatus: old_states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(old_states), 12511004.000000
aslstatus: data->states[CPU_STATE_USER], 175794.000000
aslstatus: data->states[CPU_STATE_NICE], 43.000000
aslstatus: data->states[CPU_STATE_SYSTEM], 79496.000000
aslstatus: data->states[CPU_STATE_IDLE], 12200176.000000
aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: data->states[CPU_STATE_IRQ], 20904.000000
aslstatus: data->states[CPU_STATE_SOFTIRQ], 11416.000000
aslstatus: data->states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(data->states), 12511004.000000
aslstatus: ==================
-[ n/a%]
aslstatus: old_states[CPU_STATE_USER], 175794.000000
aslstatus: old_states[CPU_STATE_NICE], 43.000000
aslstatus: old_states[CPU_STATE_SYSTEM], 79496.000000
aslstatus: old_states[CPU_STATE_IDLE], 12200176.000000
aslstatus: old_states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: old_states[CPU_STATE_IRQ], 20904.000000
aslstatus: old_states[CPU_STATE_SOFTIRQ], 11416.000000
aslstatus: old_states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(old_states), 12511004.000000
aslstatus: data->states[CPU_STATE_USER], 175794.000000
aslstatus: data->states[CPU_STATE_NICE], 43.000000
aslstatus: data->states[CPU_STATE_SYSTEM], 79496.000000
aslstatus: data->states[CPU_STATE_IDLE], 12200176.000000
aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: data->states[CPU_STATE_IRQ], 20904.000000
aslstatus: data->states[CPU_STATE_SOFTIRQ], 11416.000000
aslstatus: data->states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(data->states), 12511004.000000
aslstatus: ==================
aslstatus: old_states[CPU_STATE_USER], 175794.000000
aslstatus: old_states[CPU_STATE_NICE], 43.000000
aslstatus: old_states[CPU_STATE_SYSTEM], 79496.000000
aslstatus: old_states[CPU_STATE_IDLE], 12200176.000000
aslstatus: old_states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: old_states[CPU_STATE_IRQ], 20904.000000
aslstatus: old_states[CPU_STATE_SOFTIRQ], 11416.000000
aslstatus: old_states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(old_states), 12511004.000000
aslstatus: data->states[CPU_STATE_USER], 175794.000000
aslstatus: data->states[CPU_STATE_NICE], 43.000000
aslstatus: data->states[CPU_STATE_SYSTEM], 79496.000000
aslstatus: data->states[CPU_STATE_IDLE], 12200176.000000
aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000
aslstatus: data->states[CPU_STATE_IRQ], 20904.000000
aslstatus: data->states[CPU_STATE_SOFTIRQ], 11416.000000
aslstatus: data->states[CPU_STATE_STEAL], 0.000000
aslstatus: CPU_SUM(data->states), 12511004.000000
aslstatus: ==================
...
``` aslstatus: old_states[CPU_STATE_USER], 0.000000 aslstatus: old_states[CPU_STATE_NICE], 0.000000 aslstatus: old_states[CPU_STATE_SYSTEM], 0.000000 aslstatus: old_states[CPU_STATE_IDLE], 0.000000 aslstatus: old_states[CPU_STATE_IOWAIT], 0.000000 aslstatus: old_states[CPU_STATE_IRQ], 0.000000 aslstatus: old_states[CPU_STATE_SOFTIRQ], 0.000000 aslstatus: old_states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(old_states), 0.000000 aslstatus: data->states[CPU_STATE_USER], 175789.000000 aslstatus: data->states[CPU_STATE_NICE], 43.000000 aslstatus: data->states[CPU_STATE_SYSTEM], 79492.000000 aslstatus: data->states[CPU_STATE_IDLE], 12199390.000000 aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: data->states[CPU_STATE_IRQ], 20902.000000 aslstatus: data->states[CPU_STATE_SOFTIRQ], 11415.000000 aslstatus: data->states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(data->states), 12510206.000000 aslstatus: ================== -[ n/a%] aslstatus: old_states[CPU_STATE_USER], 175789.000000 aslstatus: old_states[CPU_STATE_NICE], 43.000000 aslstatus: old_states[CPU_STATE_SYSTEM], 79492.000000 aslstatus: old_states[CPU_STATE_IDLE], 12199390.000000 aslstatus: old_states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: old_states[CPU_STATE_IRQ], 20902.000000 aslstatus: old_states[CPU_STATE_SOFTIRQ], 11415.000000 aslstatus: old_states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(old_states), 12510206.000000 aslstatus: data->states[CPU_STATE_USER], 175794.000000 aslstatus: data->states[CPU_STATE_NICE], 43.000000 aslstatus: data->states[CPU_STATE_SYSTEM], 79496.000000 aslstatus: data->states[CPU_STATE_IDLE], 12200176.000000 aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: data->states[CPU_STATE_IRQ], 20904.000000 aslstatus: data->states[CPU_STATE_SOFTIRQ], 11416.000000 aslstatus: data->states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(data->states), 12511004.000000 aslstatus: ================== -[ 1%] aslstatus: old_states[CPU_STATE_USER], 175794.000000 aslstatus: old_states[CPU_STATE_NICE], 43.000000 aslstatus: old_states[CPU_STATE_SYSTEM], 79496.000000 aslstatus: old_states[CPU_STATE_IDLE], 12200176.000000 aslstatus: old_states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: old_states[CPU_STATE_IRQ], 20904.000000 aslstatus: old_states[CPU_STATE_SOFTIRQ], 11416.000000 aslstatus: old_states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(old_states), 12511004.000000 aslstatus: data->states[CPU_STATE_USER], 175794.000000 aslstatus: data->states[CPU_STATE_NICE], 43.000000 aslstatus: data->states[CPU_STATE_SYSTEM], 79496.000000 aslstatus: data->states[CPU_STATE_IDLE], 12200176.000000 aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: data->states[CPU_STATE_IRQ], 20904.000000 aslstatus: data->states[CPU_STATE_SOFTIRQ], 11416.000000 aslstatus: data->states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(data->states), 12511004.000000 aslstatus: ================== -[ n/a%] aslstatus: old_states[CPU_STATE_USER], 175794.000000 aslstatus: old_states[CPU_STATE_NICE], 43.000000 aslstatus: old_states[CPU_STATE_SYSTEM], 79496.000000 aslstatus: old_states[CPU_STATE_IDLE], 12200176.000000 aslstatus: old_states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: old_states[CPU_STATE_IRQ], 20904.000000 aslstatus: old_states[CPU_STATE_SOFTIRQ], 11416.000000 aslstatus: old_states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(old_states), 12511004.000000 aslstatus: data->states[CPU_STATE_USER], 175794.000000 aslstatus: data->states[CPU_STATE_NICE], 43.000000 aslstatus: data->states[CPU_STATE_SYSTEM], 79496.000000 aslstatus: data->states[CPU_STATE_IDLE], 12200176.000000 aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: data->states[CPU_STATE_IRQ], 20904.000000 aslstatus: data->states[CPU_STATE_SOFTIRQ], 11416.000000 aslstatus: data->states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(data->states), 12511004.000000 aslstatus: ================== aslstatus: old_states[CPU_STATE_USER], 175794.000000 aslstatus: old_states[CPU_STATE_NICE], 43.000000 aslstatus: old_states[CPU_STATE_SYSTEM], 79496.000000 aslstatus: old_states[CPU_STATE_IDLE], 12200176.000000 aslstatus: old_states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: old_states[CPU_STATE_IRQ], 20904.000000 aslstatus: old_states[CPU_STATE_SOFTIRQ], 11416.000000 aslstatus: old_states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(old_states), 12511004.000000 aslstatus: data->states[CPU_STATE_USER], 175794.000000 aslstatus: data->states[CPU_STATE_NICE], 43.000000 aslstatus: data->states[CPU_STATE_SYSTEM], 79496.000000 aslstatus: data->states[CPU_STATE_IDLE], 12200176.000000 aslstatus: data->states[CPU_STATE_IOWAIT], 23175.000000 aslstatus: data->states[CPU_STATE_IRQ], 20904.000000 aslstatus: data->states[CPU_STATE_SOFTIRQ], 11416.000000 aslstatus: data->states[CPU_STATE_STEAL], 0.000000 aslstatus: CPU_SUM(data->states), 12511004.000000 aslstatus: ================== ... ```
dm9pZCAq commented 3 years ago
Owner

ok, i finally found error after testing on glibc server

there are very strange error in reading and seeking files

ok, i finally found error after testing on `glibc` server there are very strange error in reading and seeking files
dm9pZCAq commented 3 years ago
Owner

this should fix cpu component

sync with master and apply https://0x0.st/-xxD.diff

if it's still not fixed then send strace -ff ./aslstatus -s (but i hope it's finally fixed)

this should fix cpu component sync with `master` and apply https://0x0.st/-xxD.diff if it's still not fixed then send `strace -ff ./aslstatus -s` (but i hope it's finally fixed)
pdls0e commented 3 years ago
Poster

Yes it is fixed

Thank you

Yes it is fixed *Thank you*
dm9pZCAq commented 3 years ago
Owner

and thank you for helping with it ;)

and thank you for helping with it ;)
dm9pZCAq referenced this issue from a commit 3 years ago
Sign in to join this conversation.
No Label
bug
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.