Bug 4651 - Bad command line arguments cause a core dump :-(
Bad command line arguments cause a core dump :-(
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
6.0
i386 Linux
low Severity low
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-08-22 14:47 EDT by Sam Varshavchik
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-08-23 19:11:52 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 Sam Varshavchik 1999-08-22 14:47:08 EDT
[mrsam@gwl mrsam]$ rpm -q rpm
rpm-3.0.2-6.0
[mrsam@gwl mrsam]$ cat $HOME/.rpmmacros
%_topdir        /home/mrsam/src/rpm
%_pgpbin        /usr/local/bin/pgp
%_pgp_path      /home/mrsam/.pgp
%_signature     pgp
%_pgp_name      mrsam@geocities.com
[mrsam@gwl mrsam]$ ls $HOME/.pgp
config.txt  pubring.bak  randseed.bin  secring.pgp
keys.pgp    pubring.pgp  secring.bak
[mrsam@gwl mrsam]$ rpm -ba --sign
Segmentation fault (core dumped)
Comment 1 Jeff Johnson 1999-08-23 12:53:59 EDT
I cannot reproduce this bug without more information.

What argument/macro is causing the segfault?
Comment 2 Jeff Johnson 1999-08-23 12:54:59 EDT
I cannot reproduce this bug without more information.

What argument/macro is causing the segfault?
Comment 3 Anonymous 1999-08-23 17:32:59 EDT
Apparently the core dump occurs because of the -ba flag without any
actual spec file given, and both -ba and --sign must be present as
well.

rpm -ba results in an error message.

rpm --sign results in an error message.

rpm -ba --sign results in a core dump.

Tail end of strace:

open("/usr/lib/rpm/i686-linux/macros", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/etc/rpm/macros", O_RDONLY)       = -1 ENOENT (No such file or
directory)
open("/etc/rpm/i686-linux/macros", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/home/mrsam/.rpmmacros", O_RDONLY) = 3
fstat(3, {st_mode=032760, st_size=0, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40000000
read(3, "%_topdir\t/home/mrsam/src/rpm\n%"..., 4096) = 104
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40000000, 4096)                = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
Comment 4 Anonymous 1999-08-23 18:02:59 EDT
Here's why rpm is dumping core:

rpm.c, line 1125, function call to poptGetArgs

In function poptGetArgs (popt.c line 487):

   The first if statement evaluates to true, causing the function to
return NULL.

rpm.c, line 1125, argv gets set to NULL.

rpm.c, line 1126:

     while (*argv)

BOOM!!!!!!!
Comment 5 Jeff Johnson 1999-08-23 19:11:59 EDT
This will be fixed in rpm-3.0.3-0.18. Thanks for the analysis.

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