After recent font upgrades on my system, lcdtest segfaults on starting. A system with a working lcdtest stayed working after the font upgrades until I re-emerged lcdtest. At that point, it segfaulted on startup. Reproducible: Always Steps to Reproduce: 1. Start with an up to date stable system 2. emerge lcdtest 3. run lcdtest Actual Results: Segmentation fault Expected Results: Should run lcdtest I re-compiled lcdtest with debugging. The segfault is associated with fonts. anduril src # gdb lcdtest GNU gdb (Gentoo 7.0.1 p1) 7.0.1 Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /var/tmp/portage/sys-apps/lcdtest-1.08-r1/work/lcdtest-1.08/src/lcdtest...done. (gdb) r Starting program: /var/tmp/portage/sys-apps/lcdtest-1.08-r1/work/lcdtest-1.08/src/lcdtest [Thread debugging using libthread_db enabled] Program received signal SIGSEGV, Segmentation fault. 0x0000000000402ea7 in SFont_Write (Surface=0x649360, Font=0x0, x=0, y=0, text=0x4032d0 "press / or ? for help") at SFont.c:121 121 srcrect.h = dstrect.h = Font->Surface->h - 1; (gdb) bt #0 0x0000000000402ea7 in SFont_Write (Surface=0x649360, Font=0x0, x=0, y=0, text=0x4032d0 "press / or ? for help") at SFont.c:121 #1 0x00000000004013e6 in create_help_image (message=0x60d120, width=230, height=30) at lcdtest.c:147 #2 0x000000000040283d in main (argc=1, argv=0x7fffffffdfc8) at lcdtest.c:676 (gdb) l 116 return; 117 118 // these values won't change in the loop 119 srcrect.y = 1; 120 dstrect.y = y; 121 srcrect.h = dstrect.h = Font->Surface->h - 1; 122 123 for(c = text; *c != '\0' && x <= Surface->w ; c++) { 124 charoffset = ((int) (*c - 33)) * 2 + 1; 125 // skip spaces and nonprintable characters (gdb)
Looks like the problem start with loading the XPM file. I added a statement to print the error. IMG_ReadXPMFromArray: colour parse error
Looks like the issue is help_font.c and SDL. SDL does not like the file. I loaded it in xv and re-saved it and things work fine. I will attach a patch that will make the new help_font.c file.
Created attachment 238633 [details, diff] Patch to make help_font.c work with SDL.
Digging in deeper, I see that this patch does not help since the xpm is built on the fly. Looks like netpbm is producing a file that SDL does not like. I re-emerge netpbm and that did not help. Still looking for a good fix.
A file created by imagemagick instead of netpbm works fine. If having imagemagick as a dependency is not desirable, maybe producing a good file and simply copying it in is what should be done.
I can confirm that segfault on x86 too.
I came across this just now so I have bumped lcdtest to 1.18 in my overlay and converted the ebuild to use scons. It includes 2 patches, one for the SConscript file for obeying CC/LDFLAGS and another to find the correct path of LiberationMono-Regular.ttf. I'm not sure this is the correct thing to do but at least the package works for me now. I omitted the 1.08-help-option.patch as I'm not sure what that fixes, that may be needed too. Attached files follow. Thanks.
Created attachment 245489 [details] lcdtest-1.18.ebuild
Created attachment 245490 [details, diff] lcdtest-1.18-SConscript.patch
Created attachment 245492 [details, diff] lcdtest-1.18-font-path.patch
Created attachment 245496 [details] lcdtest-1.18.ebuild I forgot the media-libs/sdl-ttf dependency. Sorry for the noise.
Created attachment 245500 [details] lcdtest-1.18.ebuild edited dependencies again, I hope it's better this time...
Confirm that the proposed ebuild lcdtest-1.18 and two patches have resolved the segfault issue for me on x86_64.
I can confirm a)that 1.08 segfaults on startup on amd64 and b)the proposed 1.18 ebuild plus the two patches works as expected on amd64.
Thanks for the reports. I think the font path patch should maybe use sed instead, also the ebuild could make use of the scons eclass which it does not at the moment. A bit pressed for time right now as I'm about to go for surgery in a few hours, all going well I will take a look and clean it up when I get some time. Thanks again.
Updated ebuild. Changes: bump to EAPI=2 as the sdl deps use it anyway remove font path patch and sed the source from inside the ebuild instead make use of scons-utils.eclass cleanup deps and ebuild according to EAPI change and the use of scons eclass Files follow, thanks.
Created attachment 257320 [details] lcdtest-1.18.ebuild
This package is now removed from portage, as per the e-mail sent to gentoo-dev. Unfortunately I was unable to solicit interest from other developers.
Created attachment 345766 [details] lcdtest-1.18.ebuild ported to eapi5 Reworked and ported to EAPI5, works fine here. Tool is useful, want to proxy maintain.
Thank you Nikoli. Could you "inherit base" and use "base_src_prepare" and the PATCHES variable instead of using epatch. I am happy to proxy this for you.
Created attachment 345778 [details] lcdtest-1.18.ebuild
Thank you. And can we follow this advice without ill effect? scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead. File "/var/tmp/portage/sys-apps/lcdtest-1.18/work/lcdtest-1.18/SConstruct", line 127, in <module> scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead. File "/var/tmp/portage/sys-apps/lcdtest-1.18/work/lcdtest-1.18/SConstruct", line 141, in <module>
Created attachment 345780 [details] lcdtest-1.18.ebuild
Created attachment 345782 [details, diff] 1.18-build-system.patch
+*lcdtest-1.18 (17 Apr 2013) + + 17 Apr 2013; Tony Vroon <chainsaw@gentoo.org> +files/1.18-build-system.patch, + +lcdtest-1.18.ebuild, +metadata.xml: + Reintroduction of a previously removed package. Ebuild by Gavin Pryke & + Nikoli; closes bug #328137. Many thanks to you both. Nikoli, as requested you are in metadata.xml as a proxy maintainer. Any further improvements should now be filed as new bugs please.
Strange, after emerge --sync my portage tree does not have lcdtest: # emerge --info|grep Timestamp Timestamp of tree: Wed, 17 Apr 2013 19:15:01 +0000 But http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/lcdtest/ tells 'Wed Apr 17 13:41:48 2013 UTC' Any idea?
Now after 'emerge --sync' my portage tree has lcdtest, still do not know why such delay happened.