partitions.lib line 222/1024 syntax error and invalid arithmetic operator #45
Comments
Thanks for reporting! Unfortunately I cannot test with either (have no Mac, no Windows). But unless "bash 2.5.4" is no spelling error, on that Mac it cannot work: Adebar requires at least Bash 4. The line reported for the error to have occured means there must be some problem with the "partition output". If you could debug that (or at least help narrowing down), please play with
if you want to go further,
grab the output and attach it. I have a guess, but I cannot be sure: maybe one of those lines is empty, and you will see something like |
Yes, sorry about that, I meant to say bash 5.0.2(1) from MacPorts 2.5.4. Adding Running Inserting line 41 and 60 modification along the 21st line gives this: https://pastebin.com/fQCjEdgS |
Ah, And Oh. I had no chance yet to test with Bash5, but AFAIK that should be no issue.
My bad, remembered it wrongly. It's used to check for both. So without context, that wasn't helpful. Luckily you continued, and the problem might be (at least partly) in line 13 of your pastebin: your device doesn't even allow to read the partition details: So that might only be possible with root access. But according to those many times the same line errs out, it must have some data from somewhere. -> What does the report give as source for its partition info? What you also could do (so we see what it got) is duplicate that "error line" (actually line 222 if you remove the debug line again, the one starting with What certainly would avoid that error is adding the following line before line 222:
But then you'd have all partitions without size – which we'd better avoid if possible. However I'm afraid your device will only let root see partition details… |
Oh, sorry about that, my unix command line knowledge is not that good, so I thought And if I understood you correctly modifying lines as follows: Could you explain what would be the drawback of backuping and restoring with current error present or having partitions without size? |
No effects on backup. Partition info is 1) just partition INFO and 2) for the scripts to backup the partitions. App backups are not affected. So I see you cannot access If you first wish to check how much info you could obtain, please insert the line
directly before line 222. If the result turns out to be "useful", I'd add that to the code for cases like this. Oh yes, from your second pastebin I see it is, so that's what we should do:
is still useful info, as it at least tells you at least what that partition is used for. Could you give that a try? Remove the other debug code ( Thanks for digging in! |
Device is not rooted. Both setting How can I determine the usefulness of newly added line 222? Can you assist me with a use case or a short instruction of what I should (or should not) expect. (Since I'm going to factory reset my phone after this either way, because the latest firmware update butchered some of the user/account related setting.) Thank you for being this helpful! :) |
You could take a look at the resulting documentation. It's in Markdown format, so you probably need a Markdown viewer for "full effect"① – but as Markdown format is easy, a text editor would suffice. As for the second error (which I thought was in conjunction to the other): The error message doesn't tell where it does occur, so it's hard to pin. It's not related to the one we just tackled. To narrow it down: Could you please disable one feature after another until it disappears (or go the other way round: disabling all and enabling one after the other until it appears), so we can at least see what module causes it? (helpful approach: uses halves. That is, turn half of; no change means the other half is guilty (continue "halving" that). Error gone means the culprit is among the disabled (enable half of them again and check))
Gladly! If I could reproduce it would save us some ping-pong and would be fixed faster. But without your help I cannot fix it at all – so thanks for your patience and staying with me! ① if you have none: Github uses Markdown. You could simply copy-paste it to a comment here and check the preview. But take care what you "save" then 😜 |
PS: You could also increase the log level to maximum, and then check what gets looged immediately before and after that error. The config keyword is |
The problematic property is |
That indeed narrows it down to between lines 288 and 307 in
Those are the only 3 variables used in "arithmetic operations" in the segment indicated by your pastebin. One of those values seems to be non-numerical here (or empty). Oh, of course please set |
Removed all the apps debug log, since it's virtually the same, and the result is: https://pastebin.com/Eb5YM8i3 I'm guessing you are interested in lines: |
Yes, the second one is the kind of what I expected. The first one is a bit irritating: where did the "prefix" go? Especially the literal Can you try with the latest code I've just committed (just updated 2 files in |
Yes, works like a charm! Thank you! If you need any additional logs, I will gladly supply them. |
Thanks a lot! You provided excellent logs so we could tackle this issue. Unless there's something else open, I'd say we close this issue. Glad it worked out that well, with just 2 lines of code added 😃 |
Precise error message
/c/adb/Adebar/lib/partitions.lib: line 222: / 1024: syntax error: operand expected (error token is "/ 1024")
")syntax error: invalid arithmetic operator (error token is "
Full log: https://pastebin.com/ULv8s1Kd
Expected behavior
No errors/warnings being thrown.
Desktop
Smartphone
Additional context
Have exactly the same bug if running under Mac OS X High Sierra with MacPorts bash 2.5.4
The text was updated successfully, but these errors were encountered: