What can cause a stack offset of 1?
06:27 19 Mar 2026

I've been banging my head on a bug that occurs in rare occasions in a plain C program. I've managed to pinpoint and reproduce it but it makes no sense to me. I call a function repeatedly, but in that case the pointers on the stack are offset by one:

    (gdb) break N2_AddDataWithTimeDecim
    Breakpoint 1 at 0x55555555fccf: file /home/centos/n2edmGD/n2dataread/src/N2readData.c, line 741.

    (gdb) run 0 1 1
    Starting program: /home/centos/n2edmGD/n2dataread/src/AMIreadTimeBufMult
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

    Breakpoint 1, N2_AddDataWithTimeDecim (N2dest=0x7fffffffcb70, N2source=0x7fffffffcad0, LastUsedTime=0x7fffffffcac0, TimeDecimation=100000000000, DecimMethod=1, 
        MaxRows=264, TimeStampLow=1713400695000000000, TimeStampHigh=1771179947000000000, ColNumberDiscrepancy=0x7fffffffcacc)
        at /home/centos/n2edmGD/n2dataread/src/N2readData.c:741
    741                                                             int *ColNumberDiscrepancy) {
    (gdb) c
    Continuing.

    [...many other iterations]

    Breakpoint 1, N2_AddDataWithTimeDecim (N2dest=0x7fffffffcb70, N2source=0x7fffffffcad0, LastUsedTime=0x7fffffffcac0, TimeDecimation=100000000000, DecimMethod=1, 
        MaxRows=264, TimeStampLow=1713400695000000000, TimeStampHigh=1771179947000000000, ColNumberDiscrepancy=0x7fffffffcacc)
        at /home/centos/n2edmGD/n2dataread/src/N2readData.c:741
    741                                                             int *ColNumberDiscrepancy) {
    (gdb) c
    Continuing.

    Program received signal SIGSEGV, Segmentation fault.
    0x0000555555560ac6 in N2_AddDataWithTimeDecim (N2dest=0x8000ffffcb71, N2source=0x8000ffffcad1, LastUsedTime=0x8000ffffcac1, TimeDecimation=104294967297, 
        DecimMethod=2, MaxRows=265, TimeStampLow=1713400695000000000, TimeStampHigh=1771179947000000000, ColNumberDiscrepancy=0x7fffffffcacc)
        at /home/centos/n2edmGD/n2dataread/src/N2readData.c:781
    781             for (int SourceR=0; SourceRNbRow and CopiedRows
c gdb stack-trace