From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-eopbgr50054.outbound.protection.outlook.com ([40.107.5.54] helo=EUR03-VE1-obe.outbound.protection.outlook.com) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kstNQ-0003aX-DG for ptxdist@pengutronix.de; Fri, 25 Dec 2020 21:07:53 +0100 From: Christian Melki Message-ID: Date: Fri, 25 Dec 2020 21:08:14 +0100 Content-Language: en-US MIME-Version: 1.0 Subject: [ptxdist] Bad ncurses configuration for mconf? List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de, christian.melki@t2data.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Ptxdist seems to assume things about the ncurses local build that doesn't always turn up to be usable. I use a ncurses-6.2 build in Slackware. Pretty normal build. mconf headers point to the ncurses library, not ncursesw. mconf gets built with: -O2 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 and is linked with: linux-vdso.so.1 (0x00007ffcd5f30000) libncurses.so.6 => /lib64/libncurses.so.6 (0x00007f6914c68000) libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f6914c37000) libc.so.6 => /lib64/libc.so.6 (0x00007f6914a52000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f6914a4d000) /lib64/ld-linux-x86-64.so.2 (0x00007f6914cbd000) And mconf segfaults with: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f84b9a in waddch () from /lib64/libncurses.so.6 (gdb) bt #0 0x00007ffff7f84b9a in waddch () from /lib64/libncurses.so.6 #1 0x0000000000415c78 in attr_clear (win=0xcdf820, height=49, width=299, attr=) at lxdialog/util.c:250 #2 0x0000000000415cfc in dialog_clear () at lxdialog/util.c:262 #3 0x0000000000416274 in init_dialog (backtitle=backtitle@entry=0x0) at lxdialog/util.c:336 #4 0x000000000040272c in main (ac=2, av=0x7ffffffefd78) at mconf.c:1017 ... second loop pass. Height = 0 passes the width loop. Height = 1, Width = 0 segfaults. (gdb) print j $8 = 298 (gdb) n 250 waddch(win, ' '); (gdb) n 249 for (j = 0; j < width; j++) (gdb) n 247 for (i = 0; i < height; i++) { (gdb) n 248 wmove(win, i, 0); (gdb) print i $9 = 1 (gdb) n 249 for (j = 0; j < width; j++) (gdb) n 250 waddch(win, ' '); (gdb) n Program received signal SIGSEGV, Segmentation fault. I am not sure what to blame here or if I understand things. Or if it's resonable that ncurses should explode like this. Seems pkg-config cflags answers: pkg-config --cflags ncurses -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 But if I understand things >= 600 = wide char header? the pkg-config answers the same for ncursesw. So the program will compile and link just fine. If I use xterm and rxvt as $TERM the mconf program crashes, but is fine with vt100. Is this related to ext-colors support somehow? If I force the program to link with ncursesw, then all is fine. My best guess is that the terminal is ext-color, program gets built with wchar-support but linked with ncurses. This probably shouldn't explode in ncurses, but I think it's also a misconfiguration build. I would suggest that ptxdist uses ncursesw + headers if found and ncurses without wchar if not found. Kernel seems to prefer something similar? https://elixir.bootlin.com/linux/v5.10.2/source/scripts/kconfig/mconf-cfg.sh Merry Christmas! _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de