Bug 118530 - newt calls Gpm_Close() even if Gpm_Open() failed
newt calls Gpm_Close() even if Gpm_Open() failed
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: newt (Show other bugs)
rawhide
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Eido INOUE
David Lawrence
:
Depends On:
Blocks: FC2Blocker FC3Target
  Show dependency treegraph
 
Reported: 2004-03-17 09:37 EST by Andreas Hasenack
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version: 0.51.6-5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-15 11:19:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Andreas Hasenack 2004-03-17 09:37:43 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040315 Firefox/0.8

Description of problem:
Authconfig segfaults when selecting NIS and ypbind is not installed.
It warns the user about the ypbind requirement but, when one selects
"next", it just segfaults.

Version-Release number of selected component (if applicable):
4.6-1

How reproducible:
Always

Steps to Reproduce:
1. Remove ypbind
2. start authconfig and select NIS. It warns that the ypbind package
is necessary. Click ok.
3. Go to the next screen. It segfaults.

It actually doesn't matter if one chooses NIS, it could also be
kerberos5, as long as a required package is not installed and the newt
callback function is called.

Actual Results:  authconfig segfaults when exiting the first screen in
an attempt to go to the next one.

Expected Results:  It shouldn't segfault.

Additional info:
Comment 1 Andreas Hasenack 2004-04-26 16:56:03 EDT
Problem persists with authconfig-4.6.2-1
Comment 2 Nalin Dahyabhai 2004-05-07 17:32:25 EDT
Unable to reproduce this with test 2 (20040325) or current Raw Hide. 
If you can still reproduce this with Raw Hide, please add a stack
trace to this report.  Meantime, marking worksforme.
Comment 3 Andreas Hasenack 2004-05-10 10:09:36 EDT
with authconfig-4.6.2-1 and newt-0.51.6:
Program received signal SIGSEGV, Segmentation fault.        
mqqqqqqqqqqj                  mqqqqqqqqqj           x                
                                   
0x400afda0 in Gpm_Close () at form.c:326           x                 
                                           x                         
                          
326           next=gpm_stack->next;                x                 
                                           x                         
                          
(gdb) bt                                          
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj      
                                             
#0  0x400afda0 in Gpm_Close () at form.c:326                         
                                                                     
                          
#1  0x400b104a in newtFormRun (co=0x808b890, es=0xbfffe7e0) at
form.c:1066                                                          
                                 
#2  0x400b0a5c in newtRunForm (co=0x808b890) at form.c:816           
                                                                     
                          
#3  0x0804cf2d in getMainChoices (back=0, nisAvail=0, ldapAvail=0,
kerberosAvail=0, smbAvail=0, cacheAvail=0, authInfo=0x8083e00) at
authconfig.c:704                 
#4  0x0804d096 in getChoices (back=0, nisAvail=0, ldapAvail=0,
kerberosAvail=0, smbAvail=0, cacheAvail=0, authInfo=0x8083e00) at
authconfig.c:736                     
#5  0x0804f9f8 in main (argc=0, argv=0x0) at authconfig.c:1249       
                                                                     
                          
(gdb) frame 0                                                        
                                                                     
                          
#0  0x400afda0 in Gpm_Close () at form.c:326ço> seleciona   |  <F12>
próxima tela                                                         
                           
326           next=gpm_stack->next;
(gdb) p gpm_stack->next
Cannot access memory at address 0x10
(gdb) p gpm_stack
$2 = (Gpm_Stst *) 0x0
Comment 4 Andreas Hasenack 2004-05-10 10:53:16 EDT
I couldn't reproduce this in fedora core 2 test3, however. I'll check
version numbers and patches for the relevant programs and libs.
Comment 5 Andreas Hasenack 2004-05-10 11:51:39 EDT
I added this quick patch and it stopped segfaulting. Not sure yet if
it's the right way, I'm not familiar with this code:
--- newt-0.51.6/form.c~ 2003-01-04 17:15:25.000000000 -0200
+++ newt-0.51.6/form.c  2004-05-10 12:45:06.532824552 -0300
@@ -893,6 +893,7 @@
     struct timeval nextTimeout, now, timeout;
 #ifdef USE_GPM
     int x, y;
+   int success;
     Gpm_Connect conn;
     Gpm_Event event;

@@ -902,7 +903,7 @@
     conn.minMod      = 0;
     conn.maxMod      = 0;

-    Gpm_Open(&conn, 0);
+    success = Gpm_Open(&conn, 0);
 #endif

     newtFormSetSize(co);
@@ -1062,6 +1063,7 @@
     }
     newtRefresh();
 #ifdef USE_GPM
+   if (success > 0)
     Gpm_Close();
 #endif
 }
Comment 6 Nalin Dahyabhai 2004-05-10 17:06:06 EDT
If that affects it, then I'm really confused.  AFAIK newt's gpm code
isn't even compiled in.  Cc'ing Adrian, the current newt maintainer.
Comment 7 Andreas Hasenack 2004-05-10 17:10:18 EDT
Uhh, I guess I was not clear enough. My newt build explicitly enables
gpm support. Anyway, changing component to newt, nothing to do with
authconfig indeed.
Comment 8 Eido INOUE 2004-05-10 21:47:47 EDT
the most recent build of gpm changes the way Gpm_Open() returns. Have
you tested the pkg in the latest rawhide?
Comment 9 Eido INOUE 2004-05-10 21:52:36 EDT
rechanging the component-- obviously newt needs to check the return
value of Gpm_Open() so it doesn't try to close a non-existant handle

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