Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[CPP]. Unaligned memory can cause a bus error on some architectures.

Open
#235 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp

Research direction

Start by tracing the allocator_ path that reserves memory and places C++ objects, focusing on the alignment requirements of atomic instructions on aarch64. Reproduce or validate the unaligned allocation case on that architecture; done means allocated object addresses meet the required alignment and no bus error occurs.

Written by the indexing model from the issue text.

Description

In the aarch64 architecture, atomic instructions have alignment requirements for memory addresses. If these requirements are not met, a bus error may occur.
In C++ code, most objects are created in this form:

void *buf = allocator_.alloc(sizeof(classA));
classA obj = new (buf) classA;

The allocator pre-requests a block of memory from the operating system and initializes objects within this space.This could result in some objects having an improper starting position, leading to errors when executing atomic-related instructions.

For example, some strings require a block of memory to store data. After memory is allocated for the string, the allocated pointer is located at a non-aligned address.

Dominant language
Java
Stars
206
Forks
105
Avg merge
22h 54m
Merged PRs (30d)
27

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/tsfile

All issues in apache/tsfile

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.