Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 8 Nov 2021 18:02:34 +0100
From: Solar Designer <solar@...nwall.com>
To: john-users@...ts.openwall.com
Subject: Re: ZTEX error - invalid ztex-specific descriptor

Hi Royce,

On Mon, Nov 01, 2021 at 06:56:40PM -0800, Royce Williams wrote:
> Sometimes, a john fork throws one of these errors and then terminates:
> 
> SN 49: ztex_get_descriptor: invalid ztex-specific descriptor
> 
> There's no segfault or anything - the process just ends. I haven't left it
> running until all processes die, but I have seen where almost all of them
> die, leaving just one left.
> 
> Is this worth a GitHub issue, or should it be ... hashed ;) out here?

It could be worth a GitHub issue, but we can also hash it out here.  Can
you please try the below patch (completely untested)?

+++ b/src/ztex/ztex.c
@@ -398,7 +398,8 @@ int ztex_get_descriptor(struct ztex_device *dev)
                        || buf[4] != 'E' || buf[5] != 'X') {
                ztex_error("SN %s: ztex_get_descriptor: invalid ztex-specific descriptor\n",
                                dev->snString);
-               return -1;
+#define ZTEX_RETRY_WANTED -777
+               return ZTEX_RETRY_WANTED;
        }
 
        int i;
@@ -482,7 +483,7 @@ int ztex_scan_new_devices(struct ztex_dev_list *new_dev_list,
                        result_open = ztex_device_new(usb_dev, &ztex_dev);
                        if (result_open >= 0) {
                                break;
-                       } else if (result_open == LIBUSB_ERROR_ACCESS) {
+                       } else if (result_open == LIBUSB_ERROR_ACCESS || result_open == ZTEX_RETRY_WANTED) {
                                if (retry_num < ZTEX_OPEN_NUM_RETRIES - 1) {
                                        usleep(ZTEX_OPEN_RETRY_WAIT * 1000);
                                } else {

You might also need to increase ZTEX_OPEN_NUM_RETRIES (default 3).

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.