- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- why the program cause coredump?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 09:47 PM
тАО05-31-2005 09:47 PM
#include
#include
#include
#define FDATANUM 10000000
#define CDATANUM 500000
#define IDENNUM 50000
#define STR_LEN 256
main()
{
int ret;
char cpar[20][2048];
long lpar[100];
char cdata[CDATANUM][STR_LEN];
float fdata[FDATANUM];
long ciden[IDENNUM];
long fiden[IDENNUM];
char output[30];
strcpy(cpar[0],"A");
}
Our Server configuration:
HP 11iv1
memory:8GB
CPU:4
**********************************************
The error log:
> cc +DA2.0W +DS2.0 -DSS_64BIT_SERVER b.c
> ./a.out
Memory fault(coredump)
> file core
core: ELF-64 core file - PA-RISC 2.0 from 'a.out' - received SIGSEGV
> cc b.c
> ./a.out
Memory fault(coredump)
> file core
core: core file from 'a.out' - received SIGSEGV
**********************************************
Some Tunable Kernel Parameters:
aio_listio_max 256 - 256
aio_max_ops 2048 - 2048
aio_prio_delta_max 20 - 20
bcvmap_size_factor 2 - 2
dbc_max_pct 25 - 25
effective_maxpid - - ((NPROC<=30000)?30000:(NPROC*5/4))
eqmemsize 15 - 15
hfs_max_ra_blocks 8 - 8
hfs_max_revra_blocks 8 - 8
initmodmax 50 - 50
iomemsize - - 40000
ksi_alloc_max 20640 - (NPROC*8)
ksi_send_max 32 - 32
max_async_ports 50 - 50
max_fcp_reqs 512 - 512
max_mem_window 0 - 0
max_thread_proc 1000 - 1000
maxdsiz 0x10000000 - 0x10000000
maxdsiz_64bit 0x40000000 - 0X40000000
maxfiles 4096 - 4096
maxfiles_lim 4096 Y 4096
maxqueuetime - - 0
maxssiz 0x800000 - 0X800000
maxssiz_64bit 0x800000 - 0X800000
maxswapchunks 8192 - 8192
maxtsiz 0x4000000 Y 0X4000000
maxtsiz_64bit 0x40000000 Y 0X40000000
maxuprc 2322 Y ((NPROC*9)/10)
maxusers 320 - 320
maxvgs 10 - 10
modstrmax 500 - 500
msgmax 8192 Y 8192
ncsize 27808 - (NINODE+VX_NCSIZE)+(8*DNLC_HASH_LOCKS)
netmemmax - - 0
scsi_max_qdepth 8 Y 8
scsi_maxphys 1048576 - 1048576
sendfile_max 0 - 0
shmmax 4096000000 Y 4096000000
vol_dcm_replay_size 262144 - (256*1024)
vol_max_bchain 32 - 32
vol_max_nconfigs 20 - 20
vol_max_nlogs 20 - 20
vol_max_nmpool_sz 4194304 - (4*1024*1024)
vol_max_prm_dgs 1024 - 1024
vol_max_rdback_sz 4194304 - (4*1024*1024)
vol_max_vol 8388608 - (8*1024*1024)
vol_maxio 256 - 256
vol_maxioctl 32768 - 32768
vol_maxkiocount 2048 - 2048
vol_maxparallelio 256 - 256
vol_maxspecialio 256 - 256
vol_maxstablebufsize 256 - 256
vol_mvr_maxround 256 - 256
volcvm_cluster_size 16 - 16
voldrl_max_drtregs 2048 - 2048
voliomem_chunk_size 65536 - (64*1024)
voliomem_maxpool_sz 4194304 - (4*1024*1024)
voliot_iobuf_max 65536 - 65536
voliot_max_open 32 - 32
volraid_rsrtransmax 1 - 1
vps_pagesize 4 - 4
vx_maxlink 32767 - 32767
vx_ncsize 1024 - 1024
vxfs_max_ra_kbytes 1024 - 1024
vxtask_max_monitors 32 - 32
Thank you!
Solved! Go to Solution.
- Tags:
- kernel parms
- SIGSEGV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 10:45 PM
тАО05-31-2005 10:45 PM
Re: why the program cause coredump?
maxssiz 0x800000 - 0X800000
maxssiz_64bit 0x800000 - 0X800000
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 11:44 PM
тАО05-31-2005 11:44 PM
Re: why the program cause coredump?
When I commented out that ENORMOUS character array -> char cdata[CDATANUM][STR_LEN]; <- AKA => cdata[500000][256] and the next line -> float fdata[FDATANUM]; <- AKA => fdata[10 million], then the program ran fine. When allowed both back in, and changed CDATANUM from 500000 to 50000, it also ran fine.
I believe that changing maxssiz requires a reboot.
You are much BETTER off using malloc than creating such large static arrays.
live free or die
harry d brown jr
- Tags:
- maxssiz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 12:40 AM
тАО06-01-2005 12:40 AM
Re: why the program cause coredump?
char cdata[CDATANUM][STR_LEN];
CDATANUM x STR_LEN
= 500000 x 256 = 128,000,000 bytes or in hex 0x7A12000
You stack size is 0x800000 !
As Harry says, malloc would be preferable for such huge arrays, as it would allocate memory on the heap rather than the stack. But watch your maxdsize limit too!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 01:07 AM
тАО06-01-2005 01:07 AM
Re: why the program cause coredump?
http://members.shaw.ca/ipatters/BeginC_9.html
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 03:49 AM
тАО06-01-2005 03:49 AM
Re: why the program cause coredump?
I want to know how to tune the Kernel Parameters to the suitable values according to our server's memory?
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 05:52 AM
тАО06-01-2005 05:52 AM
Re: why the program cause coredump?
maxdsiz 0x10000000 - 0x10000000
maxdsiz_64bit 0x40000000 - 0X40000000
maxssiz 0xb000000 - 0XB000000
maxssiz_64bit 0xb000000 - 0XB000000
maxtsiz 0x4000000 Y 0X4000000
maxtsiz_64bit 0x40000000 Y 0X40000000
If you add more huge arrays like that, then you will need to increase the stack again (This really isn't recommended). You really should be using malloc.
To "tune" your machine we would need to know the memory available to use (max memory minus current consumption (without this program running)).
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 07:46 AM
тАО06-01-2005 07:46 AM
Re: why the program cause coredump?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 11:21 PM
тАО06-01-2005 11:21 PM
Re: why the program cause coredump?
I just don't know why HP-UX limits the Kernel Parameters so low by default. It causes inconvenience for the users. We often be asked to adjust the Kernel Parameters, but don't know which one is the key. We have not encountered this kind of problem on other platforms, even on old Compaq's ES40.
Anyway, thank everyone who answer my question.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 11:39 PM
тАО06-01-2005 11:39 PM
Re: why the program cause coredump?
The restrictions are in place to prevent an application from crippling a machine. Without these "controls" or "limitations" an application, like the one you posted, could cause the system to start paging.
The biggest issue with most people that write programs (Note I didn't say programmers, because anyone can write code but only programmers can program), and I did a lot of programming (in many languages) for twenty years, is that they typically have no concern or even knowledge of how to write efficient programs.
It's too bad that most people writing code don't have a systems background, if they did, they wouldn't be creating crap code.
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 12:18 AM
тАО06-02-2005 12:18 AM
Re: why the program cause coredump?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 12:22 AM
тАО06-02-2005 12:22 AM
Re: why the program cause coredump?
The default values have to be something, and its expected that they will need to be changed.
Newer Oracle installations check parameters and won't install until the kernel is changed, rebuilt and installed anew.
Other applications leave it up to you. When something starts to malfunction, checking kernel resources is almost always a good diagnostic step. It's really up to the application developers to run thorough tests and make sure they can give optimized recommendations for the kernel and other parameters.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 12:33 AM
тАО06-02-2005 12:33 AM
Re: why the program cause coredump?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 12:43 AM
тАО06-02-2005 12:43 AM
Re: why the program cause coredump?
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 02:29 AM
тАО06-02-2005 02:29 AM
Re: why the program cause coredump?
I've yet to see a UNIX/Linux box that was initially well-tuned regardless of the vendor. There are just too many variables. HP has a number of parameters that are typically too small and a few that are too large but the default values will run and then allow you to tune the kernel to suit. In practice, even with many different applications, it's not necessary to retune the kernel for each new application. With experience, you can get the values reasonable on the first attempt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 04:10 AM
тАО06-02-2005 04:10 AM
Re: why the program cause coredump?
There are about 15,000 observation stations around the world, and about 200 elements per observation.
In the extreme:
15000(stations)*200(elements)*24(times)=72000000(float)
72000000*4=288,000,000(bytes) It is only one day's observation data.
Should I increase the maxdsiz and maxdsiz_64bit for dynamic arrays? Especially the maxdsiz_64bit? I think there is almost no limit for 64bit.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 04:21 AM
тАО06-02-2005 04:21 AM
SolutionYou should make sure that the _64bit values are at least as large as their 32-bit counterparts. You are correct that in the 64-bit data model there are essentially no practical limits although it is still wise to limit maxdsiz_64bit to some reasonable value so that a coding error does not bring the system to its knees.
Generally the best way to handle your kind of data is dynamic arrays that expand in chunks of 100 or so elements so that the relatively expensive realloc() function does not have to be called very often.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 04:28 AM
тАО06-02-2005 04:28 AM