2
2
Fork
You've already forked frugen
2

Not working properly on 32-bit architectures #14

Closed
opened 2025年08月18日 15:57:32 +02:00 by harryleafchen · 7 comments

When packaging for debian, I found the current 3.0 release does not work normally on 32-bit architectures.

Please see the example from i386 and armhf.

The test commands are very simple:

frugen -j example.json fru.bin
frugen -r fru.bin -o text -

And the error message is Failed to encode the provided data: Not an even number of nibbles in Internal Use Area.

I have not dug into the code, but it looks like some struct padding / data truncation problem to me.

When packaging for debian, I found the current 3.0 release does not work normally on 32-bit architectures. Please see the example from [i386](https://ci.debian.net/packages/f/frugen/testing/i386/63306957/) and [armhf](https://ci.debian.net/packages/f/frugen/testing/armhf/63279656/). The test commands are very simple: ``` frugen -j example.json fru.bin frugen -r fru.bin -o text - ``` And the error message is `Failed to encode the provided data: Not an even number of nibbles in Internal Use Area`. I have not dug into the code, but it looks like some struct padding / data truncation problem to me.

I will look into it, thanks

I will look into it, thanks

Have you tried the latest version from master? It has a number of fixes atop of release 3.0

Have you tried the latest version from master? It has a number of fixes atop of release 3.0

@AlexanderAmelkin I can confirm this persists on the latest master commit on i686.

@AlexanderAmelkin I can confirm this persists on the latest master commit on i686.

If you are using debian or similar, you may try something like:

sudo dpkg --add-architecture i386 && sudo apt update
sudo apt install gcc-i686-linux-gnu libjson-c-dev:i686
CC=i686-linux-gnu-gcc cmake -B build -S .
cmake --build
file build/frugen # check it is 32-bit

The generated build/frugen would report the aforementioned error.

If you are using debian or similar, you may try something like: ``` sudo dpkg --add-architecture i386 && sudo apt update sudo apt install gcc-i686-linux-gnu libjson-c-dev:i686 CC=i686-linux-gnu-gcc cmake -B build -S . cmake --build file build/frugen # check it is 32-bit ``` The generated `build/frugen` would report the aforementioned error.

It's strange that you hit the Failed to encode... error. With the current master I get a Segmentation fault on the first command due to custom MR record in example.json. When I fix that, both your example commands run just fine for me.

Please try 6643c5cdfc

It's strange that you hit the `Failed to encode...` error. With the current master I get a `Segmentation fault` on the first command due to `custom` MR record in `example.json`. When I fix that, both your example commands run just fine for me. Please try 6643c5cdfce30e0773020172213b2a18dc4ccaa4

@AlexanderAmelkin I can confirm it is fixed in the latest master (6643c5cdfc) -- yet I am also confused why it hit that branch, might be some UB previously?

@AlexanderAmelkin I can confirm it is fixed in the latest master (6643c5cdfc) -- yet I am also confused why it hit that branch, might be some UB previously?

Well, all I can say is that gcc is run with -fanalyzer now during builds and it doesn't detect any UBs in the code

Well, all I can say is that `gcc` is run with `-fanalyzer` now during builds and it doesn't detect any UBs in the code
Sign in to join this conversation.
No Branch/Tag specified
master
feature/add-psu-mr
pages
bugfix/refactor-area-sorting
feature/version-3.0-test
v3.1
v3.0
v2.1
v2.0
v1.3
v1.2
v1.01
v1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IPMITool/frugen#14
Reference in a new issue
IPMITool/frugen
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?