tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Segfault on musl with '-run'


From: grischka
Subject: Re: [Tinycc-devel] Segfault on musl with '-run'
Date: Wed, 20 Jul 2022 20:20:27 +0200
User-agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 20.07.2022 06:03, Arthur Williams via Tinycc-devel wrote:
Hi,

Was writing an application and noticed a bug. The script can be reduced
to the following:

```
#!/bin/tcc -run
#include <time.h>
int main() {
     struct timespec start, current;
     clock_gettime(CLOCK_MONOTONIC, &start); // Segfaults
}
```

When the file is executed, it crashes at the indicated line. If I
explicitly compile the program and run it, it behaves correctly. Also tested
the same script on a glibc based machine and it also didn't crash.

Not sure exactly what's special about the call to `clock_gettime`, but
replacing it with something trivial or a printf avoids the crash.

Maybe tcc and the system disagree about the sizeof (struct timespec) ?

-- gr


Arthur

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]