Skip to content

Instantly share code, notes, and snippets.

View BasixKOR's full-sized avatar

Sung Jeon BasixKOR

View GitHub Profile
@BasixKOR
BasixKOR / ISSUE-DRAFT.md
Created July 9, 2026 17:41
Ghostty CoreText NULL-display-name crash reproducer

Ghostty segfaults during CoreText font discovery when any installed font has a NULL display name (CTFontCopyDisplayName → NULL)

Heads up on process: ghostty's CONTRIBUTING.md asks bugs to start as an "Issue Triage" discussion, not a raw issue (new issues are disabled in the repo). This is written as an issue body but should be filed at https://github.com/ghostty-org/ghostty/discussions/new?category=issue-triage — the content maps 1:1. Please search open discussions/issues first and upvote instead of duplicating if a match exists (closest neighbors I found are listed at the bottom — none are this exact bug).

Summary

On macOS, DeferredFace.name() (CoreText backend) calls CTFontCopyDisplayName() and immediately dereferences the result with no NULL check. CoreText returns NULL for the display name of any font whose name table lacks a usable full-name / family-name record. When font discovery walks the installed fonts and hits such a font, Ghostty dereferences NULL and dies with

$ opencode run hey -m anthropic/claude-sonnet-4-20250514 --print-logs
INFO 2025-07-23T16:52:22 +30ms service=default version=0.3.57 args=["run","hey","-m","anthropic/claude-sonnet-4-20250514","--print-logs"] opencode
INFO 2025-07-23T16:52:22 +0ms service=app cwd=/Users/basix/work/secret-project creating
INFO 2025-07-23T16:52:22 +1ms service=app git=/Users/basix/work/secret-project git
INFO 2025-07-23T16:52:22 +2ms service=bus type=storage.write subscribing
INFO 2025-07-23T16:52:22 +0ms service=app name=bus registering service
INFO 2025-07-23T16:52:22 +0ms service=format init
INFO 2025-07-23T16:52:22 +0ms service=bus type=file.edited subscribing
INFO 2025-07-23T16:52:22 +0ms service=config.hooks init
@BasixKOR
BasixKOR / fix-yarn-lock.sh
Created September 6, 2024 04:48
yarn.lock resolve conflicts
#!/bin/zsh
set -euo pipefail
# yarn.lock 문제의 해소는 크게 3단계로 나뉩니다.
#
# 1. 먼저 conflict 난 파일 목록에 yarn.lock 외의 다른 파일이 없는지 봅니다.
# 2. 없다면, yarn.lock을 고칩니다.
# 3. 고쳐졌다면, 현재 작업이 merge/rebase인지 확인하고 알맞게 동작합니다.
# Copyright (c) 2024 Software Freedom Conversancy
@BasixKOR
BasixKOR / index.js
Last active October 28, 2021 17:25
@node-rs/xxhash webpack reproduction
const { xxh32 } = require('@node-rs/xxhash-win32-x64-msvc'); // change it if you use another platform
xxh32('1');
@BasixKOR
BasixKOR / README.md
Last active May 7, 2023 03:16
Unlisted on GitHub
@BasixKOR
BasixKOR / Image.tsx
Created November 6, 2020 17:30
Trying to mix Img and next/image
import { Img, HTMLChakraProps } from '@chakra-ui/core';
import NextImage from 'next/image';
import { forwardRef, Ref } from 'react';
type NextImageProps = Parameters<typeof NextImage>[0]; // should be replaced with import from next when it exports its type
export type ImageProps = Omit<
HTMLChakraProps<'img'>,
'src' | 'srcSet' | 'ref' | 'width' | 'height' | 'loading' | 'w' | 'h' // TODO let it work with Chakra width/height props
> &
NextImageProps;
@BasixKOR
BasixKOR / main.rs
Created February 25, 2020 13:59
Fibonacci iterator
struct Fibonacci(usize, usize);
impl Iterator for Fibonacci {
type Item = usize;
fn next(&mut self) -> Option<Self::Item> {
let second = self.1;
self.1 = self.0 + self.1;
self.0 = second;
Some(self.1)
}
}
@BasixKOR
BasixKOR / main.rs
Created February 23, 2020 01:27
Buffered Standard I/O Quickstart
use std::io::{stdin, stdout, BufRead, BufWriter, Write};
fn main() {
let stdin = stdin();
let mut stdin = stdin.lock();
let stdout = stdout();
let mut stdout = BufWriter::new(stdout.lock());
// your code here
}
@BasixKOR
BasixKOR / gcd.rs
Last active February 23, 2020 09:49
Euclidean algorithm
/// Recursive
fn gcd<T>(a: T, b: T) -> T where T: std::ops::Rem<Output = T> + Eq + From<u8> + Copy {
if b == T::from(0u8) {
a
} else {
gcd(b, a % b)
}
}
/// Iterated
@BasixKOR
BasixKOR / README.md
Last active February 15, 2020 07:55
Handling codepage

Normalizing Codepage in Node.js

Only tested in CP-949.

Note

  • This will only work on the codepages below.
    • Windows codepages: 874, 1250-1258
    • IBM codepages: 437, 737, 775, 808, 850, 852, 855-858, 860-866, 869, 922, 1046, 1124, 1125, 1129, 1133, 1161-116
  • Multi-byte: 932, 936, 949, 950