Bug 356241

Summary: foremost crashes when run with verbose option
Product: [Fedora] Fedora Reporter: Karel Volný <kvolny>
Component: formostAssignee: Toshio Kuratomi <toshio>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7CC: extras-qa
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 1.5.2-2.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-12 19:52: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:

Description Karel Volný 2007-10-29 08:25:34 UTC
Description of problem:
When trying to run foremost with verbose option, it crashes on opening the 
audit file.

Version-Release number of selected component (if applicable):
foremost-1.5-1.fc7

How reproducible:
always

Steps to Reproduce:
1. in my case, run 'foremost -v -i /dev/sdb7'
  
Actual results:
Segmentation fault

Expected results:
normal operation :-)

Additional info:
This did not happen last time I used foremost (1.5) on my Gentoo box, so I 
report against Fedora rather than upstream.

# gdb --args foremost -v -i /dev/sdb7
GNU gdb Red Hat Linux (6.6-16.fc7rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) run
Starting program: /usr/bin/foremost -v -i /dev/sdb7
Foremost version 1.5 by Jesse Kornblum, Kris Kendall, and Nick Mikus

Program received signal SIGSEGV, Segmentation fault.
0x0000003a39c77160 in strlen () from /lib64/libc.so.6
(gdb) backtrace
#0  0x0000003a39c77160 in strlen () from /lib64/libc.so.6
#1  0x0000003a39c460bb in vfprintf () from /lib64/libc.so.6
#2  0x0000003a39ce4749 in __vfprintf_chk () from /lib64/libc.so.6
#3  0x00000000004036d3 in audit_msg (s=0x6cb010, format=0x40aba3 "Foremost 
version %s by %s") at state.c:193
#4  0x000000000040372a in write_audit_header (s=0x2c) at state.c:138
#5  0x00000000004038b0 in open_audit_file (s=0x6cb010) at state.c:165
#6  0x0000000000401bb2 in main (argc=4, argv=0x7fff380a8a08) at main.c:264
#7  0x0000003a39c1dab4 in __libc_start_main () from /lib64/libc.so.6
#8  0x00000000004015e9 in _start ()
(gdb) cont
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.

Comment 1 Toshio Ernie Kuratomi 2007-12-04 19:49:58 UTC
It looks like the problem is that var args handling in the audit_msg() function
is wrong.  This is only showing up on x86_64 which may be why you're not seeing
it on Gentoo.  Patch applied and building now.

Comment 2 Toshio Ernie Kuratomi 2007-12-04 23:35:09 UTC
* Patches accepted upstream.
* Bodhi should be pushing the patched version to the testing repository soon.

Comment 3 Karel Volný 2007-12-06 14:28:51 UTC
thankyou for resolving this issue

Comment 4 Fedora Update System 2007-12-06 20:53:09 UTC
foremost-1.5.2-2.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update foremost'

Comment 5 Fedora Update System 2007-12-06 20:55:56 UTC
foremost-1.5.2-2.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update foremost'

Comment 6 Fedora Update System 2007-12-12 19:52:56 UTC
foremost-1.5.2-2.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2007-12-12 19:59:16 UTC
foremost-1.5.2-2.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.