Skip to content

Conversation

@mustiikhalil
Copy link
Collaborator

The following PR fixes a bug where we store a memory pointer to the underlying buffer memory and try to load it as an aligned value. However it seems that there was an issue with that in swift 6.1. This is fixed by using the _bb.read() method that assumes the type and loads it instead.

Closes #8648

@github-actions github-actions bot added the swift label Jul 26, 2025
@mustiikhalil mustiikhalil force-pushed the fix-fatal-error-load-misaligned-pointer branch from 2cfb449 to 5bb5d0b Compare July 26, 2025 19:43
@mustiikhalil mustiikhalil enabled auto-merge (squash) July 26, 2025 19:45
@mustiikhalil mustiikhalil self-assigned this Jul 26, 2025
@mustiikhalil mustiikhalil requested a review from aardappel July 26, 2025 21:18
@mustiikhalil
Copy link
Collaborator Author

@aardappel this also can be merged

Fixes misaligned pointer by using the bindMemory method used internally
in bytebuffer
@mustiikhalil mustiikhalil force-pushed the fix-fatal-error-load-misaligned-pointer branch from 5bb5d0b to fdfd316 Compare July 27, 2025 12:05
@mustiikhalil mustiikhalil merged commit 518bf42 into google:master Jul 29, 2025
48 checks passed
dongjoon-hyun added a commit to apache/spark-connect-swift that referenced this pull request Oct 28, 2025
### What changes were proposed in this pull request?

This PR aims to upgrade `FlatBuffers` to `v25.9.23`

### Why are the changes needed?

To bring the latest bug fixes and improvements like `Windows` support.
- https://github.com/google/flatbuffers/releases/tag/v25.9.23 (2025-09-23)
  - google/flatbuffers#8484
  - google/flatbuffers#8577
  - google/flatbuffers#8622
  - google/flatbuffers#8637
  - google/flatbuffers#8643
  - google/flatbuffers#8650
  - google/flatbuffers#8649
  - google/flatbuffers#8702

### Does this PR introduce _any_ user-facing change?

No. There is no behavior change.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #254 from dongjoon-hyun/SPARK-54045.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
@mustiikhalil mustiikhalil deleted the fix-fatal-error-load-misaligned-pointer branch November 14, 2025 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Swift] Fatal error: load from misaligned raw pointer in FlatBufferBuilder.endTable()

2 participants