Skip to content

Conversation

ringabout
Copy link
Member

fixes #25205
fixes #14873

  type
    SysLockObj {.importc: "pthread_mutex_t", pure, final,
               header: """#include <sys/types.h>
                          #include <pthread.h>""", byref.} = object
      when defined(linux) and defined(amd64):
        abi: array[40 div sizeof(clong), clong]

Before this PR, in refc, resetLoc generates field assignments for each fields of importc object. But the field abi is not a genuine field, which doesn't exits in the struct. We could use zeroMem to reset the memory if not leave it alone

@ringabout ringabout changed the title fixes #25205 #14873; resets importc obj with nimZeroMem fixes #25205 #14873; resets importc obj with nimZeroMem in specializeResetT for refc Oct 6, 2025
@ringabout
Copy link
Member Author

pre-existing CI failures: it seems that eth has been broken since the last week

@Araq Araq merged commit 02609f1 into devel Oct 6, 2025
19 of 21 checks passed
@Araq Araq deleted the pr_Geschoss branch October 6, 2025 19:55
Copy link
Contributor

github-actions bot commented Oct 6, 2025

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 02609f1

Hint: mm: orc; opt: speed; options: -d:release
183139 lines; 8.689s; 661.629MiB peakmem

@tersec
Copy link
Contributor

tersec commented Oct 7, 2025

pre-existing CI failures: it seems that eth has been broken since the last week

narimiran pushed a commit that referenced this pull request Oct 7, 2025
…alizeResetT` for `refc` (#25207)

fixes #25205
fixes #14873

```nim
  type
    SysLockObj {.importc: "pthread_mutex_t", pure, final,
               header: """#include <sys/types.h>
                          #include <pthread.h>""", byref.} = object
      when defined(linux) and defined(amd64):
        abi: array[40 div sizeof(clong), clong]
```

Before this PR, in refc, `resetLoc` generates field assignments for each
fields of `importc` object. But the field `abi` is not a genuine field,
which doesn't exits in the struct. We could use `zeroMem` to reset the
memory if not leave it alone

(cherry picked from commit 02609f1)
narimiran added a commit that referenced this pull request Oct 8, 2025
…n `specializeResetT` for `refc` (#25207)"

This reverts commit 9628c7a.
narimiran pushed a commit that referenced this pull request Oct 8, 2025
…alizeResetT` for `refc` (#25207)

fixes #25205
fixes #14873

```nim
  type
    SysLockObj {.importc: "pthread_mutex_t", pure, final,
               header: """#include <sys/types.h>
                          #include <pthread.h>""", byref.} = object
      when defined(linux) and defined(amd64):
        abi: array[40 div sizeof(clong), clong]
```

Before this PR, in refc, `resetLoc` generates field assignments for each
fields of `importc` object. But the field `abi` is not a genuine field,
which doesn't exits in the struct. We could use `zeroMem` to reset the
memory if not leave it alone

(cherry picked from commit 02609f1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error: ‘pthread_mutex_t’ has no member named ‘abi’ in refc with reset/{.exportc.} Codegen bug with lock - no member "abi"

3 participants