Subject: FVWM: Abort trap from menu after upgrade to Fvwm2.4.14

From: Louis LeBlanc <[email-masked]>
Date: Fri, 10 Jan 2003 12:33:50 -0500

Hey all.  I've been away for some time (got my fvwm config tweaked
just where I wanted it) and now something has happened.

I recently upgraded to fvwm2.4.14 on FreeBSD, but hadn't gotten around
to restarting the system yet.  Then last night, we lost power for
awhile, and when it came back, the system came up great - except for X
and Fvwm.

I narrowed down and solved most of the problems, but now I have Fvwm
starting with my usual desktop and menus, but the menus and any exec
hotkeys don't seem to work.  Any time I try to exec something from the
menus, I simply get a message in the log that says:
Abort trap

and that's it.  Nothing else.  I couldn't even get an xterm up without
going to a tty console and executing from the command line to display
0:0.  I can do pretty much anything from the command line, but what's
the deal with the menus?

I have my config set up as follows:
~/.fvwm/.fvwm2rc               Main config

and the module specific configs:
~/.fvwm/ConfigFvwmBacker
~/.fvwm/ConfigFvwmButtons
~/.fvwm/ConfigFvwmIconBox
~/.fvwm/ConfigFvwmIconMan
~/.fvwm/ConfigFvwmIdent
~/.fvwm/ConfigFvwmMenus
~/.fvwm/ConfigFvwmPager
~/.fvwm/ConfigFvwmScroll
~/.fvwm/ConfigFvwmTaskBar
~/.fvwm/ConfigFvwmWinList

The module specific configs are read from .fvwm2rc as follows:
read ConfigFvwmMenus
read . . . 

You get the picture.  Anyway, the menus all seem right, so I'm sure
the file gets read, but why won't they work?

My ConfigFvwmMenus file has not been changed for some time, so I don't
think anything could be wrong with it.

A typical dropdown section from it would be:
AddToMenu "MenuFvwmRoot/Terminals" "Terminals" Title
+ "&Eterm" Exec    /usr/X11R6/bin/Eterm
+ "&rxvt" Exec    /usr/X11R6/bin/rxvt
+ "&xterm" Exec    /usr/X11R6/bin/xterm

And it doesn't work.  I typically use the xterm, but none of the menu
items works anymore.  I can't find anything that seems to be related
on the fvwm site, or in the manpages.

Any help would be appreciated.

Thanks
Lou
-- 
Louis LeBlanc               [email-masked]
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     ԿԬ

Johnson's law:
  Systems resemble the organizations that create them.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Fri, 10 Jan 2003 12:56:41 -0500

Louis LeBlanc <[email-masked]> writes:
> and that's it.  Nothing else.

Something is calling the abort() function.

Since Fvwm is still running, it doesn't sound like fvwm.

When you "exec" something, Fvwm looks for the config command
"ExecUseShell" and then $SHELL, otherwise it uses /bin/sh.

Look for an ExecUseShell command, then look at $SHELL.
If either is set, try to use them to start a program.
Otherwise try to use /bin/sh to start a program.

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

---

From: Louis LeBlanc <[email-masked]>
Date: Fri, 10 Jan 2003 13:16:09 -0500

> Otherwise try to use /bin/sh to start a program.

Hmm.  Not sure if this sheds any light . . .

I found no ExecUseShell commands in my config, but . . .

-bash-2.05b$ echo $SHELL
/usr/local/bin/bash
-bash-2.05b$ /usr/local/bin/bash xterm  
xterm: /usr/X11R6/bin/xterm: Permission denied
-bash-2.05b$ /bin/sh /usr/X11R6/bin/xterm
/usr/X11R6/bin/xterm: Can't open /usr/X11R6/bin/xterm: Permission denied
-bash-2.05b$ 

Permission denied?  I must be doing something wrong there.  I usually
just type in the command from the prompt.  Typing in xterm from the
bash shell pops up a terminal immediately.  Ditto if I switch to
/bin/sh.

I'll keep looking.

Thanks
Lou

The Third Law of Photography:
  If you did manage to get any good shots, they will be ruined when
  someone inadvertently opens the darkroom door and all of the dark leaks out.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Louis LeBlanc <[email-masked]>
Date: Fri, 10 Jan 2003 22:47:39 -0500

> Otherwise try to use /bin/sh to start a program.

No good.  I tried this, and either I'm not doing it right or it's not
the problem.

I don't know where to go next.  I've tried the default system.fvwm2rc
distributed with fvwm2, and it behaves the same way.

Any other ideas?

Thanks.

Lou

667:
  The neighbor of the beast.

---

From: Dan Espen <[email-masked]>
Date: Fri, 10 Jan 2003 23:20:10 -0500

> bash shell pops up a terminal immediately.  Ditto if I switch to

The permission denied message is an indication of a problem,
it shouldn't be happening.  I don't know exactly what it is.

I guess I'd first look at the permissions on the files.
All of them.  Then run "file" on each.  Then run the whole
thing under strace:

strace -f /bin/sh /usr/X11R6/bin/xterm 2>/tmp/strace.out

Then look in /tmp/strace.out for whats causing the permission
denied.

Its a little odd that you have bash installed in /usr/local,
I guess thats normal for FreeBSD?

---

From: Louis LeBlanc <[email-masked]>
Date: Fri, 10 Jan 2003 23:52:42 -0500

> Then look in /tmp/strace.out for whats causing the permission

-bash-2.05b$ strace -f /bin/sh /usr/X11R6/bin/xterm 2>/tmp/strace.out
-bash-2.05b$ cat /tmp/strace.out 
execve("/bin/sh", ["/bin/sh", "/usr/X11R6/bin/xterm"], [/* 19 vars */]) = 0
getpid()                                = 56490 (ppid 56489)
geteuid(0x2)                            = 500
readlink("/etc/malloc.conf", 0xbfbff574, 63) = -1 ENOENT (No such file or directory)
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0x280b1000
break(0x80c1000)                        = 0
break(0x80c2000)                        = 0
stat("/var/mail/leblanc", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
getuid()                                = 500 (euid 500)
geteuid(0x2)                            = 500
getgid()                                = 100 (egid 100)
getegid(0x2)                            = 100
open("/usr/X11R6/bin/xterm", O_RDONLY)  = -1 EACCES (Permission denied)
break(0x80c3000)                        = 0
write(2, "/usr/X11R6/bin/xterm: Can\'t open"..., 73/usr/X11R6/bin/xterm: Can't open /usr/X11R6/bin/xterm: Permission denied) = 73
exit(2)                                 = ?
-bash-2.05b$ 

I'm afraid I don't really understand this.  It seems to say it can't
open /usr/X11R6/bin/xterm in the write call, but that should be the
case anyway.  I shouldn't be able to write to the file itself.  One
thing that could be a problem is that the xterm executable is not
readable, only executable:

bash-2.05b$ ls -l /usr/X11R6/bin/xterm 
-rws--x--x  1 root  wheel  226568 Jan 10 09:19 /usr/X11R6/bin/xterm*

And the file command gives this:

# file /usr/X11R6/bin/xterm 
/usr/X11R6/bin/xterm: setuid ELF 32-bit LSB executable, Intel 80386,
version 1 (FreeBSD), dynamically linked (uses shared libs), stripped

So I don't think there's anything particularly wrong with the
executable itself, but something's screwy with the shell execution
method that is used by Fvwm.  This isn't necessarily a problem in the
Fvwm code however.  It could be in the Xterm.  Unfortunately, I did
just upgrade both of them, so your guess is as good as mine.

> I guess thats normal for FreeBSD?

Yes.  It doesn't install by default, but it's my shell of choice.
Since the ports system is by far the easiest software management
system I've ever seen, I installed it from there.  Almost all ports go
to /usr/local/.

Thanks.

Lou

QOTD:
  "I haven't come far enough, and don't call me baby."

---

From: Louis LeBlanc <[email-masked]>
Date: Fri, 10 Jan 2003 23:59:43 -0500

Time to snip this thread down . . . 

I did notice one thing.  Some of the sample menus use "Exec exec
<program>", where some use just "Exec <program>".  I have always just
used the latter.  If I change the xterm calls to the former (Exec
exec) then I don't get the abort trap entry in the stderr catch file.
I still don't get the terminal, mind you, but it's a change.  Maybe
that will help?

Thanks
Lou

"What I've done, of course, is total garbage."
    -- R. Willard, Pure Math 430a
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Fri, 10 Jan 2003 23:59:53 -0500

> execve("/bin/sh", ["/bin/sh", "/usr/X11R6/bin/xterm"], [/* 19 vars */]) = 0
...
> write(2, "/usr/X11R6/bin/xterm: Can\'t open"..., 73/usr/X11R6/bin/xterm: Can'
> t open /usr/X11R6/bin/xterm: Permission denied) = 73
> exit(2)                                 = ?
> -bash-2.05b$ 
> 

You're reading the strace wrong.  Its not writing, it
is trying to open the file for read.

The permissions don't allow read.

As root run the following command:

chmod a+r /usr/X11R6/bin/xterm

Then you should be back in business.

---

From: Ben Winslow <[email-masked]>
Date: Sat, 11 Jan 2003 01:43:01 -0500

> Louis LeBlanc <[email-masked]> writes:
[snip]

> Then you should be back in business.

Actually, this isn't the problem.  The commandline he used makes bash
try to interpret xterm as a shell script (which is why it was open()ing it.)

A better example would be /usr/local/bin/bash -c /usr/X11R6/bin/xterm

-- 
Ben

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 11 Jan 2003 06:46:27 +0000

> > > strace -f /bin/sh /usr/X11R6/bin/xterm 2>/tmp/strace.out

This is incorrect command, the correct one is:

  strace -f /bin/sh -c /usr/X11R6/bin/xterm

The one without "-c" will try to execute a file as a shell script
instead of binary, so it should read it first, for binary read permission
are not needed, just executable permissions.

> Then you should be back in business.

I don't think so, there will be another error message then if
you try "sh xterm" without -c.

I would think the original problem is in bash.

Regards,
Mikhael.

---

From: Louis LeBlanc <[email-masked]>
Date: Sat, 11 Jan 2003 09:13:03 -0500

> A better example would be /usr/local/bin/bash -c /usr/X11R6/bin/xterm

That one opens the xterm ok.

I don't know if it makes any difference, but any other program I try
opening from the menu seems ok.  So long as it doesn't need an xterm
to run.  Any ideas?

Here's a sample of a problematic menu entry:
# Networking/Mail
AddToMenu "Mail" "Mail" Title 
+ "&Netscape Messenger" Exec /usr/local/bin/netscape +messenger
+ "&Mutt"               Exec /usr/X11R6/bin/xterm -tn xterm-color -T
"mutt" +sb -ls -fn 10x20 -geometry 125x47+1+1 -e mutt
+ "&Gbuffy"             Exec /usr/X11R6/bin/gbuffy

Netscape and gbuffy start fine, but mutt won't.  I even tried the
"Exec exec <command>" form, but no good.

Any other ideas?  Where could that Abort Trap be coming from?

Lou

Captain's Log, star date 21:34.5...

---

From: Dan Espen <[email-masked]>
Date: Sat, 11 Jan 2003 09:57:25 -0500

> Any other ideas?  Where could that Abort Trap be coming from?

Well, even though I'm not right all the time,  I think
I can keep coming up with ideas.

I suppose plain:

+ "xterm" Exec /usr/X11R6/bin/xterm

doesn't work either?

The abort is supposed to cause a core dump.
Do you have ulimit set to allow core dumps?

Do you have a core file?
If so, do "file core".

You could also try running the strace from a menu:

+ "xterm" Exec strace -f /usr/X11R6/bin/xterm 2>/tmp/strace.out

---

From: Louis LeBlanc <[email-masked]>
Date: Sat, 11 Jan 2003 10:45:57 -0500

> + "xterm" Exec strace -f /usr/X11R6/bin/xterm 2>/tmp/strace.out

Problem solved.  Turns out something went south in my latest update,
and my /dev/null wound up with the wrong permissions.  When fvwm tries
to execute a command that has output from the menu, apparently it
redirects to /dev/null, and fails if there is any error.  When it
couldn't write to /dev/null, it refused to start the process.

So, now we know.  It wasn't fvwm, or xterm, but an update script for
an OS upgrade that hosed me.

Thanks for your time!

Lou

IBM Pollyanna Principle:
  Machines should work.  People should think.

---

From: Dan Espen <[email-masked]>
Date: Sat, 11 Jan 2003 10:56:15 -0500

> couldn't write to /dev/null, it refused to start the process.

I don't see any redirection like that.

> an OS upgrade that hosed me.

I'm curious.  How did you find it?
What was doing the abort?

---

From: Louis LeBlanc <[email-masked]>
Date: Sat, 11 Jan 2003 15:17:23 -0500

> I don't see any redirection like that.

It's probably an implicit redirection.

> What was doing the abort?

I tried running the fvwm24_convert scripts on my old configs just to
see if I was still using something that has been deprecated.  Turns
out it was doing some kind of redirection as well.  It turned up an
error 'Cannot create /dev/null: Permission denied'.  Turns out
/dev/null had permissions set to 0600, meaning no one but root could
throw anything in the black hole.  chmod 666 quickly fixed that, and
everything else started working again.  Turns out the MAKEDEV script
goofed up the permissions.  I couldn't begin to tell you why.  I
checked the script and it has the correct permissions.  It's one of
those things that is funny if it's happening to someone else.

Thanks for the help.  Maybe the next person that suddenly loses the
shell execs will be easier to help.

Lou

Wilcox's Law:
  A pat on the back is only a few centimeters from a kick in the pants.