Rockbox

Tasklist

FS#13086 - rbutil fails to build bootloader

Attached to Project: Rockbox
Opened by John Black (johnblack) - Friday, 14 October 2016, 15:24 GMT
Task Type Bugs
Category Rbutil
Status Unconfirmed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Affected versions:
RBUtil V1.4.0
git version 2a2800b528010320ca504a39106806ec21f0220 (2016-10-12)

rbutil fails to build bootloader. Tested for Iriver H1x0 and H3x0 platforms.

Progress window shows:

Adding bootloader firmware file
Error in patching: reading firmware failed

Terminal output shows:

[httpget.cpp:230 INFO] Get URI "http://download.rockbox.org/bootloader/iriver/bootloader-h300.bin"
[httpget.cpp:200 INFO] Request started
[httpget.cpp:148 INFO] Request finished, status code: 200
[httpget.cpp:151 INFO] Data from cache: true
[bootloaderinstallbase.cpp:71 INFO] Downloading bootloader finished, error: false
/tmp/qt_temp.U16458: Resource temporarily unavailable
[selectiveinstallwidget.cpp:195 INFO] continuing install with stage 1
[selectiveinstallwidget.cpp:197 ERROR] Last part returned error.
[selectiveinstallwidget.cpp:214 INFO] All install stages done.
[rockboxinfo.cpp:27 INFO] Getting version info from rockbox-info.txt

Fired up gdb and debugged the git 2a2800b5280103... build:

The failure is in function mkboot_iriver in mkboot.c line 98:
Line 98:
i = fread(image+16, 1, len, f);

len is calculated as 2636272.
But file size of /tmp/qt_temp.U16458 is only 2621440, resulting in a short read of 2621424 bytes. So error condition "i < len" fires and function returns without building bootloader.

I tested this on two different gentoo systems. It worked on one, but failed on the other. Both are more or less up to date, but have one significant difference: 32bit vs 64bit system.

The system that did compile and run perfectly uses:
gcc i686-pc-linux-gnu-4.9.4 (len=2636272, file size=2637824)
The system that failed uses:
gcc x86_64-pc-linux-gnu-4.9.3 (len=2636272, file size=2621440)

So, the failing rbutil creates a temporary file that is too short. I didn't debug deeper to find out why.

cu
John
This task depends upon

Comment by Dominik Riebeling (bluebrother) - Sunday, 23 October 2016, 08:45 GMT
What version of Rockbox Utility did you use? One of the binaries we provide? Or did you compile yourself? I've just tried this and cannot reproduce the issue, neither with the binaries from download.rockbox.org nor when building byself. Also, which / how did you provide the hex file? As hex file or zip? And which version? Maybe this is related to a specific hex file version?
Comment by John Black (johnblack) - Monday, 24 October 2016, 09:46 GMT
All versions were self compiled. See Affected versions above. Otherwise using gdb wouldn't be possible.
rbutil 1.4.0-r1 was a standard gentoo emerge based on the emc overlay https://github.com/emcek/gentoo.mipl.git. The git build was completly hand made.

For another test I downloaded RockboxUtility-v1.4.0-64bit.tar.bz2 from download.rockbox.org. Hex file used was H300-1.29-EU.hex.
Same error in the progress window, slightly different output on console:

[bootloaderinstallhex.cpp:78 INFO] hexfile hash: "27d90fc316709c096979ab24c914ee31"
Model H300 series
File decoded correctly and all checksums matched!
Output file contains all headers and checksums
[bootloaderinstallhex.cpp:116 INFO] iriver_decode(): 0
[httpget.cpp:205 INFO] Get URI "http://download.rockbox.org/bootloader/iriver/bootloader-h300.bin"
[httpget.cpp:183 INFO] Request started
[httpget.cpp:134 INFO] Request finished, status code: 200
[httpget.cpp:137 INFO] Data from cache: true
[bootloaderinstallbase.cpp:71 INFO] Downloading bootloader finished, error: false
/tmp/qt_temp.B31773: File exists
[selectiveinstallwidget.cpp:195 INFO] continuing install with stage 1
[selectiveinstallwidget.cpp:197 ERROR] Last part returned error.
[selectiveinstallwidget.cpp:214 INFO] All install stages done.
[rockboxinfo.cpp:27 INFO] Getting version info from rockbox-info.txt

Loading...