<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJztVl1v4ygU_TXOC7KFcRI7D3lom0Sq1I9R29nXCpvrhBkCFuAm7a_fC07SabedjrTSPq1lYTBw7uHee4DaiOf5w0Y60vYvL8RzuwZP3Mb0ShCudvzZEW_leg2WcOLlFkzvk-IsoYuEHsspPbyx2XBPkuICX7K8XWF1eUR4PMzPmsNEVkjdqF5AmOC8ENBmG5zwSbfU_tPuXksc8Wt3LHEKubr663qFqwP7AM7farjUHS6CVY3RzpMex1SPyJmdLbjnCbsgTr4A_rnHT8JmJCnPBzRCnALocGpO8cG-pDh1WfC91YSefiXlYqigGw6uUVyvSdo6rqUP4MWijcQ-9dBb1w5llmWEa0G2BtmblvgNxMgQ6Ykw4H4fnsub1S2OIHe91hLZ7KTfENDemk42pDM7ZOOaDYheoWNZRferVfBJHtebvQW5BxDhm7_9fWW4AEFypBhgHCEBKSdSK6mBVGmNVBvTaw_WRS8iBEkm53Q_rljLaTB4qOehH5ufWPh2gUlbBxvRwreL93glzScBb6hO6Ydw6ZbvHxVogkLQxpPOmicpwtrOiZL1kD3oKqVi9xo0WO7R4yGTHFFBNhjEDddkTGdTUj97jEM0cXZ1dncdbOyM_RkcbnSMmOIYve-YB6Q1Ftk6wHQU7phN8QlRPkYXs4I8cdVD4JiH1fYOSHqS5OKGeEMapLAOSTvgXN8Hy5SEddQcx6NMfPz1h8-bRIolt162vPGPnYVW7tFwwsosYZgkZTATNBbNkJ2V3qNPkVboPzBNBS9mvACYwLQe11QUbDKpW2hnkynNqxnlrahoSQ8rOEfW03GgfCCB9opFXhUTWpZDgyzv7m7vwpBTqELj6DTeYpa9dzDmBsoomSy-0FmNAM5sIYC5ILAfPS6v485h84iM8WMn-N-Kb7eRUVV59AjPAr9fQpiT1PbaDTUXtbXIg1OFwVfDh9z_F_R_K-ijiTNcsO169w8T4QDxQSYYjNaaLcqYwLbzz4cJp-OLJXTW9QplSVo_LBH20GBmuKFlXayw6XX9ZtLlzeXDcoFwT8O44-yAP0SPrfL6D8EWtzdLjOdXYEpuQ2v8FeoC8xTlEPIYvXkSBgbTnbalD-V2jf6J5-MT5pA0-lVJ7-4XwyGaHocNVqGW6OY3ACQvMprlacLObVOkeVIuYd8dMvsh3nQC9X01fZyO065JMZf7fbrW_WHIxgIPx6wAFQZ2xuF-N-QAXhy4UiAWMu416I_eWSxrqd-RHol5IWa45Y147zfGzrkw2xqan6PeqvnG-y7uGWH_XK1Run2dNWaLDaWejp8Uc-sHNHhnWUnnesxEtpoUYzYbbeZl3dRl0Va4jbKSFhWbiclkBk0zbkUpinykeA3KzVE8uGWM_r1JOWeUMZqzKaNjNplloppVUNQNFWJcjdsiGVPYcqmygJMZux7ZeYSs-7XDToU3NffaiXupXGuAI0MvvYL5q0hft99wudF4zHi8a3XG-uMWP4oM55He37wQKVY>53429</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            libFuzzer sometimes doesn't report timeout
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          adombeck
      </td>
    </tr>
</table>

<pre>
    This fuzz target should always trigger a timeout:

```
cat << EOF > trigger_timeout.c
#include <stddef.h>
#include <stdint.h>
#include <unistd.h>

int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
  sleep(10000);
  return 0;
}
EOF
clang -fsanitize=fuzzer trigger_timeout.c
```

... and most of the time it does:

```
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 1
INFO: Loaded 1 modules   (1 inline 8-bit counters): 1 [0x482fa0, 0x482fa1), 
INFO: Loaded 1 PC tables (1 PCs): 1 [0x470150,0x470160), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
ALARM: working on the last Unit for 1 seconds
       and the timeout value is 1 (use -timeout=N to change)
MS: 0 ; base unit: 0000000000000000000000000000000000000000


artifact_prefix='./'; Test unit written to ./timeout-da39a3ee5e6b4b0d3255bfef95601890afd80709
Base64: 
==1835077== ERROR: libFuzzer: timeout after 1 seconds
[...]
```

... but sometimes it just passes after 1 or 2 seconds:

```
while ! ./a.out -timeout=1 -runs=1 -seed=1; do done
[...]
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 1
INFO: Loaded 1 modules   (1 inline 8-bit counters): 1 [0x482fa0, 0x482fa1), 
INFO: Loaded 1 PC tables (1 PCs): 1 [0x470150,0x470160), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: A corpus is not provided, starting from an empty corpus
#2      pulse  ft: 1 exec/s: 1 rss: 26Mb
#2      INITED cov: 1 ft: 1 corp: 1/1b exec/s: 1 rss: 26Mb
#2      DONE   cov: 1 ft: 1 corp: 1/1b lim: 4 exec/s: 1 rss: 26Mb
Done 2 runs in 2 second(s)
```

My clang version:
```
clang --version
Debian clang version 13.0.1-+rc3-1~exp1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztVk1z4ygQ_TXyhZIKfViWDz4ksV2VqnxMZbJ7TSHRspnBoAIUO_n12yDLGWeTyZz2tCoVAgGvm-73gFrzl8XjVljS9q-vxDGzAUfsVveSEyb37MUSZ8RmA4Yw4sQOdO-i_CKiy4iOZUmPb2g2zJEov8KXrO7XWF2NCE_H-UlznJjlQjWy5-AnWMc5tMkWJ3zSLZT7tLtXAkf82h1KnEJubv6-XePqwDyCdfcKrlWHi8iqRivrSI9jqif0ObtYMsei7IpY8Qr45zt-omxOotnlgEaIlQAdTk0pPtgX5acuA643itDTr2i2HCoYhmNoJFMbEreWKeE8eL5sg2OfRug8tEOZJAlhipOdRu91S9wWQmaIcIRrsL9Pz_Xd-h5HkIdeKYHe7IXbElDO6E40pNN79MY2W-C9xMBmFT2s1z4maVhvcg7yHYD7b3r--0YzDpy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