Menu

#185 core dump - some code-paths do not return a malloced string in get_device_name when built with --disable-blkid

None
open
core dump (1)
5
2025-05-09
2025-05-07
Todd
No

Fedora 41
dump-0.4-0.59.b52.fc41.x86_64

/usr/sbin/dump -0a -z -f /lin-bak/2025-05-07_rootExt4Dump.gz /
free(): invalid pointer
/home/linuxutil/backup-rn6: line 640: 28450 Aborted (core dumped) /usr/sbin/dump -0a -z -f /lin-bak/2025-05-07_rootExt4Dump.gz /

/usr/sbin/dump -0a -z -f /lin-bak/2025-05-07_bootExt4Dump.gz /boot
free(): invalid pointer
/home/linuxutil/backup-rn6: line 650: 28464 Aborted (core dumped) /usr/sbin/dump -0a -z -f /lin-bak/2025-05-07_bootExt4Dump.gz /boot

Let me know what data I can collect for you.

Discussion

  • Tim Woodall

    Tim Woodall - 2025-05-08

    :-(

    There is a bug, sadly, triggered by my valgrind fixes, but there's an easy fix for this that doesn't require any code changes:

    root@dirac:/mnt/nobackup/rinse/fedora-40/root/rpmbuild# diff -u dump.spec.orig dump.spec
    --- dump.spec.orig      2025-05-04 01:00:00.000000000 +0100
    +++ dump.spec   2025-05-08 08:25:49.843062966 +0100
    @@ -14,6 +14,7 @@
     BuildRequires: device-mapper-devel, libselinux-devel
     BuildRequires: lzo-minilzo
     BuildRequires: lzo-devel, libtool
    +BuildRequires: libblkid-devel
     # This Requires is now mandatory because we need to ensure the "disk"
     # group is created before installation (#60461)
     Requires:      setup
    

    FWIW, while I haven't thought about it properly yet, the "fix" for this issue will likely be removing the support for building without libblkid so if you wait for 0.4b53 it's a reasonable guess that this change will be required anyway.

    root@dirac:~/rpmbuild# dnf install RPMS/x86_64/dump-0.4-0.59.b52.fc40.x86_64.rpm 
    Failed to set locale, defaulting to C.UTF-8
    Last metadata expiration check: 0:50:56 ago on Thu May  8 06:34:20 2025.
    Dependencies resolved.
    =========================================================================================================================================================================================================================
     Package                                       Architecture                                    Version                                                       Repository                                             Size
    =========================================================================================================================================================================================================================
    Installing:
     dump                                          x86_64                                          1:0.4-0.59.b52.fc40                                           @commandline                                          155 k
    Installing dependencies:
     rmt                                           x86_64                                          2:1.6-14.fc40                                                 updates                                                47 k
    
    Transaction Summary
    =========================================================================================================================================================================================================================
    Install  2 Packages
    
    Total size: 202 k
    Total download size: 47 k
    Installed size: 432 k
    Is this ok [y/N]: y
    Downloading Packages:
    rmt-1.6-14.fc40.x86_64.rpm                                                                                                                                                               151 kB/s |  47 kB     00:00    
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                                                                                                     68 kB/s |  47 kB     00:00     
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Preparing        :                                                                                                                                                                                                 1/1 
      Installing       : rmt-2:1.6-14.fc40.x86_64                                                                                                                                                                        1/2 
      Installing       : dump-1:0.4-0.59.b52.fc40.x86_64                                                                                                                                                                 2/2 
      Running scriptlet: dump-1:0.4-0.59.b52.fc40.x86_64                                                                                                                                                                 2/2 
    
    Installed:
      dump-1:0.4-0.59.b52.fc40.x86_64                                                                                rmt-2:1.6-14.fc40.x86_64                                                                               
    
    Complete!
    root@dirac:~/rpmbuild# /sbin/dump -0a -z -f /tmp/x /dev/vg-dirac/boot-tjw 
      DUMP: Can't open /etc/fstab for dump table information: No such file or directory
      DUMP: Date of this level 0 dump: Thu May  8 07:25:20 2025
      DUMP: Dumping /dev/vg-dirac/boot-tjw (an unlisted file system) to /tmp/x
      DUMP: Label: none
      DUMP: Writing 10 Kilobyte records
      DUMP: Compressing output at transformation level 2 (zlib)
      DUMP: mapping (Pass I) [regular files]
      DUMP: mapping (Pass II) [directories]
      DUMP: estimated 72836 blocks.
      DUMP: Volume 1 started with block 1 at: Thu May  8 07:25:20 2025
      DUMP: dumping (Pass III) [directories]
      DUMP: dumping (Pass IV) [regular files]
      DUMP: Closing /tmp/x
      DUMP: Volume 1 completed at: Thu May  8 07:25:22 2025
      DUMP: Volume 1 took 0:00:02
      DUMP: Volume 1 transfer rate: 31799 kB/s
      DUMP: Volume 1 72620kB uncompressed, 63598kB compressed, 1.142:1
      DUMP: 72620 blocks (70.92MB) on 1 volume(s)
      DUMP: finished in 2 seconds, throughput 36310 kBytes/sec
      DUMP: Date of this level 0 dump: Thu May  8 07:25:20 2025
      DUMP: Date this dump completed:  Thu May  8 07:25:22 2025
      DUMP: Average transfer rate: 31799 kB/s
      DUMP: Wrote 72620kB uncompressed, 63598kB compressed, 1.142:1
      DUMP: DUMP IS DONE
    root@dirac:~/rpmbuild# restore -C -D /mnt -f /tmp/x
    Dump tape is compressed.
    Dump   date: Thu May  8 07:25:20 2025
    Dumped from: the epoch
    Level 0 dump of an unlisted file system on dirac.home.woodall.me.uk:/dev/vg-dirac/boot-tjw
    Label: none
    filesys = /mnt
    

    still running in a chroot on a debian kernel but it passes a basic sanity check

     
  • Tim Woodall

    Tim Woodall - 2025-05-08
    • summary: core dump --> core dump - some code-paths do not return a malloced string in get_device_name when built with --disable-blkid
    • assigned_to: Tim Woodall
     
  • Todd

    Todd - 2025-05-08

    I am confused. How do I get my hands on the good code?

     
  • Tim Woodall

    Tim Woodall - 2025-05-08

    The code is the same. All that is required is that the libblkid-devel package is installed before it is built. The most likely "fix" will be to stop it building if this package isn't installed.

    The diff I posted above just adds BuildRequires: libblkid-devel to the spec file which forces this to be installed before running configure

     
  • Todd

    Todd - 2025-05-08

    Thank you!!!

    Will you be uploading the good ones to the Fedora repo's? Dnf update will overwrite the good ones otherwise

     

    Last edit: Todd 2025-05-08
  • Tim Woodall

    Tim Woodall - 2025-05-08

    It doesn't seem to be overwritten by dnf upgrade (although I don't know how to do the equivalent of apt-cache policy dump in rpm world). But no I won't be uploading to the Fedora repos, I know almost nothing about fedora and I assume if I could upload it then so could you, but I have absolutely no idea if what I've done to the spec file is appropriate nor how to upload even if I can.

     
    • Todd

      Todd - 2025-05-09

      It doesn't seem to be overwritten by dnf upgrade

      I just verified it myself. I also verified you have to remove to old one to upgrade to the one you posted.

       
  • Tim Woodall

    Tim Woodall - 2025-05-08

    I've emailed the fedora maintainer to ask if he can do another release with an updated spec file that will fix this issue.

     

Log in to post a comment.