I have a situation where it seems that bash's wildcard expansion is sometimes not working in my automated build (it is similar to this question, the whole thing is running inside a chroot created inside a docker container, so there could be many reasons why this is broken (broken libc, broken shell, etc.). I tried using strace, but the result does not help me to analyze the issue.
The first line of the working case shows the expanded file-name:
$ ls /tmp/
linux-image-4.9.124.deb
$ strace ls /tmp/linux*deb
execve("/bin/ls", ["ls", "/tmp/linux-image-4.9.124"...], [/* 23 vars */]) = 0
...
And the failing case shows that the * did not get expanded:
$ ls /tmp/
linux-image-4.9.124.deb
$ strace ls /tmp/linux*deb
execve("/bin/ls", ["ls", "/tmp/linux*deb"], [/* 23 vars */]) = 0
...
set -o
shows noglob off
in both cases
How can I debug this for instance with strace/gdb or any other tool?