RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1113065 - supermin: exception: Out of memory
Summary: supermin: exception: Out of memory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: supermin
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1099172
Blocks: 1021150 1288337 1301891
TreeView+ depends on / blocked
 
Reported: 2014-06-25 11:32 UTC by Richard W.M. Jones
Modified: 2016-11-03 23:03 UTC (History)
8 users (show)

Fixed In Version: supermin-5.1.16-4.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1099172
Environment:
Last Closed: 2016-11-03 23:03:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:2154 0 normal SHIPPED_LIVE supermin bug fix update 2016-11-03 13:13:19 UTC

Description Richard W.M. Jones 2014-06-25 11:32:47 UTC
+++ This bug was initially created as a clone of Bug #1099172 +++

Description of problem:

(Reported by Stef Walter)

mkdir -p ~/.guestfs-1000
/usr/bin/supermin --build --verbose --if-newer --lock ~/.guestfs-1000/lock --copy-kernel -f ext2 --host-cpu x86_64 /usr/lib64/guestfs/supermin.d -o ~/.guestfs-1000/appliance.d

fails with the error:

supermin: exception: Out of memory

I asked Stef to use -v -v -v, and the end of the output is:

  - /var/lib/systemd/coredump
  - /var/lib/systemd/random-seed
  - /var/lib/tpm
  - /var/local
  - /var/lock
  - /var/log
  - /var/log/README
  - /var/log/journal
  - /var/log/lastlog
  - /var/log/tallylog
  - /var/spool
  - /var/spool/mail
  - /var/mail
  - /var/nis
  - /var/opt
  - /var/preserve
  - /var/run
  - /var/run/console
  - /var/run/dbus
  - /var/run/faillock
  - /var/run/mdadm
  - /var/run/sepermit
  - /var/run/setrans
  - /var/spool
  - /var/spool/lpd
  - /var/spool/mail
  - /var/tmp
  - /var/yp
supermin: kernel: picked kernel vmlinuz-3.14.4-200.fc20.x86_64
supermin: kernel: picked modules path /lib/modules/3.14.4-200.fc20.x86_64
supermin: kernel: kernel_version 3.14.4-200.fc20.x86_64
supermin: kernel: modules /lib/modules/3.14.4-200.fc20.x86_64
supermin: ext2: creating empty ext2 filesystem '/data/.guestfs-1000/appliance.d.ci1uy50n/root'
mke2fs 1.42.8 (20-Jun-2013)
Discarding device blocks: done                            
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
262144 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done 

supermin: ext2: populating from base image
supermin: ext2: copying files from host filesystem
supermin: exception: Out of memory

It turns out the exception is raised from C code:

/* Read in the whole file into memory.  Check the size is still 'size'. */
static char *
read_whole_file (const char *filename, size_t size)
{
  char *buf = malloc (size);
  if (buf == NULL)
    caml_raise_out_of_memory ();

/var/log/lastlog (in this case) was a huge file which caused
the out of memory error.

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

supermin 5.1.7

Comment 3 Richard W.M. Jones 2014-07-21 07:19:22 UTC
Yes, that's bug 1021150.

Also there are preview packages available:

https://www.redhat.com/archives/libguestfs/2014-May/msg00090.html

Comment 7 Richard W.M. Jones 2015-04-16 14:05:46 UTC
Move to RHEL 7.3 (cannot do 7.2 as not on the ACL).

Comment 8 Richard W.M. Jones 2016-07-06 11:30:07 UTC
Patch posted:
https://www.redhat.com/archives/libguestfs/2016-July/msg00014.html

Comment 10 Xianghua Chen 2016-07-21 03:15:27 UTC
Verified with the packages:
libguestfs-1.32.6-1.el7.x86_64

Verify steps:
# mkdir -p ~/.guestfs-1000
# supermin5 --build --verbose --if-newer --lock ~/.guestfs-1000/lock --copy-kernel -f ext2 --host-cpu x86_64 /usr/lib64/guestfs/supermin.d -o ~/.guestfs-1000/appliance.d
... ...
supermin: ext2: creating empty ext2 filesystem '/root/.guestfs-1000/appliance.d.r40z5zco/root'
supermin: ext2: populating from base image
supermin: ext2: copying files from host filesystem
supermin: ext2: copying kernel modules
supermin: ext2: creating minimal initrd '/root/.guestfs-1000/appliance.d.r40z5zco/initrd'
supermin: ext2: wrote 27 modules to minimal initrd
supermin: renaming /root/.guestfs-1000/appliance.d.r40z5zco to /root/.guestfs-1000/appliance.d


No error occurred.

So verified.

Comment 12 errata-xmlrpc 2016-11-03 23:03:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-2154.html


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