Title: ctypes: structures with float arrays returned by value are wrong on Linux SPARC · Issue #161475 · python/cpython · GitHub
Open Graph Title: ctypes: structures with float arrays returned by value are wrong on Linux SPARC · Issue #161475 · python/cpython
X Title: ctypes: structures with float arrays returned by value are wrong on Linux SPARC · Issue #161475 · python/cpython
Description: Bug report test_ctypes fails on Linux sparc64 in test_array_in_struct: a structure with a small array of doubles returned by value comes back as garbage. 8 and 9 doubles are fine, those are returned in memory. On Linux, GCC and clang pas...
Open Graph Description: Bug report test_ctypes fails on Linux sparc64 in test_array_in_struct: a structure with a small array of doubles returned by value comes back as garbage. 8 and 9 doubles are fine, those are returne...
X Description: Bug report test_ctypes fails on Linux sparc64 in test_array_in_struct: a structure with a small array of doubles returned by value comes back as garbage. 8 and 9 doubles are fine, those are returne...
Opengraph URL: https://github.com/python/cpython/issues/161475
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ctypes: structures with float arrays returned by value are wrong on Linux SPARC","articleBody":"### Bug report\n\ntest_ctypes fails on Linux sparc64 in test_array_in_struct: a structure with a small array of doubles returned by value comes back as garbage. 8 and 9 doubles are fine, those are returned in memory.\n\nOn Linux, GCC and clang pass arrays of floating-point type inside a structure in integer registers. Only Solaris follows the vendor ABI there, GCC changed that for Solaris only: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114416. Since gh-110190 ctypes describes the array elements to libffi as floats on all SPARC, so on Linux libffi reads the result from the FP registers.\n\nDescribing the elements as integers of the same size on Linux fixes it, Solaris stays as it is. Long double arrays have the same problem, I'll send that separately with a test.\n\n### CPython versions tested on:\n\n3.15\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-161476\n* gh-161558\n* gh-161559\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/shalseth","@type":"Person","name":"shalseth"},"datePublished":"2026-11-06T10:59:10Z","url":"https://github.com/python/cpython/issues/161475"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c1632e0a-02ea-3066-ccf6-b680fe9edcf9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8136:9E08E:511345:660DA1:6B02029E |
| html-safe-nonce | a62013f8c4428d8cc45b6fad34e9aeebe83e2fe391022b171fe0c3362eb01f66 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTM2OjlFMDhFOjUxMTM0NTo2NjBEQTE6NkIwMjAyOUUiLCJ2aXNpdG9yX2lkIjoiMzU3OTAwNDM1NDE1NTM4MTQwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f06d51eb584fdb5ee25d8ec331b07b197f7db741372bce6fc9c98e8701223eee |
| hovercard-subject-tag | issue:6241432576 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/161475/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1b75fe2e2b17ca542147454dece6734726c5b697460313f44d8fc8ee58c0323a/python/cpython/issues/161475 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1b75fe2e2b17ca542147454dece6734726c5b697460313f44d8fc8ee58c0323a/python/cpython/issues/161475 |
| og:image:alt | Bug report test_ctypes fails on Linux sparc64 in test_array_in_struct: a structure with a small array of doubles returned by value comes back as garbage. 8 and 9 doubles are fine, those are returne... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shalseth |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width