• Daniel Black's avatar
    MDEV-8743: O_CLOEXEC on innodb/xtradb temp files · bbee0253
    Daniel Black authored
    Thread 1 "mysqld" hit Breakpoint 1, innobase_mysql_tmpfile () at /home/dan/repos/mariadb-server-5.5/storage/xtradb/handler/ha_innodb.cc:1639
    1639            os_event_wait(srv_allow_writes_event);
    
    (gdb) p fd
    $2 = 7
    (gdb) n
    1682                    fd2 = fcntl(fd, F_DUPFD_CLOEXEC, 0);
    (gdb)
    1687                    if (fd2 < 0) {
    (gdb) p fd2
    $3 = 8
    
    cat /proc/20448/fdinfo/{7,8}
      2051972      0 -r--------   1  dan      dan             0 Mar  2 12:04 fdinfo/7
    pos:    0
    flags:  0100002
    mnt_id: 82
      2051973      0 -r--------   1  dan      dan             0 Mar  2 12:04 fdinfo/8
    pos:    0
    flags:  02100002
    mnt_id: 82
    
    So fd 8 has 02000000 hence CLOEXEC
    bbee0253
ha_innodb.cc 397 KB