I can confirm that this bug still exists in the current qemu master (short commit ID 0050f9978e):
~/qemu$ gcc -m32 shm_bug.c -o shm_bug32
shm_bug.c: In function ‘main’:
shm_bug.c:12:24: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
const void *at = 0x7f7df38ea000; ^~~~~~~~~~~~~~
~/qemu$ i386-linux-user/qemu-i386 ./shm_bug32
got err 0, ptr 0xffffffff
ari@ari-thinkpad:~/qemu$ gcc shm_bug.c -o shm_bug64
shm_bug.c: In function ‘main’:
shm_bug.c:12:24: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
const void *at = 0x7f7df38ea000; ^~~~~~~~~~~~~~
~/qemu$ x86_64-linux-user/qemu-x86_64 ./shm_bug64
got err 0, ptr 0x7f7df38ea000
ari@ari-thinkpad:~/qemu$
Additionally, running each executable directly on a 64-bit Ubuntu 18.04 system, we can see that the behavior of the 32-bit binary differs between qemu-i386 and native, while that of the 64-bit binary does not:
I can confirm that this bug still exists in the current qemu master (short commit ID 0050f9978e):
~/qemu$ gcc -m32 shm_bug.c -o shm_bug32
^~~~ ~~~~~~~ ~~~ user/qemu- i386 ./shm_bug32 thinkpad: ~/qemu$ gcc shm_bug.c -o shm_bug64
^~~~ ~~~~~~~ ~~~ linux-user/ qemu-x86_ 64 ./shm_bug64 thinkpad: ~/qemu$
shm_bug.c: In function ‘main’:
shm_bug.c:12:24: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
const void *at = 0x7f7df38ea000;
~/qemu$ i386-linux-
got err 0, ptr 0xffffffff
ari@ari-
shm_bug.c: In function ‘main’:
shm_bug.c:12:24: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
const void *at = 0x7f7df38ea000;
~/qemu$ x86_64-
got err 0, ptr 0x7f7df38ea000
ari@ari-
Additionally, running each executable directly on a 64-bit Ubuntu 18.04 system, we can see that the behavior of the 32-bit binary differs between qemu-i386 and native, while that of the 64-bit binary does not:
~/qemu$ ./shm_bug32
got err 0, ptr 0xf38ea000
~/qemu$ ./shm_bug64
got err 0, ptr 0x7f7df38ea000
~/qemu$