Bug 70922 - x11/x3270 breaks palm/pose
Summary: x11/x3270 breaks palm/pose
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Volker Stolz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-25 01:00 UTC by Eric P. Scott
Modified: 2005-02-17 10:59 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric P. Scott 2004-08-25 01:00:44 UTC
	It looks like something about the fonts x11/x3270 installs in ${X11BASE}/lib/X11/fonts/local causes palm/pose to crash.  This could be a bug in one of the libraries pose links against, rather than in pose itself.
	(Is this related to PR 69171?)

Fix: 

None yet.
How-To-Repeat: --note that I am using 4.10-RELEASE packages--
1. Ensure that x11/x3270 is *not* installed.
2. Install palm/pose if not present.
3. You will need to obtain a suitable ROM image (I used palmos35-en-ezdbg.rom from PalmSource).
4. Run pose once; shut it down normally (Alt-Q).  It is not necessary to save changes.
5. Install x11/x3270.
6. Run pose; wait for it to initialize.  Click Button 3.

% gdb /usr/local/bin/pose
GNU gdb 4.18 (FreeBSD)
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
(no debugging symbols found)...
(gdb) run
Starting program: /usr/local/bin/pose 
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0 in ?? ()
(gdb) bt
#0  0x0 in ?? ()
#1  0x832ec23 in inflate ()
#2  0x832cfc2 in inflate_codes ()
#3  0x832d0e6 in inflate ()
#4  0x287fc014 in ft_gzip_file_fill_output ()
   from /usr/local/lib/libfreetype.so.9
#5  0x287fc16c in ft_gzip_file_io () from /usr/local/lib/libfreetype.so.9
#6  0x287fc1f3 in ft_gzip_stream_io () from /usr/local/lib/libfreetype.so.9
#7  0x287e2a1f in FT_Stream_EnterFrame () from /usr/local/lib/libfreetype.so.9
#8  0x287e301c in FT_Stream_ReadFields () from /usr/local/lib/libfreetype.so.9
#9  0x287fc4f3 in pcf_read_TOC () from /usr/local/lib/libfreetype.so.9
#10 0x287fd37e in pcf_load_font () from /usr/local/lib/libfreetype.so.9
#11 0x287fdb09 in PCF_Face_Init () from /usr/local/lib/libfreetype.so.9
#12 0x287e5adf in open_face () from /usr/local/lib/libfreetype.so.9
#13 0x287e67d1 in FT_Open_Face () from /usr/local/lib/libfreetype.so.9
#14 0x287e5b86 in FT_New_Face () from /usr/local/lib/libfreetype.so.9
#15 0x287bd819 in FcFreeTypeQuery () from /usr/X11R6/lib/libfontconfig.so.1
#16 0x287bd27e in FcFileScan () from /usr/X11R6/lib/libfontconfig.so.1
#17 0x287bd4ff in FcDirScan () from /usr/X11R6/lib/libfontconfig.so.1
#18 0x287b8877 in FcConfigBuildFonts () from /usr/X11R6/lib/libfontconfig.so.1
#19 0x287bee1c in FcInitLoadConfigAndFonts ()
   from /usr/X11R6/lib/libfontconfig.so.1
#20 0x287bee5f in FcInit () from /usr/X11R6/lib/libfontconfig.so.1
#21 0x2870e169 in XftInit () from /usr/X11R6/lib/libXft.so.2
#22 0x2870ae83 in XftFontMatch () from /usr/X11R6/lib/libXft.so.2
#23 0x2870afe1 in XftFontOpen () from /usr/X11R6/lib/libXft.so.2
#24 0x2843e862 in fontopen () from /usr/X11R6/lib/libfltk.so.1
#25 0x2843e8b2 in Fl_FontSize::Fl_FontSize () from /usr/X11R6/lib/libfltk.so.1
#26 0x2843e76c in fl_font () from /usr/X11R6/lib/libfltk.so.1
#27 0x2843ec79 in fl_normal_measure () from /usr/X11R6/lib/libfltk.so.1
#28 0x2843ed7d in Fl_Label::measure () from /usr/X11R6/lib/libfltk.so.1
#29 0x28417854 in Fl_Menu_Item::measure () from /usr/X11R6/lib/libfltk.so.1
#30 0x28417fa6 in menuwindow::menuwindow () from /usr/X11R6/lib/libfltk.so.1
#31 0x28418f03 in Fl_Menu_Item::pulldown () from /usr/X11R6/lib/libfltk.so.1
#32 0x28419637 in Fl_Menu_Item::popup () from /usr/X11R6/lib/libfltk.so.1
#33 0x806a610 in basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> >::operator= ()
#34 0x806a149 in basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> >::operator= ()
#35 0x283f7fd6 in send () from /usr/X11R6/lib/libfltk.so.1
#36 0x283f8137 in Fl::handle () from /usr/X11R6/lib/libfltk.so.1
#37 0x28437132 in fl_handle () from /usr/X11R6/lib/libfltk.so.1
#38 0x2843585e in do_queued_events () from /usr/X11R6/lib/libfltk.so.1
#39 0x28435bd8 in fd_callback () from /usr/X11R6/lib/libfltk.so.1
#40 0x28435add in fl_wait () from /usr/X11R6/lib/libfltk.so.1
#41 0x283f77c8 in Fl::wait () from /usr/X11R6/lib/libfltk.so.1
#42 0x80523d8 in Fl_Browser::value ()
#43 0x8051f6c in Fl_Browser::value ()
#44 0x8051dee in Fl_Browser::value ()
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb) quit
Comment 1 Volker Stolz freebsd_committer 2004-08-25 14:30:27 UTC
State Changed
From-To: open->feedback

Can you please check the core dump or use ktrace to find out  
which exact file is responsible? Can you try rebuilding pose 
and all prerequesites from source to rule out stale dependencies? 
We'll only be able to mark this as a CONFLICT, maybe you'd like to 
report this as a bug to the pose-developers.
Comment 2 Eric P. Scott 2004-08-27 23:36:55 UTC
ktrace says it fails trying to process
/usr/X11R6/lib/X11/fonts/local/3270.pcf.gz.

I rebuilt pose with debugging enabled, and the backtrace then
looked like:

(gdb) bt
#0  0x0 in ?? ()
#1  0x833b01f in fill_inbuf (eof_ok=0) at ./../../SrcShared/Gzip/util.c:105
#2  0x83393e2 in inflate_block (e=0xbfbfe70c)
    at ./../../SrcShared/Gzip/inflate.c:882
#3  0x8339506 in inflate () at ./../../SrcShared/Gzip/inflate.c:931
#4  0x28814014 in ft_gzip_file_fill_output ()
   from /usr/local/lib/libfreetype.so.9
   [...]

Aha!

This probably wasn't identified earlier because:

1) Few users have "strange" fonts installed, so the offending
code never got executed.

2) The developers presumably use systems with a linker/loader
that resolves undefined symbols left-to-right.

You'll see pose links with this order:
	Miscellaneous.o libposergzip.a -lfltk

Miscellaneous.o calls inflate(), which is satisfied by
libposergzip.a.  libfltk depends on [libXft, which depends
on libfontconfig, which depends on] libfreetype, which calls
an inflate() that should come from libz--but instead binds to
the incompatible inflate() already brought in from
libposergzip.a.  That one doesn't expect to be called, and trips
over a NULL pointer from an uninitialized global.

One solution is to add "palm/pose/files/patch-gzip-conflict" to
rename the conflicting functions.

--- ../SrcShared/Gzip/gzip.h.orig	Fri Mar 29 05:11:06 2002
+++ ../SrcShared/Gzip/gzip.h	Thu Aug 26 16:12:35 2004
@@ -320,4 +320,6 @@
 //extern voidp xmalloc      OF((unsigned int size));	// POSER
 
 	/* in inflate.c */
+#define inflate POSE_inflate
+#define inflate_codes POSE_inflate_codes
 extern int inflate OF((void));

As a rule, I don't suggest using CONFLICTS except for mutually-
exclusive packages.  x3270 wasn't impacted; it just exposed the
underlying issue.  (I wonder how many other ports are similarly
affected by multiply-defined symbols?)

					-=EPS=-
Comment 3 Volker Stolz freebsd_committer 2004-10-15 17:02:59 UTC
Dear maintainer,
please review the proposed patch!

Volker
Comment 4 Volker Stolz freebsd_committer 2004-10-15 17:03:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->vs

I'll clock this PR
Comment 5 onatan 2005-02-13 10:01:41 UTC
I don't have access to any Mainframe anymore, so I
give up my maintainership of this port.
However, your problem might be solved by
updating x3270 from 3.3.2p1 to 3.3.3b2.
Comment 6 Volker Stolz freebsd_committer 2005-02-17 10:56:51 UTC
State Changed
From-To: feedback->closed

Fix committed, thanks for your patience!