Bug 483167 - db2ldif -s "" crashes with segmentation fault.
Summary: db2ldif -s "" crashes with segmentation fault.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Database - Import/Export
Version: 1.1.3
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Noriko Hosoi
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks: 249650 FDS1.2.0
TreeView+ depends on / blocked
 
Reported: 2009-01-29 22:33 UTC by Noriko Hosoi
Modified: 2015-01-04 23:36 UTC (History)
3 users (show)

Fixed In Version: 8.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-29 23:09:57 UTC
Embargoed:


Attachments (Terms of Use)
cvs diff ldap/servers/slapd/main.c (869 bytes, patch)
2009-01-29 22:37 UTC, Noriko Hosoi
no flags Details | Diff
cvs diff message (562 bytes, text/plain)
2009-01-31 00:06 UTC, Noriko Hosoi
no flags Details

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


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