Closed Stefal closed 3 years ago
oh for the life of me i can't reproduce... so lets do a few things
while i undust the raspberrypyi have in the basement, could you try repro on pystemd master. but my guess is that there is something on Raspbian that is failing...
Thank you for you answer! Just tested with pystemd 0.8.1588314028 .......same result 😞
could reproduce on my 4 year old raspberry py... :D
now that i can repro i can try to fix... stay tuned
Ok so i know what this is... dont know why... i would assume combine python and arm and you get a bug making machine, but... in a nutshell
when we close a dbus container, the args_type in https://github.com/facebookincubator/pystemd/blob/master/pystemd/dbuslib.pyx#L324 gets the char 255 in arm and -1 in the rest of the architectures (by the rest i just means i864, because thats the only one i ever tried)... so then on line https://github.com/facebookincubator/pystemd/blob/master/pystemd/dbuslib.pyx#L393 when we actually need to close the container, 255 != -1
.
probably its best, since we know that we need to close the container, to not make a char conversion... will probably land the fix on monday, but this is definetly a bug, and thanks for reporting it!!!
now i just wonder... why did this work before??!!!...
Hi! I'm glad that you found so fast where the bug come from. I really don't know why it worked before a new armbian/raspbian image flash. I did so much tests that perhaps I got mixed up.
ok, so i landed https://github.com/facebookincubator/pystemd/commit/72cd1b656bbe338ce6236a11179ae86f54ba8a5c
in my extensive weekend testing it worked...
for the reason on why it was broken, talking to @javierhonduco he pointed me to https://stackoverflow.com/questions/2054939/is-char-signed-or-unsigned-by-default where https://stackoverflow.com/a/2054959/2452406 . i think char wen from been unsigned to been signed in arm/rpri... i'll do a bit more testing... but... "this" issue should be fixed :D
As @aleivag said this is an issue with the char
being signed in arm. The value -1
will become 255
:
$ cat repro.c
#include <stdio.h>
int main () {
char number = -1;
printf ("number = %d\n", number);
return 0;
}
On a x86 machine:
$ gcc -funsigned-char repro.c
$ /a.out
number = 255
With -fsigned-char
it prints, as we expect, -1
I confirm it works now, thank you!
Do you plan to publish a new release soon ?
I confirm it works now, thank you!
nope, thank you for reporting! otherwise we would have never caught this
Do you plan to publish a new release soon ?
probably... this week or the next one, i have some typing annotation i wanna get in before the next release... because apparently that is something people care about...
Hi @aleivag
I'm sorry to bother you with that, but is the new release still planned in a short futur time?
Also interested in getting an new release published with this fix in it.
ohhh!!! looks like i forgot to make a release... i'll do it on monday!
i'll close once i made a release
made the release, sory @phobozad and @Stefal for taking so long!!
Hi! I had a script which worked perfectly to enable/disable start/stop some services. Since an OS clean reinstallation (same armbian buster), it doesn't work anymore, and I really don't understand why. Here is my test:
SBC: Orange pi Zero with armbian buster Python: v3.7.3 pystemd: v0.7.0 libsystemd-dev: 241-7~deb10u3
I have the same code working correctly inside various VM (Ubuntu 18, 20, Debian Buster, ...) and I know another user with the same problem on a Raspberry with Raspbian buster lite.
I've tested after installing pystemd from this repo with the same result.
I've tested with systemd-manager and it works.
Could somebody help me?