Bug 483167

Summary: db2ldif -s "" crashes with segmentation fault.
Product: [Retired] 389 Reporter: Noriko Hosoi <nhosoi>
Component: Database - Import/ExportAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED CURRENTRELEASE QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: low    
Version: 1.1.3CC: benl, jgalipea, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-29 23:09:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 249650, 493682    
Attachments:
Description Flags
cvs diff ldap/servers/slapd/main.c
none
cvs diff message none

Description Noriko Hosoi 2009-01-29 22:33:55 UTC
Description of problem:
$ db2ldif -s ""
Program received signal SIGSEGV, Segmentation fault.
(note: this message is received in gdb)

Stack trace and debug info:
1920        for (ep = entries; *ep; ep++) {
(gdb) bt
#0  0x000000000041ee08 in lookup_instance_name_by_suffix (suffix=0x24ed350 "", 
    suffixes=0x0, instances=0x7fff86ccf5c0, isexact=0)
    at ldap/servers/slapd/main.c:1920
#1  0x000000000041ee6e in lookup_instance_name_by_suffixes (
    included=0x24ed370, excluded=0x0, instances=0x7fff86ccf868)
    at ldap/servers/slapd/main.c:1947
#2  0x000000000041f71f in slapd_exemode_db2ldif (argc=6, argv=0x7fff86ccfcd8)
    at ldap/servers/slapd/main.c:2194
#3  0x000000000041d0f8 in main (argc=6, argv=0x7fff86ccfcd8)
    at ldap/servers/slapd/main.c:939
(gdb) p entries
$1 = (Slapi_Entry **) 0x0

Comment 1 Noriko Hosoi 2009-01-29 22:37:57 UTC
Created attachment 330410 [details]
cvs diff ldap/servers/slapd/main.c

Change description: adding a check to see if there is no entries.

With the fix, the same command line fails with a clearer message.
# ./db2ldif -s ""
Exported ldif file: /var/lib/dirsrv/slapd-escape/ldif/escape-2009_01_29_102502.ldif
[29/Jan/2009:10:25:02 -0800] - ERROR 2: There is no backend instance to export from.

Comment 2 Noriko Hosoi 2009-01-31 00:06:59 UTC
Created attachment 330514 [details]
cvs diff message

Reviewed by Rich (Thank you!!)

Checked in into CVS HEAD.

Comment 3 Jenny Severance 2009-03-31 13:02:29 UTC
fix verified - DS 8.1 RHEL 5 - no Segmentation fault

[root@jennyv2 slapd-jennyv2]# ./db2ldif -s ""
Exported ldif file: /var/lib/dirsrv/slapd-jennyv2/ldif/jennyv2-2009_03_31_085615.ldif
[31/Mar/2009:08:56:15 -0400] - ERROR 2: There is no backend instance to export from.

errors log:
[31/Mar/2009:08:56:15 -0400] - ERROR 2: There is no backend instance to export from.

Comment 4 Chandrasekar Kannan 2009-04-29 23:09:57 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0455.html