64Bit cores in 32Bit Container

mvz_joe

New Member
May 31, 2011
3
0
1
We're experiencing some weird behaviour in our 32-Bit Ubuntu 10.04 Containers.

We run a legacy application written in C inside those containers. If one of the programs segfaults (or is killed with signal 11), the resulting core dump cannot be used in gdb: ["core" is not a core dump: File format not recognized]. "file core" says [ELF 64-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from 'p00'].

Running the same programs on an identical physical installation of 32-Bit Ubuntu 10.04 produces core files which can be used with gdb. Those cores are [ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, SVR4-style, from 'p00'] as I would expect on a 32-Bit system.

Is there a known issue which causes cores to be 64-Bit in a 32-Bit container? Any help would be appreciated.

Thanks a lot!

-joe-

[EDIT]
pveversion -v:
Code:
pve-manager: 1.8-17 (pve-manager/1.8/5948)
running kernel: 2.6.32-4-pve
proxmox-ve-2.6.32: 1.8-32
pve-kernel-2.6.32-4-pve: 2.6.32-32
qemu-server: 1.1-30
pve-firmware: 1.0-11
libpve-storage-perl: 1.0-17
vncterm: 0.9-2
vzctl: 3.0.26-1pve4
vzdump: 1.2-11
vzprocps: 2.0.11-2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.14.0-3
ksm-control-daemon: 1.0-5
[/EDIT]
 
Last edited:
Is there a known issue which causes cores to be 64-Bit in a 32-Bit container? Any help would be appreciated.

Well, the kernel is 64bit, so I guess that works this way. But you better ask such questions on the OpenVZ mailing list. Maybe it is just a bug.
 
Thanks for the fast response.

I did some more digging on our development VM today. Maybe someone else runs into the same issue, so I'll document my findings here.

From what I was able to reproduce today, it looks like this, when running a 32-Bit program inside a 32-Bit Container:
* You get a 64-Bit core, if process' PPID is 1 [init]
* You get a 32-Bit core, if process' PPID is !=1 (e.g. sshd -> bash -> process)

So, basically, to get 32-Bit cores from daemons, you have to make sure, that they don't attach to init, but have some 32-Bit process between them and init. e.g. you could program a tiny "executor" which attaches to init and uses system() to start the respective process.

-joe-