Package: ucarp
Version: 1.5.2+git20192404.1a9aaf7-1+b1
Severity: grave
Tags: time-t arm

Dear Maintainer,

I am reporting a severe regression (Segmentation Fault) in the ucarp
package when run on Debian Trixie (testing) on the armhf
architecture(Raspberry Pi 2 arm32hf).

This issue appears to be caused by an **ABI mismatch related to the ongoing
64-bit time_t (time64) migration.** The current ucarp source code relies on
the outdated `gettimeofday()` function, which is causing a stack
corruption/Segmentation Fault when executed against the newer glibc/kernel
in Trixie.

### Environment Details

1.  **Architecture:** armhf (armv7l)
2.  **Distribution:** Debian Trixie (Testing)
3.  **Kernel Version:** (Output of `uname -a`)
    ```
    Linux raspberrypi2 6.12.47+rpt-rpi-v7 #1 SMP Raspbian 1:6.12.47-1+rpt1
(2025-09-16) armv7l GNU/Linux
    ```
4.  **Time Size Confirmation:** (Result of compiling and running a simple C
program)
    ```
    sizeof(time_t) is 8 bytes.
    ```
    This confirms the userland is built with the new 64-bit time ABI.

### Reproduction Steps

1.  Compile the following minimal C code on the affected system:
    ```c
    #include <sys/time.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
        const char *urgency;
        struct timeval tv;
        urgency = "";
        urgency = "[NOTICE] ";
        if (gettimeofday(&tv, NULL)) {
            perror("gettimeofday");
            return(1);
        }

        printf("%06lld: %s\n", (long long)tv.tv_usec, urgency); /* OK all
env, arm32hf(bookworm,trixie) and amd64(trixie) */
        printf("%06ld: %s\n", tv.tv_usec, urgency);   /* OK
arm32hf(bookworm) and amd64(trixie), NG(SEGV) arm32hf(trixie) */
}
    ```
2.  Execution leads to a Segmentation Fault: `./a.out` -> **Segmentation
fault**

### Workaround Confirmation

--- src/log.c.org       2025-11-07 14:03:00.460255631 +0900
+++ src/log.c   2025-11-07 14:05:25.999895970 +0900
@@ -68,10 +68,10 @@
         switch (crit) {
         case LOG_WARNING:
         case LOG_ERR:
-            fprintf(stderr, "%s.%06ld: %s%s\n", timestr, tv.tv_usec,
urgency, line);
+            fprintf(stderr, "%s.%06lld: %s%s\n", timestr, (long
long)tv.tv_usec, urgency, line);
             break;
         default:
-            printf("%s.%06ld: %s%s\n", timestr, tv.tv_usec, urgency, line);
+            printf("%s.%06lld: %s%s\n", timestr, (long long)tv.tv_usec,
urgency, line);
         }
     }
     va_end(va);


Thank you for your time.

-- 
---
Mihira, Sanpei Yoshiro
Tokyo, Japan.

Reply via email to