Fix crash when using ffmpeg to play mp3 and ogg
[sxemacs] / PROBLEMS
1                                                   -*- mode:outline -*-
2
3 At the time of this release (SXEmacs 22.1.15), SXEmacs has the
4 following idiosyncrasies: 
5
6 * File Locations
7 ================
8
9 ** User init file (C-h v user-init-file)
10
11 SXEmacs looks for user init files in `user-init-directory'.  The
12 preferred directory is: ${XDG_CONFIG_HOME}/sxemacs but it can fall
13 back to the old ~/.sxemacs directory.
14
15 The search order is:
16
17     ${XDG_CONFIG_HOME}/sxemacs
18     ${HOME}/.config/sxemacs     # if $XDG_CONFIG_HOME is not set
19     ${HOME}/.sxemacs            # if other dirs don't exist
20
21 You can also force the use of ~/.sxemacs regardless of the existence
22 of the XDG dir/var by setting $SXE_USE_LEGACY environment variable to
23 a non-nil value.
24
25 If you're coming from XEmacs, symlinking your old ~/.xemacs directory
26 to a SXEmacs location should be enough to get you up and running:
27
28     $ ln -svfn ${HOME}/.xemacs ${XDG_CONFIG_HOME}/sxemacs
29
30 BTW, unlike XEmacs, SXEmacs doesn't attempt to "migrate" your old init
31 file or Gnu/Emacs .emacs file.
32
33 ** Packages Hierarchy
34
35 *** System-wide Packages (late-packages)
36
37 The default location that SXEmacs searches for packages is
38 `$prefix/share/sxemacs/'.  The same as for the user-init-file, a
39 symlink is all you need to get up and running.
40
41     $ ln -svfn /usr/local/lib/xemacs /usr/local/share/sxemacs
42
43 *** User Packages in ${HOME} (early-packages)
44
45 For packages that you keep in your ${HOME}, the preferred location is:
46 ${XDG_DATA_HOME}/sxemacs.  This is normally ${HOME}/.local/share/sxemacs,
47 and SXEmacs will use that if ${XDG_DATA_HOME} is not set.
48
49 These packages may also be located in ~/.sxemacs if that is where you
50 have your user-init-directory set to.
51
52
53 * Build Quirks
54 ==============
55
56 ** FFI
57
58 *** FFI is not included with your distro
59
60 Sadly, some Linux distributions (hello Fedora) don't ship a libffi
61 package, and their GCC does NOT include libffi or FFI headers either.
62 In this instance you have 2 options...
63
64   1) Get the standalone package of libffi at
65      <http://sourceware.org/libffi/>.
66
67   2) Compile your own GCC from source, making sure you enable the java
68      compiler.  Enabling java in your GCC build is the only way to get
69      libffi built.
70
71 Obviously, option #1 there is the easiest and quickest path to
72 FFI-enabled SXEmacsen, and it is the option that we recommend.
73
74 Oh, and please nag your distro to have FFI included by default.
75
76 *** FFI is included in your GCC but you see missing header errors
77
78 Often libffi headers aren't completely installed.  If you are getting
79 errors in effi.c that seem to be hinged from something like...
80
81   /usr/include/ffi.h:63:23: ffitarget.h: No such file or directory
82
83 You need to find `ffitarget.h' and put it in the same directory as
84 your `ffi.h'.  Your libffi came with GCC, so you'll find it within
85 your GCC directories:
86
87   $ dirname $(gcc -print-libgcc-file-name)
88 /usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.1
89
90 Using that example, ffitarget.h would be in...
91
92   /usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.1/libffi/
93
94 Just copy or symlink the ffitarget.h there to /usr/include
95
96 *** FFI on SELinux enabled machines
97
98 If you are running with SELinux enabled and configure fails with
99 messages like the following in `config.log'...
100
101   error while loading shared libraries: /usr/local/lib/libffi.so.1:
102   cannot restore segment prot after reloc: Permission denied
103
104 You need to correct the default security context for `libffi.so'.
105
106   $ chcon -t textrel_shlib_t /usr/local/lib/libffi.so
107
108 ** PostgreSQL
109
110 The autoconf tests for PostgreSQL support have changed.  SXEmacs'
111 configure script now uses `pg_config' to determine whether or not to
112 enable PostgreSQL.  Because of this you may have to set you $PATH
113 environment to include the pgsql bin directory.  It is normally
114 `/usr/local/pgsql/bin/'.  Another popular directory on Solaris 9 is
115 `/opt/crw/postgresql/bin/'.  Check with your site administrator.
116
117 Bash users can do it like this...
118
119   export PATH=/usr/local/pgsql/bin:$PATH
120
121 *** Solaris 9 with 64-bit PostgreSQL
122
123 There has also been a report that on Solaris 9 you may also need to
124 configure with `--with-cflags='-mcpu=ultrasparc -m64''.  Apparently
125 GCC on Solaris 9 defaults to building 32-bit, so you lose if you have
126 64-bit PostgreSQL.
127
128 ** 64-bit test suite failure
129
130 We have had a couple of reports of the test suite failing on 64-bit
131 systems.  The error is like this (or similar)...
132
133 Testing /usr/src/sxemacs/modules/ase/ase-heap-tests.el...
134 Loading ase_heap v0.0.0 (SXEmacs module: ase-heap)
135 Loaded module ase_heap v0.0.0 (SXEmacs module: ase-heap)Fatal error: assertion failed, file alloc.c, line 298, block != (void*)0xCAFEBABEDEADBEEF
136 make[3]: *** [check-am] Aborted
137
138 At this point we are not too sure exactly what the issue is.  It looks
139 like it might be a bug in the malloc or free code of the libc.  We do
140 know that not all 64-bit systems are affected, so far, only Fedora
141 Core 7, and Gentoo on x86_64.
142
143 One user has reported that using `-O1' in CFLAGS prevents it.
144
145 But even with this test failure, SXEmacs still runs and operates
146 without incident.  In fact, the failure can't be reproduced when
147 running the test suite interactively.  With that in mind, it should be
148 safe to install if you see this failure.
149
150 We'll endeavour to get to the bottom of this one ASAP, if you think
151 you can help, let us know.
152
153 ** m4, libtool, autoconf, automake, and whatnot
154
155 SXEmacs tries to cope with any combination of versions of the above
156 programs.  However, there is one lower bound, autoconf 2.60, and
157 unfortunately this has an impact on the other parts of the build
158 tools.
159
160 To cut it really short, here is the minimum known-to-work combination:
161 - autoconf 2.62, automake 1.9.6, libtool 1.5.22, m4 1.4.6
162
163 In general we support (as of April, 2010):
164 - autoconf >= 2.62, including current git versions
165 - automake 1.9.6, 1.10, 1.10a, 1.11.1, and current git versions
166 - libtool 1.5.N with N >= 22, libtool >= 2.1a (current CVS version)
167 - m4 1.4.M with M >= 6 plus current git versions
168
169 Note that many libtool packages shipped with the distros (OpenSuSE,
170 Debian, just to name two) are _broken_.  Make sure you compile
171 your own libtool in case you want to rerun autogen.sh or bootstrap
172 the build chain, and double check that you use --enable-ltdl-install
173 when doing so.
174
175 If you are on a platform that has its own _non_gnu libtool (like OS/X
176 Leopard) add --program-prefix=g to your gnu libtool configure so it
177 installs as glibtool and doesn't clobber your other one.
178
179 Sometimes it helps just to copy over the libtool script manually:
180 cp -a $(type -p libtool) ${top_builddir}
181
182 *** ylwrap fails with sed errors
183
184 Some versions of the ylwrap script provided by autotools uses commas
185 as separators in sed commands. As such if your build path uses commas
186 the ylwrap will fail. 
187
188 Sample message (where the build path was /Users/njsf/Projects/SXEmacs/nsx-up/,,mac):
189
190 /Users/njsf/Projects/SXEmacs/nsx-up/,,mac/lib-src/make-docfile --modname cl-loop -E cl-loop.doc.c ../../../modules/cl/cl-loop.c
191 /bin/sh ../../../ylwrap ../../../modules/cl/cl-loop-parser.y y.tab.c cl-loop-parser.c y.tab.h cl-loop-parser.h y.output
192 cl-loop-parser.output -- bison -y  -d
193 sed: 1: "s,/Users/njsf/Projects/ ...": bad flag in substitute command: 'm'
194 sed: 1: "s,/Users/njsf/Projects/ ...": bad flag in substitute command: 'm'
195
196 The workaround is to use a path without commas in it.
197
198
199 *** Missing libltdl.la (Solaris 2.8)
200
201 We've had a report that missing libtool on Solaris 2.8 isn't detected
202 and so the included libtool still isn't used.  If you see an error
203 about a missing libltdl.la all you need to do is configure SXEmacs
204 with... 
205
206   --with-included-ltdl
207
208 ** configure
209
210 *** configure on FreeBSD, NetBSD, OpenBSD, etc.
211
212 Building SXEmacs on *BSD as far as we know requires the GNU Bourne
213 Again SHell (bash) versions 3 or 4.
214
215 bash is available for all tier 1 architectures as a binary package and 
216 and for tier 2/3 as a port.
217
218 To run configure successfully...
219
220     CONFIG_SHELL=/path/to/bash $CONFIG_SHELL configure [option, ...]
221
222 *** configure on FreeBSD
223
224 Turning on the use of libssp and -fstack-protector from configure
225 ( --with-error-checking=stack ) will result in a broken build. 
226
227 Do not, under any circumstances, add -fstack-protector to CFLAGS, even 
228 independently of the stack error checking option. 
229
230 ** bdwgc and gcc and code optimisation
231
232 There are some weird optimisation issues with the Boehm-Demers-Weiser
233 garbage collector (hereafter BDWGC) and the GCC C compilers of the 2 and
234 3 series.  The build will crash like this:
235
236   Loading build-autoloads.el...
237   Loading loadup-el.el...
238   Loading loadup.el...make[3]: *** [auto-autoloads.el] Segmentation fault
239   (core dumped)
240   make[3]: Leaving directory
241
242 The C backtrace will look like:
243
244   #0  0xbff9a2f0 in ?? ()
245   #1  0xb7eaf7d6 in GC_invoke_finalizers () at finalize.c:787
246   #2  0xb7eaf8ed in GC_notify_or_invoke_finalizers () at finalize.c:844
247   #3  0xb7eb2c8c in GC_generic_malloc (lb=32, k=0) at malloc.c:190
248
249 If this is true for you, you may want to try another optimisation level:
250
251   ./configure CFLAGS="-g -O2"
252
253 If this still does not work out either dispense with BDWGC support or
254 use a recent C compiler.  ATTOW, all GCC 4.x compilers (including SVN)
255 should work.
256
257 ** ENT
258
259 ENT is basically a conglomerate of internally and externally implemented
260 arithmetics.  Hence it supports a number of libraries, some of which
261 overlap in their functionality, some others do not but then break at the
262 compatibility layer.
263
264 One of the most likely problems is the GMP vs. MPFR issue.  In past
265 times, mpfr (a multiprecision library for floats with exact rounding
266 facilities) has been a part of the GMP distribution.  Later on, mpfr got
267 separated from it and has been developed independently while the version
268 of mpfr which ships with GMP stayed the same.  Now that scenario is
269 exactly the problem.
270
271 Inattentive distributions (like Fedora) still deliver packages of GMP
272 with the old'n'incompatible mpfr library.  SXEmacs will disable the MPFR
273 support on such systems by default (at configure time).  However, if you
274 install a supported version of mpfr in parallel to the packaged ones on
275 such a system SXEmacs autodetection correctly reports that a sane
276 version of mpfr is available and enables it.  Nonetheless, the according
277 build may fail (or the build may even succeed but calling the binary may
278 fail), like this:
279
280 number-mpfr.o: In function `ent_lt_BIGFR_T':
281 /home/martin/src/edit/sxemacs-main/src/number-mpfr.c:661: undefined
282 reference to `mpfr_less_p'
283 number-mpfr.o: In function `ent_gt_BIGFR_T':
284 /home/martin/src/edit/sxemacs-main/src/number-mpfr.c:671: undefined
285 reference to `mpfr_greater_p'
286 ...
287
288 Especially note that we _only_ support the standalone version of MPFR,
289 and not the one distributed with GMP.
290
291 Solution:
292 ---------
293 Either:
294    Badger your distributor and demand separate packages for GMP and
295    MPFR.
296 Or:
297    Remove the GMP package and install your own build -- available at
298    http://swox.com/gmp -- afterwards install your own build of mpfr (the
299    one from http://www.mpfr.org)
300
301 Reconfigure and rebuild SXEmacs afterwards.
302
303
304 ** Build fails because of missing makeinfo
305
306 Install the GNU texinfo package on your system. You'll need at least
307 version 4.8.
308
309
310 ** MacOS X warns of a crash during configure
311
312 This is normal, as one of the tests made during configure (for the
313 realpath call correctness) induces as crash.
314
315 If you are developing SXEmacs and will do lots of runs of configure
316 and that dialog annoys you, consider issuing:
317
318     # Disable crash reporting
319     sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist
320     # Redo last configure
321     ./config.status --recheck 
322     # Enable crash reporting
323     sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist
324
325 Another alternative (not recommended) is to launch
326
327         /Developer/Applications/Utilities/CrashReporterPrefs
328
329 and configure the mode to server, but you will loose notifications of
330 crashes on all applications.
331
332 In order to give SXEmacs developers with good diagnosis information it
333 is recommended the mode be Developer.
334
335 ** OpenIndiana
336
337 SXEmacs does build and run on OpenIndiana (151a) but you will need to
338 install a few files/packages beforehand.  Namely...
339
340     Common Name             OpenIndiana Package Name
341
342         GCC                     gcc-3
343         GNU M4                  gnu-m4
344         automake                automake-110
345         autoconf                autoconf
346         libtool                 libtool (also install libltdl)
347         pkg-config              gettext
348         math.h                  header-math
349         bison                   bison
350         gmp                     gmp
351         mpfr                    mpfr
352
353 Yes, you read that right... to get pkg-config you must install the
354 "gettext" package. :-)
355
356 In that list, `bison', `gmp', and `mpfr' are not critical, but you
357 will get extra functionality in your SXEmacs if you have them.
358
359 *** automake additional instructions for OpenIndiana
360
361 When you install the automake-110 OpenIndiana package it won't set up
362 the symlinks to /usr/bin/automake or /usr/bin/aclocal.  Fix that
363 with...
364
365         sudo ln -sv automake-1.10 /usr/bin/automake
366         sudo ln -sv aclocal-1.10 /usr/bin/aclocal
367
368 *** Running SXEmacs configure on OpenIndiana
369
370 There's one more quirk with OpenIndiana when you try to run SXEmacs'
371 configure... you MUST set $CONFIG_SHELL
372
373              CONFIG_SHELL=/bin/bash ../configure [opts]
374
375
376 ** make does not stop on subdirectory build failure
377
378 Due to a bug in the make argument parsing in code generated by
379 autoconf it is possible for make not to stop when a subdirectory fails.
380
381 This failure occurs for instance when the make command line has a variable
382 assignment which has a value with a - and k. Example:
383
384 make CFLAGS="-Wall -fpacked -fpedantic" build-report
385
386
387 * XEmacs Packages
388 =================
389
390 We have identified 2 packages so far that don't work "out of the box"
391 with SXEmacs.  In both of these the problem is with parsing version
392 information.  Patches have been sent to the appropriate maintainer to
393 fix the problem and are included here in case the packages haven't
394 been updated by the time you install SXEmacs.
395
396 Update:  The EFS, and Dired XEmacs packages that are currently
397 available from the "Pre-Releases" area of XEmacs package mirrors are
398 both now compatible with SXEmacs and do not need the patches mentioned
399 here.
400
401 * Problems with running SXEmacs
402 ===============================
403
404 ** FFI Related
405
406 *** ffi-wand.el refuses to load.
407
408 Can't load library `libMagickWand': libgomp.so.1: shared object cannot be
409 dlopen()ed
410
411 If you get that error when trying to load ffi-wand, it is because you
412 have a ImageMagick that is using OpenMP (currently only svn HEAD).  To
413 fix this you will need to rebuild ImageMagick, making sure that you
414 configure it using --disable-openmp.
415
416 See: <http://issues.sxemacs.org/show_bug.cgi?id=104>
417
418 ** Multimedia Goodness
419
420 *** SXEmacs hangs or crashes during (init-asynchronousity).
421
422 This is most likely a known effect (we do not want to call it bug,
423 since there is no definite location) with certain (g)libc and kernel
424 combinations under Linux.  If it crashes analyse the core file, it
425 should look like this:
426
427 #0  0x4014ebc4 in __sigsuspend (set=0xbffffbb4) at 
428 ../sysdeps/unix/sysv/linux/sigsuspend.c:48
429 #1  0x40101b34 in __pthread_wait_for_restart_signal (self=0x401116e0) at 
430 pthread.c:786
431 #2  0x40101138 in __pthread_create_2_1 (thread=0x206f8dc, attr=0xbffffc58, 
432 start_routine=0x20043ac <console>, arg=0xbffffd88) at restart.h:26
433
434 A definite fault-prone setup is using kernel 2.6.x in conjunction with
435 glibc-2.1.1.
436
437 *** SXEmacs hangs or crashes before it ought to playback sound.
438
439 As before, this is most likely a suspicious (g)libc/kernel
440 combination.
441
442 *** SXEmacs dumps core when using the ALSA audio device
443
444 This has been reported to happen with old ALSA libraries (1.0.3 to be
445 precise).  At the moment it is uncertain at which version these
446 problems disappear (no developer wants to downgrade to a non-working
447 ALSA :D).  We highly suggest to use the version 1.0.10 and above, or
448 not use ALSA at all.
449
450 *** SXEmacs in async mode does not play simultaneous sounds with ALSA
451
452 This is due to missing (hardware-)mixing capabilities of your
453 soundcard.  There is a user-space plugin called dmix, which can
454 effectively circumvent this issue.
455
456 *** SXEmacs crashes when using state sentinels with asynchronous sounds
457
458 This is a known bug (#13 in our bug database).  At the moment the only
459 advise we can give is: do not use sentinels before 22.1.7.
460 Also see our bug database at http://issues.sxemacs.org
461
462 *** make-media-stream seems to recognise any file as valid audio
463
464 This is a known issue with fully-featured ffmpeg builds.  The current
465 code in SXEmacs blindly relies on FFmpeg when it reports a file or
466 string as valid audio.  There is no way to double-check that at the
467 moment.  However, you can perform the additional check yourself if
468 you have taglib installed.  Use the included ffi-taglib.el.
469
470
471 *** XCreateIC fails at startup
472
473 SXEmacs sometimes fails to create the input context with XCreateIC on
474 non-C languages.  SXEmacs will include the values of the LANG and
475 XMODIFIERS environment variables which influence the behavior of
476 XCreateIC.  Failures have been observed with XMODIFIERS=@im=ibus
477
478
479 *** Text gets garbled/corrupted with Xorg ATI driver
480
481 Some versions of the Xorg ATI driver present display issues where text
482 display gets corrupted.  Because of the conservative way SXEmacs
483 updates the screen it is more susceptible to these issues than other
484 applications.
485
486 Some users have reported the problem goes away when using proprietary
487 drivers.  CAVEAT EMPTOR: Proprietary drivers have also been reported
488 to break other parts of the system, most notabable are bad
489 interactions with graphic boot package Plymouth when it asks for
490 password for encrypted volumes at boot.
491
492
493 * Original XEmacs PROBLEMS File
494 ===============================
495
496 The original XEmacs PROBLEMS file may be found in the SXEmacs 
497 source distribution as PROBLEMS.XEmacs - while many issues mentioned
498 have since been fixed, it is preserved for posterity.