Your message dated Mon, 22 Oct 2018 19:08:18 +0800
with message-id <[email protected]>
and subject line Closing this as already fixed
has caused the Debian Bug report #800661,
regarding android-tools-fastboot: fastboot flash fails with bad file descriptor 
because file handle was closed prematurely
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
800661: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800661
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: android-tools-fastboot
Version: 4.2.2+git20130529-5.1
Severity: important


Dear Maintainer,

   * What led up to the situation?
root@debian-rn1# fastboot flash recovery 407recov.img
sending 'recovery' (3660 KB)...
FAILED (command write failed (Bad file descriptor))
finished. total time: 0.000s
oot@debian-rn1# fastboot reboot
rebooting...

finished. total time: 0.002s
root@debian-rn1# 

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
I looked into the source and found that "usb_close()" is called before the 
write command thus starting with NULL file handel.
The reason "fastboot reboot" works is that it is done in one command. It 
doesn't arrive at
the point where it tries to use the usb connection again.

   * Here is the fix which I applied to protocol.c

diff protocol.c ../../../orig/android-tools/core/fastboot/protocol.c 
64c64
<         if((r > 0) && (r < 4)) {
---
>         if(r < 4) {
102c102
< //        usb_close(usb);
---
>         usb_close(usb);

This avoids premature closing of the file handle to the usb connection.
0 return value of usb_read() is legid.
The "unknown status code" is probably not necessarily a reason to stop and 
close the handle.

Interestingly enough: usb_osx.c does nothing, hence a primature close of the 
handle doesn't harm.
I guess this is the reason why osx users never found that issue.


   * What was the outcome of this action?
"fastboot flash" and "fastboot reboot" both work as expected.


-- System Information:
Debian Release: 8.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages android-tools-fastboot depends on:
ii  libc6        2.19-18+deb8u1
ii  libselinux1  2.3-2
ii  zlib1g       1:1.2.8.dfsg-2+b1

android-tools-fastboot recommends no packages.

android-tools-fastboot suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Closing this bug as it's already fixed, although the bug system seems to be 
unable to handle the situation where a binary package has been hijacked?

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply via email to