<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-tale-of-two-libcs-sk0du8mid" -->

---
title: A tale of two libcs | daily.dev
description: A debugging story comparing glibc and musl libc implementations of isalnum. A SIGSEGV was triggered in scdoc when passing a UCS-32 codepoint to isalnum on...
canonical: https://daily.dev/posts/a-tale-of-two-libcs-sk0du8mid
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A tale of two libcs | daily.dev
og:description: A debugging story comparing glibc and musl libc implementations of isalnum. A SIGSEGV was triggered in scdoc when passing a UCS-32 codepoint to isalnum on...
og:url: https://daily.dev/posts/a-tale-of-two-libcs-sk0du8mid
og:image: https://api.daily.dev/og/posts/sk0du8miD.png
og:image:alt: A tale of two libcs
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A tale of two libcs

**[Drew DeVault](https://daily.dev/sources/drewdevault)** · 6 min read · 0 upvotes · 0 comments

## Summary

A debugging story comparing glibc and musl libc implementations of isalnum. A SIGSEGV was triggered in scdoc when passing a UCS-32 codepoint to isalnum on glibc but not musl. The root cause is glibc's isalnum implementation using a locale-based lookup table with pointer dereferences, which segfaults on out-of-range values. Musl's implementation uses simple arithmetic and never segfaults. While the C spec technically requires isalnum to only receive unsigned char values or EOF, the author argues glibc's design is needlessly complex and fragile compared to musl's clean, safe implementation.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://drewdevault.com/2020/09/25/A-story-of-two-libcs.html>

## Similar posts on daily.dev

- [your c is not standard c](https://daily.dev/posts/your-c-is-not-standard-c-fpsheaw1j) · Lobsters · 0 upvotes · 0 comments
- [How a 9-character string can crash your program](https://daily.dev/posts/how-a-9-character-string-can-crash-your-program-3hu22gmvv) · All Things Open · 0 upvotes · 0 comments
- [yet another place where a linux man page is inaccurate](https://daily.dev/posts/yet-another-place-where-a-linux-man-page-is-inaccurate-orqhov6pm) · Lobsters · 0 upvotes · 0 comments
- [The Holy Grail of Linux Binary Compatibility: musl \+ dlopen · quaadgras/graphics.gd · Discussion \#242](https://daily.dev/posts/the-holy-grail-of-linux-binary-compatibility-musl-dlopen-quaadgras-graphics-gd-discussion-24-m4zcyds4k) · Hacker News · 1 upvotes · 0 comments
- [CVE-2026-0915: GNU C Library Fixes A Security Issue Present Since 1996](https://daily.dev/posts/cve-2026-0915-gnu-c-library-fixes-a-security-issue-present-since-1996-ktmmzbe6o) · Phoronix · 0 upvotes · 0 comments

---

Tags: [#c](https://daily.dev/tags/c), [#linux](https://daily.dev/tags/linux)

[View this post on daily.dev](https://daily.dev/posts/a-tale-of-two-libcs-sk0du8mid)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A tale of two libcs","url":"https://daily.dev/posts/a-tale-of-two-libcs-sk0du8mid","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-tale-of-two-libcs-sk0du8mid"},"datePublished":"2026-03-31T12:28:12.479Z","dateModified":"2026-10-14T02:29:52.631Z","description":"A debugging story comparing glibc and musl libc implementations of isalnum. A SIGSEGV was triggered in scdoc when passing a UCS-32 codepoint to isalnum on...","image":"https://media.daily.dev/image/upload/s--P4t4XyoV--/f_auto/v1722860399/public/Placeholder%2001","thumbnailUrl":"https://media.daily.dev/image/upload/s--P4t4XyoV--/f_auto/v1722860399/public/Placeholder%2001","isAccessibleForFree":true,"articleSection":"Drew DeVault","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Drew DeVault","logo":"https://media.daily.dev/image/upload/s--BGhGBu0U--/f_auto,q_auto/v1774960025/logos/drewdevault?_a=BAMAMiWQ0","url":"https://daily.dev/sources/drewdevault"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-tale-of-two-libcs-sk0du8mid","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c,linux","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Drew DeVault","item":"https://daily.dev/sources/drewdevault"},{"@type":"ListItem","position":3,"name":"A tale of two libcs"}]}
```

