Subject: fvwm 2.5.8 (on FreeBSD 4.8-release-p13) crashes on menu pop up

From: parv <[email-masked]>
Date: Tue, 4 Nov 2003 01:42:31 -0500

Hi,

Fvwm 2.5.8 (built from ports on FreeBSD 4.8-RELEASE-p13) seem to be
crashing on menu pop (either via key binding or mouse).  Below is
a backtrace (tried to bring up menu via mouse click on root
window)...

  This GDB was configured as "i386-unknown-freebsd"...Deprecated bfd_read called at /cdrw/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 2627 in elfstab_build_psymtabs
  Deprecated bfd_read called at /cdrw/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 933 in fill_symbuf

  Core was generated by `fvwm'.
  Program terminated with signal 11, Segmentation fault.
  Reading symbols from /usr/X11R6/lib/libXft.so.2...done.
  Reading symbols from /usr/local/lib/libfreetype.so.9...done.
  Reading symbols from /usr/X11R6/lib/libfontconfig.so.1...done.
  Reading symbols from /usr/X11R6/lib/libXext.so.6...done.
  Reading symbols from /usr/X11R6/lib/libXrender.so.1...done.
  Reading symbols from /usr/X11R6/lib/libXpm.so.4...done.
  Reading symbols from /usr/X11R6/lib/libSM.so.6...done.
  Reading symbols from /usr/X11R6/lib/libICE.so.6...done.
  Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
  Reading symbols from /usr/lib/libm.so.2...done.
  Reading symbols from /usr/local/lib/libpng.so.5...done.
  Reading symbols from /usr/lib/libz.so.2...done.
  Reading symbols from /usr/lib/libxpg4.so.3...done.
  Reading symbols from /usr/lib/libc.so.4...done.
  Reading symbols from /usr/local/lib/libexpat.so.4...done.
  Reading symbols from /usr2/X11R6/lib/libXThrStub.so.6...done.
  Reading symbols from /usr2/X11R6/lib/X11/locale/common/xlcDef.so.2...done.
  Reading symbols from /usr2/X11R6/lib/X11/locale/common/xomGeneric.so.2...done.
  Reading symbols from /usr/libexec/ld-elf.so.1...done.
  #0  0x80ad093 in FlocaleDrawUnderline (dpy=0x80e8000, flf=0x80fb680, fws=0x80e6a00, offset=0)
      at Flocale.c:2080
  2080            v_coffset = l_to_v[l_coffset];
  (gdb) bt
  #0  0x80ad093 in FlocaleDrawUnderline (dpy=0x80e8000, flf=0x80fb680, fws=0x80e6a00, offset=0)
      at Flocale.c:2080
  #1  0x80a0628 in menuitem_paint (mi=0x80e6c80, mpip=0xbfbfee3c) at menuitem.c:689
  #2  0x8051352 in paint_menu (mr=0x80eb750, pevent=0x80da100, fw=0x0) at menus.c:3283
  #3  0x8055874 in menu_expose (event=0x80da100, fw=0x0) at menus.c:6555
  #4  0x8053594 in __mloop_handle_event (pmp=0xbfbff1b0, pmret=0xbfbff1a4, pdkp=0xbfbff0f4, in=0xbfbff008,
      med=0xbfbfeff4, msi=0xbfbfefe4) at menus.c:4900
  #5  0x80547ed in __menu_loop (pmp=0xbfbff1b0, pmret=0xbfbff1a4, pdkp=0xbfbff0f4) at menus.c:5819
  #6  0x805554d in do_menu (pmp=0xbfbff1b0, pmret=0xbfbff1a4) at menus.c:6423
  #7  0x80a86b0 in menu_func (cond_rc=0xbfbff2a8, exc=0x80fcd00, action=0x80e93e5 "MenuFvwmRoot", fStaysUp=1)
      at menucmd.c:116
  #8  0x80a8739 in CMD_Menu (cond_rc=0xbfbff2a8, exc=0x80fcd00, action=0x80e93e5 "MenuFvwmRoot")
      at menucmd.c:145
  #9  0x80954ec in __execute_function (cond_rc=0x0, exc=0x80fcc80, action=0x80e9960 "Menu MenuFvwmRoot",
      exec_flags=0 '\000', args=0x0) at functions.c:630
  #10 0x809602a in execute_function (cond_rc=0x0, exc=0x80fcc80, action=0x80e9960 "Menu MenuFvwmRoot",
      exec_flags=0) at functions.c:1225
  #11 0x805f96e in __handle_bpress_on_root (exc=0x80fcb80) at events.c:1442
  #12 0x805fb2b in HandleButtonPress (ea=0xbfbff408) at events.c:1556
  #13 0x8061e20 in dispatch_event (e=0xbfbff460) at events.c:3574
  #14 0x8061ece in HandleEvents () at events.c:3619
  #15 0x8081970 in main (argc=3, argv=0xbfbff85c) at fvwm.c:2524
  #16 0x804d716 in _start ()

...I did not have this nasty problem w/ version 2.5.7 compiled w/ the same
options...

  FVWM Configuration:

    Version:     2.5.8

    Executables: /usr2/X11R6/bin
    Man pages:   /usr2/X11R6/man
    Modules:     /usr2/X11R6/libexec/fvwm/2.5.8
    Data files:  /usr2/X11R6/share/fvwm
    Perl lib:    /usr2/X11R6/share/fvwm/perllib
    Locale message:  (Not installed)   ar de fr sv_SE

    With Asian bi-direct. text support? no: Explicitly disabled
    With Gettext Native Lang Support?   no: Failed to detected GNU gettext
    With GTK+ required for FvwmGtk?     yes
    With GDK image support in FvwmGtk?  yes
    With GNOME libs support in FvwmGtk? no: Explicitly disabled
    With PNG image support?             yes
    With ReadLine sup. in FvwmConsole?  yes
    With RPlay support in FvwmEvent?    no: Can't find working librplay
    With Shaped window support?         yes
    With Shared memory for XImage?      yes
    With Session Management support?    no: Explicitly disabled
    With Mouse strokes (gestures)?      no: Can't find working libstroke
    With Xinerama multi-head support?   no: Explicitly disabled
    With Xft anti-alias font support?   yes (version 2)
    With XPM image support?             yes
    With Xrender image support?         yes

...and very basic test fvwm configuration...

  key F1  R  A  -

  Mouse 1 TS  N  move-shade
  Mouse 3  T  N  WindowShade toggle

  DestroyFunc  move-shade
  AddToFunc    move-shade
  +  I Raise
  +  M Move
  +  D WindowShade

  DestroyFunc  StartFunction
  AddToFunc    StartFunction
  +  I Module FvwmAuto 1000 Raise
  +  I Module FvwmPager * *

  ClickTime  550
  ColormapFocus  FollowsFocus

  DesktopName  0 moo
  DeskTopSize  2x1

  Style FvwmPage* Sticky , !Borders

  DestroyModuleConfig FvwmPager:  *
  *FvwmPager:  Font none
  *FvwmPager:  Geometry 140x070-21-0
  *FvwmPager:  NoSeparators
  *FvwmPager:  Label 0 moo
  *FvwmPager:  WindowLabelFormat %c

...Let me know if more/other information is required.

(I am using tvtwm in the mean time as i did not have the foresight
of keeping fvwm 2.5.7 package around.)

  - Parv

-- 

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: parv <[email-masked]>
Date: Thu, 6 Nov 2003 17:22:38 -0500

in message <[email-masked]>,
wrote parv thusly...
> a backtrace (tried to bring up menu via mouse click on root
...
>   Program terminated with signal 11, Segmentation fault.
...
>   #16 0x804d716 in _start ()
...
> options
...

Could anybody give me clues about the cause of above crash & possible
solutions?

  - Parv

--

---

From: Dan Espen <[email-masked]>
Date: Thu, 06 Nov 2003 17:48:29 -0500

> Could anybody give me clues about the cause of above crash & possible

In gdb:

print l_to_v
print l_coffset
print l_to_v[l_coffset]

-- 
Dan Espen                           E-mail: [email-masked]

---

From: parv <[email-masked]>
Date: Thu, 6 Nov 2003 18:24:50 -0500

in message <[email-masked]>,
wrote Dan Espen thusly...
...
...
> > >   #0  0x80ad093 in FlocaleDrawUnderline (dpy=0x80e8000,
> > >       flf=0x80fb680, fws= 0x80e6a00, offset=0) at Flocale.c:2080
> > >   #0  0x80ad093 in FlocaleDrawUnderline (dpy=0x80e8000,
> > >       flf=0x80fb680, fws= 0x80e6a00, offset=0) at Flocale.c:2080
> > >   #1  0x80a0628 in menuitem_paint (mi=0x80e6c80,
> > >       mpip=0xbfbfee3c) at menuit em.c:689

(see OP for details on backtrace)

> > Could anybody give me clues about the cause of above crash &
> > possible solutions?
> 
> In gdb:
> 
> print l_to_v
> print l_coffset
> print l_to_v[l_coffset]
> 

Null pointer looks like is for l_to_v ...

  (gdb) print l_to_v
  $1 = (int *) 0x0
  (gdb) print l_coffset
  $2 = 0
  (gdb) print l_to_v[l_coffset]
  Cannot access memory at address 0x0.

  - Parv

--

---

From: Dan Espen <[email-masked]>
Date: Thu, 06 Nov 2003 21:11:41 -0500

>   Cannot access memory at address 0x0.

It looks to me like you don't have iconv support.
I wasn't able to buid fvwm like that to test a fix.
I tried
  --with-iconv=no \
  --with-iconv-includes=no \
  --with-iconv-library=no \
but still got support.

Did you build this yourself?  Did you get these messages:

configure: warning: ***
configure: warning: *** No iconv() implementation found in C library or libiconv
configure: warning: *** Please install libiconv ftp://ftp.gnu.org/pub/gnu/libiconv
configure: warning: ***

Marcus, maybe you should look at this.

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 7 Nov 2003 10:40:09 +0100

>   --with-iconv-library=no \

If all else fails, edit the config.h manually.  It looks like
iconv is missing in the configure summary.

> Marcus, maybe you should look at this.

Ciao

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 7 Nov 2003 11:20:48 +0100

>   --with-iconv-library=no \

Try the new --disable-iconf option I just checked in.

Ciao

Dominik ^_^  ^_^

---

From: Guido Berhoerster <[email-masked]>
Date: Fri, 7 Nov 2003 11:22:27 +0100

> > configure: warning: *** Please install libiconv ftp://ftp.gnu.org/pub/gnu/libiconv

The Makefile of the FreeBSD port does not correctly specify
--with-iconv-library. configure thus fails to detect iconv.
Furthermore the Makefile optionally allows fvwm to be built with
iconv support disabled.
I have filed a PR with a patch to correct this, see
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/59032 .
Is it possible for fvwm to work without iconv support? If not
it shouldn't be buildable when iconv is not detected.
-- 
Guido Berhoerster    [email-masked]
                     http://www.guido-berhoerster.org/
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Fri, 07 Nov 2003 08:31:48 -0500

Dominik Vogt <[email-masked]> writes:
> Try the new --disable-iconv option I just checked in.

I hope my testing is good, something isn't right.
I think you'll get the idea:

   --disable-iconv \
   --with-iconv=no \

  With Iconv support?                 no: Explicitly disabled

   --enable-iconv \
   --with-iconv=no \

  With Iconv support?                 system: Explicitly disabled

   --enable-iconv \

  With Iconv support?                 system: Can't find working libiconv

I don't think the message is being set in all cases.

---

From: Dan Espen <[email-masked]>
Date: Fri, 07 Nov 2003 08:37:49 -0500

> it shouldn't be buildable when iconv is not detected.

It would be nice if it worked without iconv.

So far my attempts to work around the missing l_to_v integer
array haven't worked.  (I did disable the free).  But I'm still
getting heap corruption.

I may try again but I'm sure Marcus could fix this faster than
I could.

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 7 Nov 2003 14:40:52 +0100

> I don't think the message is being set in all cases.

Yes, it's the problem_iconv variable not being set correctly.

Ciao

Dominik ^_^  ^_^

---

From: parv <[email-masked]>
Date: Fri, 7 Nov 2003 13:59:06 -0500

in message <[email-masked]>,
wrote Dan Espen thusly...

Hi Dan,

> > > > in message <[email-masked]>, wrote parv
> > > > thusly...
...
...
> It looks to me like you don't have iconv support.  I wasn't able
> to buid fvwm like that to test a fix.

I have iconv installed (as a dependency for other software), but
disabled it for fvwm freebsd port to reduce number of dependencies.

I think Guido explained quite well in another message.

> Did you build this yourself?

No, i tried it from freebsd port.

> Did you get these messages:
> 
> configure: warning: ***

Now that i look in the log, yes that message is there.  Since the
build did not fail, i did not care.

I really do not have problem w/ fvwm2 -dev requiring iconv and can
live/build with that.  But... "it would be nice if iconv were not
a requirement".

I will lookup the Guido's patch, and try again by building the port
w/ iconv support.

(Oh, i did find version 2.5.7 somewhere.  I had not deleted it, just
misplaced.  Fvwm2 is much easier to use w/ auto-raise-window feature
than tvtwm due to availability of time delay.)

  - Parv

--

---

From: Marcus Lundblad <[email-masked]>
Date: Fri, 7 Nov 2003 22:11:15 +0100 (CET)

> I may try again but I'm sure Marcus could fix this faster than

I'll take a look at it tomorrow

//Marcus

---

From: parv <[email-masked]>
Date: Fri, 7 Nov 2003 22:13:02 -0500

In last few episodes: Zero as the value of 'l_to_v', while examining
fvwm core file in gdb, indicated lack of iconv support in fvwm 2.5.8
FreeBSD port, causing fvwm to crash on bringing up a menu.

Now the (semi) conclusion...

in message <[email-masked]>,
wrote parv thusly...

> disabled it for fvwm freebsd port to reduce number of dependencies
> ... Since the build did not fail, i did not care.
...
> I will lookup the Guido's patch, and try again by building the port

It will not be surprise to those who have replied that after pulling
in iconv (correctly), thanks to Guido's patch, fvwm 2.5.8 FreeBSD
port, does not crash anymore.  This message is for the sake of
archive.

Thank you everyone for your help for solving the cause of the crash.

  - Parv

--