Skip to content

time: extra slash when opening /etc/localtime #36640

@larytet

Description

@larytet

This is a minor problem. In the trace of a golang service I see that the path to "/etc//localtime" contains two slashes. Can be a bug in my trace application or a bug in the path concatenation in the runtime. My runtime is

$ go version
go version go1.12.4 linux/amd64

Another question. How Go runtime chooses the buffer size for reading? For example, 0x10000 for the file somaxconn, but 4K for "localtime" ?

Time stamp            Syscall           PID       TID           FD        Filename
5e25b9eb.1ce74225       openat          24      12789   12789          3        "/etc/ld.so.cache"
5e25b9eb.1ce7eee7       close           34      12789   12789          3               0        "/etc/ld.so.cache"
5e25b9eb.1ce889d4       openat          24      12789   12789          3        "/lib/x86_64-linux-gnu/libpthread.so.0"
5e25b9eb.1ce8c3e2       read            37      12789   12789          3             832        00000832        "/lib/x86_64-linux-gnu/libpthread.so.0"
5e25b9eb.1ceec5bd       close           34      12789   12789          3               0        "/lib/x86_64-linux-gnu/libpthread.so.0"
5e25b9eb.1cf012be       openat          24      12789   12789          3        "/lib/x86_64-linux-gnu/libc.so.6"
5e25b9eb.1cf0805c       read            37      12789   12789          3             832        00000832        "/lib/x86_64-linux-gnu/libc.so.6"
5e25b9eb.1cf2d0f3       close           34      12789   12789          3               0        "/lib/x86_64-linux-gnu/libc.so.6"
5e25b9eb.1f91adfc       socket          03      12789   12789          3        526337  01      00
5e25b9eb.1f9245d0       close           34      12789   12789          3               0
5e25b9eb.1f92620e       socket          03      12789   12789          3        526337  01      00
5e25b9eb.1f927d5a       close           34      12789   12789          3               0
5e25b9eb.1f92d0f4       openat          24      12789   12789          3        "/etc/nsswitch.conf"
5e25b9eb.1f931329       read            37      12789   12789          3             556        00004096        "/etc/nsswitch.conf"
5e25b9eb.1f93477c       read            37      12789   12789          3               0        00004096        "/etc/nsswitch.conf"
5e25b9eb.1f934df5       close           34      12789   12789          3               0        "/etc/nsswitch.conf"
5e25b9eb.1f93714b       openat          24      12789   12789          3        "/etc/ld.so.cache"
5e25b9eb.1f9392fc       close           34      12789   12789          3               0        "/etc/ld.so.cache"
5e25b9eb.1f93c198       openat          24      12789   12789          3        "/lib/x86_64-linux-gnu/libnss_compat.so.2"
5e25b9eb.1f93d12e       read            37      12789   12789          3             832        00000832        "/lib/x86_64-linux-gnu/libnss_compat.so.2"
5e25b9eb.1f9451c8       close           34      12789   12789          3               0        "/lib/x86_64-linux-gnu/libnss_compat.so.2"
5e25b9eb.1f94df12       openat          24      12789   12789          3        "/etc/ld.so.cache"
5e25b9eb.1f94f563       close           34      12789   12789          3               0        "/etc/ld.so.cache"
5e25b9eb.1f95104f       openat          24      12789   12789          3        "/lib/x86_64-linux-gnu/libnss_nis.so.2"
5e25b9eb.1f95203b       read            37      12789   12789          3             832        00000832        "/lib/x86_64-linux-gnu/libnss_nis.so.2"
5e25b9eb.1f957860       close           34      12789   12789          3               0        "/lib/x86_64-linux-gnu/libnss_nis.so.2"
5e25b9eb.1f95a188       openat          24      12789   12789          3        "/lib/x86_64-linux-gnu/libnsl.so.1"
5e25b9eb.1f95b05f       read            37      12789   12789          3             832        00000832        "/lib/x86_64-linux-gnu/libnsl.so.1"
5e25b9eb.1f9610f7       close           34      12789   12789          3               0        "/lib/x86_64-linux-gnu/libnsl.so.1"
5e25b9eb.1f963a0b       openat          24      12789   12789          3        "/lib/x86_64-linux-gnu/libnss_files.so.2"
5e25b9eb.1f96483b       read            37      12789   12789          3             832        00000832        "/lib/x86_64-linux-gnu/libnss_files.so.2"
5e25b9eb.1f969f1f       close           34      12789   12789          3               0        "/lib/x86_64-linux-gnu/libnss_files.so.2"
5e25b9eb.1f976222       openat          24      12789   12789          3        "/etc/passwd"
5e25b9eb.1f97c2d3       close           34      12789   12789          3               0        "/etc/passwd"
5e25b9eb.1f9f059a       write           36      12789   12789          1              34        00000034        /dev/pts/3
5e25b9eb.1fa617f4       openat          24      12789   12789          3        "/etc//localtime"
5e25b9eb.1fa646cb       read            37      12789   12789          3            2265        00004096        "/etc//localtime"
5e25b9eb.1fa660bc       read            37      12789   12789          3               0        00004096        "/etc//localtime"
5e25b9eb.1fa669b7       close           34      12789   12789          3               0        "/etc//localtime"
5e25b9eb.1fa74945       write           36      12789   12789          2              73        00000073        /dev/pts/3
5e25b9eb.1fb2bdcc       socket          03      12789   12789          3        526337  02      06
5e25b9eb.1fb30a30       close           34      12789   12789          3               0
5e25b9eb.1fb3320e       socket          03      12789   12789          3        526337  10      06
5e25b9eb.1fb4879a       bind            06      12789   12789          3        0000
5e25b9eb.1fb49d64       socket          03      12789   12789          4        526337  10      06
5e25b9eb.1fb4c2ad       bind            06      12789   12789          4        0000
5e25b9eb.1fb4d180       close           34      12789   12789          4               0
5e25b9eb.1fb4e700       close           34      12789   12789          3               0
5e25b9eb.1fb4f28e       socket          03      12789   12789          3        526337  10      00
5e25b9eb.1fb6a89b       openat          24      12789   12789          4        "/proc/sys/net/core/somaxconn"
5e25b9eb.1fbe215c       read            37      12789   12789          4               4        00065536        "/proc/sys/net/core/somaxconn"
5e25b9eb.1fbe4ab3       read            37      12789   12789          4               0        00065532        "/proc/sys/net/core/somaxconn"
5e25b9eb.1fbe5f21       close           34      12789   12789          4               0        "/proc/sys/net/core/somaxconn"
5e25b9eb.1fbf7fb6       bind            06      12789   12789          3        8080

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions