New issue
Advanced search Search tips

Issue 702342 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocked on:
issue 637404



Sign in to add a comment

libusb's Use of Invalid Handles is Noisy for Handle Verification

Project Member Reported by robliao@chromium.org, Mar 16 2017

Issue description

Periodically with AppVerifier's handle checker, you'll encounter this:

(3b88.30d8): Invalid handle - code c0000008 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
ntdll!KiRaiseUserExceptionDispatcher+0x3a:
00007ffb`97f78c6a 8b8424c0000000  mov     eax,dword ptr [rsp+0C0h] ss:000000ae`aeeff710=c0000008
0:046> kn20
 # Child-SP          RetAddr           Call Site
00 000000ae`aeeff650 00007ffb`945ec3db ntdll!KiRaiseUserExceptionDispatcher+0x3a
01 000000ae`aeeff720 00007ffb`71d2951d KERNELBASE!CancelIoEx+0x1b
02 000000ae`aeeff760 00007ffb`71d29c1d chrome_7ffb70980000!cancel_io+0x89 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\os\poll_windows.c @ 119]
03 000000ae`aeeff790 00007ffb`71d29ce4 chrome_7ffb70980000!_free_index+0x19 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\os\poll_windows.c @ 390]
04 000000ae`aeeff7c0 00007ffb`71d20ea2 chrome_7ffb70980000!usbi_free_fd+0x30 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\os\poll_windows.c @ 417]
05 000000ae`aeeff7f0 00007ffb`71d213ec chrome_7ffb70980000!windows_clear_transfer_priv+0x26 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\os\windows_usb.c @ 1930]
06 (Inline Function) --------`-------- chrome_7ffb70980000!windows_transfer_callback+0x158 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\os\windows_usb.c @ 2087]
07 (Inline Function) --------`-------- chrome_7ffb70980000!windows_handle_callback+0x161 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\os\windows_usb.c @ 2100]
08 000000ae`aeeff830 00007ffb`71d28e54 chrome_7ffb70980000!windows_handle_events+0x2b4 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\os\windows_usb.c @ 2154]
09 000000ae`aeeff8d0 00007ffb`71d292a2 chrome_7ffb70980000!handle_events+0x2a0 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\io.c @ 2046]
0a 000000ae`aeeff930 00007ffb`71d11899 chrome_7ffb70980000!libusb_handle_events_timeout_completed+0x216 [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\io.c @ 2126]
0b (Inline Function) --------`-------- chrome_7ffb70980000!libusb_handle_events+0x1e [c:\b\build\slave\win64-pgo\build\src\third_party\libusb\src\libusb\io.c @ 2202]
0c 000000ae`aeeff980 00007ffb`713b5e94 chrome_7ffb70980000!device::UsbContext::UsbEventHandler::Run+0xb9 [c:\b\build\slave\win64-pgo\build\src\device\usb\usb_context.cc @ 49]
0d 000000ae`aeeffd20 00007ffb`71379480 chrome_7ffb70980000!base::SimpleThread::ThreadMain+0x1c4 [c:\b\build\slave\win64-pgo\build\src\base\threading\simple_thread.cc @ 69]
0e 000000ae`aeeffdb0 00007ffb`85fcf0d4 chrome_7ffb70980000!base::`anonymous namespace'::ThreadFunc+0xf0 [c:\b\build\slave\win64-pgo\build\src\base\threading\platform_thread_win.cc @ 91]
0f 000000ae`aeeffe10 00007ffb`96fe8102 vfbasics!AVrfpStandardThreadFunction+0x44
10 000000ae`aeeffe50 00007ffb`97f2c5b4 KERNEL32!BaseThreadInitThunk+0x22
11 000000ae`aeeffe80 00000000`00000000 ntdll!RtlUserThreadStart+0x34

Unfortunately, the source knows that these handles could potentially be invalid:

https://cs.chromium.org/chromium/src/third_party/libusb/src/libusb/os/poll_windows.c?rcl=dc3cab97b3a974ce7ae3d4372ea5af4b2bdd5621&l=387
// Cancel any async IO (Don't care about the validity of our handles for this)
cancel_io(_index);

 
Blockedon: 637404
Owner: reillyg@chromium.org
Status: Assigned (was: Untriaged)
We are planning on removing libusb from Chrome on Windows.
Sweet. Thanks for the update!

Sign in to add a comment