Re: Program not being executed at all



On Sat, Dec 30, 2006 at 06:12:01PM -0300, Alejandro Pulver wrote:
On Sat, 30 Dec 2006 16:31:03 +0200
Kostik Belousov <kostikbel@xxxxxxxxx> wrote:

[...]
Interestingly 'ldd' also crashes when examining it, outputting the
following (however 'ktrace' has more information):

/usr/local/bin/quake2max:
/usr/local/bin/quake2max: signal 6

[...]
Please, show the output of the commands
file /usr/local/bin/quake2max
readelf -ld /usr/local/bin/quake2max

[...]
Signal 6 is sent by elf image activator upon exec() when old address space
is destroyed, but new image cannot be loaded. In your case, I guess that
extra large bss section size (where uninitialized global/static variables
are placed) causes loader to fail:

Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x073000 0x080bb000 0x080bb000 0x02cc4 0x28a20e34 RW 0x1000

Look at MemSiz column. VirtAddr + MemSiz >= 0x30000000, and elf interpreter
(/libexec/ld-elf.so.1) is usually mmapped at 0x28000000.

Look at the source for huge global arrays/objects.

Hello.

Thank you very much for your help, I have found the array; see below.

I searched the diff for increments in the macros (it has many global
arrays of a size defined with '#define') and the only thing I could
find is the following:

-#define MAX_DECAL_FRAGMENTS 32
+#define MAX_DECAL_FRAGMENTS 64

But the problem is here:

#define MAX_PARTICLES 4096

typedef struct particle_s
{
/* skip */
decalpolys_t decal[MAX_DECAL_FRAGMENTS];
/* skip */
} cparticle_t;

cparticle_t particles[MAX_PARTICLES];

The size of the cparticle_t type is 68 in my machine. So 68*32*4096 =
8912896, and in the new version it was doubled to 17825792.
In fact, it shall be bigger due to alignment.


I have changed the definition back to 32, and now 'readelf' reports the
size has been reduced considerably:

LOAD 0x070000 0x080b8000 0x080b8000 0x03010 0x149a1954 RW 0x1000

BTW this works in Linux (I haven't tried myself but someone else told
me), so just for curiosity, does it allocate more memory for loading
programs?

Best Regards,
Ale

This is not how much memory is allocated for loading, this is the address
map that determines max size of the data/bss section.

I don't remember the typical address where linux places mmaped regions
and elf interpreter, and do not have accessible machine to check. Most
likely, this address is higher for linux.

The array of such size (I think up to 1-1.5 Gb) could be easily allocated
dynamically by mmap(2).

Attachment: pgpkzcRrdG0hj.pgp
Description: PGP signature



Relevant Pages

  • Re: FYI: RAID5 unusably unstable through 2.6.14
    ... since my main system is running on that array ... because I've started the system and booted Linux from the array ... Adaptec controller found an inconsistency on the position somewhere in the ... RAID 5, so no problem) and reinstalled both systems in Array 2, and now it ...
    (Linux-Kernel)
  • Re: FYI: RAID5 unusably unstable through 2.6.14
    ... since my main system is running on that array ... because I've started the system and booted Linux from the array ... Adaptec controller found an inconsistency on the position somewhere in the ... RAID 5, so no problem) and reinstalled both systems in Array 2, and now it ...
    (Linux-Kernel)
  • Storing/Retrieving TYPEs with ALLOCATABLE components (TR) (long)
    ... tBrd, including array descriptor of tEn )). ... Without previous DEALLOCATE, the allocate line fails at run time with message ... the fact that I'm loading an invalid descriptor tBrd%tEn from the file... ... status (which is not possible according to Standard, but then BINARY files ...
    (comp.lang.fortran)
  • Re: Storing the size of an array in the structure itself
    ... >> I think every C programmer can relate to the frustrations that malloc ... >> the size of an array must be stored separately to be a nightmare. ... is anything more than just that - a chunk of memory. ... > Otherwise you couldn't tell it how much to allocate. ...
    (comp.lang.c)
  • determining available space for Float32, for instance
    ... I am looking for a way to determine the maxium array size I can allocate ... We do not want a solution that requires recompiling Python, ... agents may be households that choose a new gridcell to live in. ... Each attribute of a dataset has such a 2D array. ...
    (comp.lang.python)