Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 12 Apr 2023 23:35:32 +0200
From: Detlef Riekenberg <wine.dev@....de>
To: musl@...ts.openwall.com
Subject: printf does not print anything (musl 1.2.3)

The attached test fails with musl 1.2.3 (does not print anything):


os: xubuntu 23.04
compiled with:  musl-gcc  -O0  -std=c99  -Wall  prog.c  -o  prog_musl-O0
gcc: 12.2.0-17ubuntu1


The programm is a tic-tac-toe game, but the source is stange:
* Filesize Original: 2745 byte (includes only <stdio.h>)
* Filesize after preprocess: with musl ~559k / with gnu libc ~571k
* After preprocess, the format string is ~100kb
* main() uses only one printf, and one arg has a scanf:

`
int main() {
    while(*d) printf(fmt, arg);
}
`

For testing, i removed the "while(*d)",
but the binary using musl still does not print anything.


Compiling the original source with the same gcc and using gnu libc works
and the gnu libc version with the removed "while (*d)" produces an output of 23592 byte.


ioccc page:  https://www.ioccc.org/2020/carlini/index.html
Also available on github:  https://github.com/carlini/printf-tac-toe


I tried to subscribe to the list, but i have no confirmation yet, so please cc me.


--
Bye bye ... Detlef

View attachment "prog.c" of type "text/plain" (2744 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.