[OE-core] struct.error: unpack requires a string argument of length 32 in Yocto

Laurentiu Palcu laurentiu.palcu at intel.com
Wed Nov 5 10:12:19 UTC 2014


Hi Wilder,

On Tue, Nov 04, 2014 at 07:02:04PM +0000, Wilder wrote:
> Hi Laurentiu
> 
> 
> I am a student from Mexico, and we are using Yocto to build our images, however there is a unique error that is bothering me while
> trying to set up the environment to build an image with sdk, I am not so familiar with structs using python and this is the error I
> get:
> 
> 
> Traceback (most recent call last):
> 
>   File "/media/wilder/Seagate_Backup_Plus_Drive/ITESM/MSE/te5009/opt/poky/1.6.1/relocate_sdk.py", line 231, in <module>
> 
>     change_interpreter(e)
> 
>   File "/media/wilder/Seagate_Backup_Plus_Drive/ITESM/MSE/te5009/opt/poky/1.6.1/relocate_sdk.py", line 89, in change_interpreter
> 
>     p_memsz, p_flags, p_align = struct.unpack(ph_fmt, ph_hdr)
> 
> struct.error: unpack requires a string argument of length 32
> 
> 
> I am using a Chromebook with Ubuntu 14 installed on it and it seems that this error is not showing up in other computers from my
> classmates, 
> 
> 
> At the beginning I thought the issue was because of the python version, since by default it uses Python 3, but now I have python
> 2.7.6 and the same error message is shown.
It's hard to tell what the real issue is. But, you'd get this kind of
error if the binary being relocated is corrupt. The script reads the ELF
header first and then goes through the program header table to find the
INTERP section. Apparently, in your case, the size of e_phentsize (which
is taken from the ELF header) is different from the actual size of one
program header entry for a 32bit binary.

But, you could easily find out which is the problematic binary:
1. Run the SDK installer with -S -R
2. go to the install directory and change the relocate_sdk.py to print
the name of the binary being relocated
3. execute ./relocate_sdk.sh

After you find the binary, use readelf to inspect it.

> 
> 
> Could you please point me to a forum where I can ask for help_
You can always find help on the OE-core mailing list:
openembedded-core at lists.openembedded.org (CCed)

You can subscribe here:
http://lists.openembedded.org/mailman/listinfo/openembedded-core

laurentiu
> 
> 
> Thanks in advance,
> 
> Wilder
> 
> 
> 



More information about the Openembedded-core mailing list