Bug 1155586 - supermin: ext2fs-c.c:584: ext2_copy_file: Assertion `n == 1 || dest[n-1] != '/'' failed.
Summary: supermin: ext2fs-c.c:584: ext2_copy_file: Assertion `n == 1 || dest[n-1] != '...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: supermin
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-22 12:40 UTC by Dr. David Alan Gilbert
Modified: 2014-12-09 19:00 UTC (History)
2 users (show)

Fixed In Version: supermin-5.1.10-2.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-25 21:53:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dr. David Alan Gilbert 2014-10-22 12:40:58 UTC
Description of problem:
Running rjones's supernested script on f21 hit this assert

Version-Release number of selected component (if applicable):
supermin-5.1.10-1.fc21.x86_64


How reproducible:
Unknown

Steps to Reproduce:
1. I'd updated the git for supernested and was just running the make
2. the line in the script that failed was:
    "$supermin" --build --format ext2 tmp-supermin.d -o tmp-appliance.d

3.

Actual results:
supermin seg'd

Expected results:
A happy supermin appliance

Additional info:
#3  0x00007f9d8483e522 in __GI___assert_fail (assertion=assertion@entry=0x45b57b "n == 1 || dest[n-1] != '/'", file=file@entry=0x45b551 "ext2fs-c.c", line=line@entry=584, 
    function=function@entry=0x45b85b <__PRETTY_FUNCTION__.8282> "ext2_copy_file") at assert.c:101
No locals.
#4  0x0000000000441132 in ext2_copy_file (src=0x1df0d58 "/usr/share/fonts/cjkuni-uming/", dest=0x1df0d58 "/usr/share/fonts/cjkuni-uming/", data=0x7fff338ee7e0, data=0x7fff338ee7e0) at ext2fs-c.c:584
        err = <optimized out>
        statbuf = {st_dev = 64770, st_ino = 1446961, st_nlink = 2, st_mode = 16877, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 4096, st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 1413978867, 
            tv_nsec = 238916148}, st_mtim = {tv_sec = 1413978867, tv_nsec = 97916521}, st_ctim = {tv_sec = 1413978867, tv_nsec = 97916521}, __glibc_reserved = {0, 0, 0}}
        statvfsbuf = {f_bsize = 4096, f_frsize = 4096, f_blocks = 47955869, f_bfree = 17872411, f_bavail = 15430632, f_files = 12189696, f_ffree = 11180829, f_favail = 11180829, f_fsid = 7694811280783634196, f_flag = 4096, 
          f_namemax = 255, __f_spare = {0, 0, 0, 0, 0, 0}}
        n = <optimized out>
        dirname = <optimized out>
        basename = <optimized out>
        p = <optimized out>
        dir_ino = 22
        dir_ft = <optimized out>
#5  0x000000000044156a in supermin_ext2fs_copy_file_from_host (fsv=32447224, srcv=31395160, destv=31395160) at ext2fs-c.c:204
        caml__frame = 0x0
        caml__roots_fsv = {next = 0x0, ntables = 3, nitems = 1, tables = {0x7fff338ee7d8, 0x7fff338ee7d0, 0x7fff338ee7c8, 0x7f9d844746b8, 0x411359 <camlPackage_handler__file_source_1108+73>}}
        src = <optimized out>
        dest = <optimized out>
        data = {fs = 0x1ec4460, debug = 0}
#6  0x0000000000409f21 in camlExt2__fun_1084 ()
No symbol table info available.
#7  0x00000000004242a1 in camlList__iter_1061 ()
No symbol table info available.
#8  0x000000000040a141 in camlExt2__build_ext2_1063 ()
No symbol table info available.
#9  0x0000000000409dd8 in camlBuild__build_1081 ()
No symbol table info available.
#10 0x0000000000407a96 in camlSupermin__main_1066 ()
No symbol table info available.
#11 0x0000000000407f1d in camlSupermin__entry ()
No symbol table info available.
#12 0x0000000000405309 in caml_program ()
No symbol table info available.
#13 0x0000000000459d7e in caml_start_program ()
No symbol table info available.
#14 0x0000000000459f1d in __libc_csu_init ()
No symbol table info available.
#15 0x00007f9d84830fe0 in __libc_start_main (main=0x404f20 <main>, argc=7, argv=0x7fff338eebb8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff338eeba8) at libc-start.c:289
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -7566010347225365384, 4214589, 140734058392496, 0, 0, 7565561639468254328, 7510640929328579704}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x459ed0 <__libc_csu_init>, 
              0x7fff338eebb8}, data = {prev = 0x0, cleanup = 0x0, canceltype = 4562640}}}
        not_first_call = <optimized out>
#16 0x0000000000404f66 in _start ()

The path /usr/share/fonts/cjkuni-uming does exist and has the uming.ttc file in

Comment 1 Richard W.M. Jones 2014-10-25 21:53:08 UTC
The reason is because the package (cjkuni-uming-fonts) has a
symlink which contains a trailing slash:

lrwxrwxrwx 1 root root 30 Jun  7 06:53 /etc/X11/fontpath.d/cjkuni-uming-fonts -> /usr/share/fonts/cjkuni-uming/

which is something I'd not considered when writing this code.

A simple reproducer of this bug is:

$ supermin --prepare -o /tmp/supermin.d cjkuni-uming-fonts
$ supermin --build -f ext2 -o /tmp/appliance.d /tmp/supermin.d
supermin: ext2fs-c.c:584: ext2_copy_file: Assertion `n == 1 || dest[n-1] != '/'' failed.
Aborted

Adding -v -v -v to that second command:

[...]
supermin: ext2: copying files from host filesystem
supermin: ext2: copy_file /usr -> /usr
supermin: ext2: copy_file /usr/bin -> /usr/bin
supermin: ext2: copy_file /bin -> /bin
supermin: ext2: copy_file /boot -> /boot
supermin: ext2: copy_file /dev -> /dev
supermin: ext2: copy_file /etc -> /etc
supermin: ext2: copy_file /etc/X11 -> /etc/X11
supermin: ext2: copy_file /etc/X11/applnk -> /etc/X11/applnk
supermin: ext2: copy_file /etc/X11/fontpath.d -> /etc/X11/fontpath.d
supermin: ext2: copy_file /usr/share -> /usr/share
supermin: ext2: copy_file /usr/share/fonts -> /usr/share/fonts
supermin: ext2: copy_file /usr/share/fonts/cjkuni-uming/ -> /usr/share/fonts/cjkuni-uming/
supermin: ext2fs-c.c:584: ext2_copy_file: Assertion `n == 1 || dest[n-1] != '/'' failed.
Aborted

Anyhow, this is fixed by the following commit:

https://github.com/libguestfs/supermin/commit/d7bb984889257f5b87963dcca6456fc6e4cc804e

Comment 2 Fedora Update System 2014-11-26 22:28:38 UTC
supermin-5.1.10-2.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/supermin-5.1.10-2.fc21

Comment 3 Fedora Update System 2014-12-06 10:14:04 UTC
supermin-5.1.10-2.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Dr. David Alan Gilbert 2014-12-09 19:00:30 UTC
Yep, seems to work.


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