cslarsen / cslarsen/jp2a

Malloc error thrown when using --html on MacOS aarch64

Open
#21 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
1.1k
Forks
83
PR merge metrics
No merged PRs in 30d

Description

When attempting to convert an image to html code with the --html argument the program throws a malloc error, the program works just fine without converting to html.

Using the homebrew version of the program on aarch64 or Apple Sillicon on MacOS

```
$ brew info jp2a
==> jp2a: stable 1.1.1 (bottled)
Convert JPG images to ASCII
https://github.com/Talinx/jp2a
/opt/homebrew/Cellar/jp2a/1.1.1 (10 files, 134.6KB) *
Poured from bottle using the formulae.brew.sh API on 2024-01-06 at 22:16:24
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/j/jp2a.rb
License: GPL-2.0-or-later
==> Dependencies
Required: jpeg-turbo ✔, libpng ✔
==> Analytics
install: 181 (30 days), 540 (90 days), 2,024 (365 days)
install-on-request: 81 (30 days), 255 (90 days), 1,251 (365 days)
build-error: 1 (30 days)
```

```
$ jp2a ./3799666.png --html

???=?

body {
background-color: black;
}
.ascii {
font-family: Courier;
color: white;
font-size:8pt;
font-weight: bold;
}

jp2a(77309,0x1e31f1000) malloc: *** error for object 0x6000031d8a80: pointer being freed was not allocated
jp2a(77309,0x1e31f1000) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort jp2a ./3799666.png --html
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with `jp2a ./3799666.png --html` on Apple Silicon macOS, then trace the `--html` execution path and the reported invalid free. Done means the command completes without aborting and emits the expected HTML output; the issue does not name source files or tests to start from.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.