Bug 47125 - lokkit dies with SIGFPE + typo
lokkit dies with SIGFPE + typo
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gnome-lokkit (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-03 08:31 EDT by Pekka Pietikäinen
Modified: 2014-03-16 22:21 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-09 04:39:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Pekka Pietikäinen 2001-07-03 08:31:53 EDT
Description of Problem:

When choosing "Customize" in the newt-based interface the program
dies with a SIGFPE (might be a newt problem, but I filed under
lokkit, because that's where the problem appears)

Also I noticed the text "Allow incoming telnet accesss" (sic) in the
gnome version.

How Reproducible:

Steps to Reproduce:
1. Start lokkit
2. Choose Customize

Actual Results:

Dies with SIGFPE

Expected Results:

Does not die from a SIGFPE 

Additional Information:
	Program received signal SIGFPE, Arithmetic exception.                  
0x4002d752 in newtGridSetField () at eval.c:41                         
41
eval.c: No such file or directory.                             
	in eval.c                    

#0  0x4002d752 in newtGridSetField () at eval.c:41
#1  0x4002da19 in newtGridSetField () at eval.c:41
#2  0x4002dbc2 in newtGridSetField () at eval.c:41
#3  0x4002dbc2 in newtGridSetField () at eval.c:41
#4  0x4002dd92 in newtGridGetSize () at eval.c:41
#5  0x4002dddf in newtGridWrappedWindow () at eval.c:41
#6  0x0804a4d6 in readdir () at ../sysdeps/unix/readdir.c:40
#7  0x0804ad25 in readdir () at ../sysdeps/unix/readdir.c:40
#8  0x400b25d7 in __libc_start_main (main=0x804a760 <readdir+5292>, argc=1, 
    ubp_av=0xbffffb14, init=0x8048ebc <_init>, fini=0x804b360 <_fini>, 
    rtld_fini=0x4000c754 <_dl_fini>, stack_end=0xbffffb0c)
    at ../sysdeps/generic/libc-start.c:129
Comment 1 Bill Nottingham 2001-07-05 23:31:38 EDT
What network interfaces do you have configured?
Comment 2 Bill Nottingham 2001-07-05 23:32:56 EDT
(typo fixed in gnome cvs)
Comment 3 Pekka Pietikäinen 2001-07-06 06:04:44 EDT
Two ethernet interfaces, eth0 a eepro100 and eth1 a acenic (eth1 not 
configured, though)

Here's another backtrace, this time with -g for lokkit:

Program received signal SIGFPE, Arithmetic exception.                  
0x40032183 in distSpace (extra=0, items=0, list=0xbffff490) at grid.c:71
71	    all = extra / items;                                       
(gdb) bt                                                               
#0  0x40032183 in distSpace (extra=0, items=0, list=0xbffff490) at grid.c:71
#1  0x4003251d in shuffleGrid (grid=0x804f8c8, left=17, top=5, set=1)
    at grid.c:152
#2  0x40032777 in shuffleGrid (grid=0x804f128, left=0, top=5, set=1)ext
screen      at grid.c:199
#3  0x40032777 in shuffleGrid (grid=0x8053208, left=0, top=0, set=1)
    at grid.c:199
#4  0x40032906 in newtGridGetSize (grid=0x8053208, width=0xbffff650, 
    height=0xbffff64c) at grid.c:236
#5  0x40032951 in newtGridWrappedWindow (grid=0x8053208, 
    title=0x804d5a0 "Firewall Configuration - Customize") at grid.c:246
#6  0x0804a3de in runInterface () at newt.c:522
#7  0x0804abbd in main (argc=1, argv=0xbffffa94) at newt.c:671
#8  0x400b85d7 in __libc_start_main (main=0x804a650 <main>, argc=1, 
    ubp_av=0xbffffa94, init=0x8048e98 <_init>, fini=0x804b430 <_fini>, 
    rtld_fini=0x4000c754 <_dl_fini>, stack_end=0xbffffa8c)
    at ../sysdeps/generic/libc-start.c:129

So there you have it, division by zero in libnewt :)
Comment 4 Bill Nottingham 2001-07-09 00:47:50 EDT
what language, and what terminal size?

If you break at newt.c line 338 or so, what's numdevices set to?
Comment 5 Pekka Pietikäinen 2001-07-09 04:39:41 EDT
Umn... 0, and no surprise since I didn't have a ifcfg-eth0 
in /etc/sysconfig/network-scripts (I assumed the thing used
/proc/net/dev, the gnome version does)

Here's a patch that makes things work even if there are no configured
interfaces in /etc/sysconfig/network-scripts.

--- newt.c.orig	Mon Jul  9 08:37:39 2001
+++ newt.c	Mon Jul  9 08:37:51 2001
@@ -54,7 +54,10 @@
 		qsort((void *)ret, num, sizeof(char *), 
 		      (int (*)(const void *, const void *))strcmp);
 	}
-	return ret;
+	if(!num)
+		return NULL;
+	else
+		return ret;
 }
 
 void helpCallback(newtComponent co, void * tag) {

Comment 6 Bill Nottingham 2001-07-09 11:21:23 EDT
Fixed in gnome-lokkit-0.50-0.2; thanks!

Note You need to log in before you can comment on or make changes to this bug.