Place to discuss Fedora and/or Red Hat
Post Reply
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm


Post by ZiaTioN »

Dealing with this app I wrote I have come across a problem I have never seen before when working with perl, Segfaults!!

I am launching numerous threads and socket connections with this app. It usually gets to around 120 or so threads and then segfaults. Now each thread is creating 2 database connections. I set MySQL up to allow 500 connections for now so this should not be the problem. If it was MySQL would tell me (has in the past). My cpu usage is fine, my memory usage is fine.

Only thing I can think of would be my stack_size.
[root@Freedom root]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 16383
virtual memory (kbytes, -v) unlimited
These are my limits as of now and I have fiddeled with this setting to see what I could make happen. With this value at 10240 I can get about 290 threads before it segfaults. When I change it to 1024 I can get about 633. I ran my app with this setting at 1024 and it still segfaulted around the same area and I know I had no where enar 633 threads going.

What else could be limiting it? I know segfaults are usually memory space errors but I can not find what the deal may be.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Post by Void Main »

Change your core file size to a value large enough to get a core dump and see if that gives you any clue. When it segfaults it should create a core file in your current directory (or the current directory the app was run from). I usually can get a hint of why it crashed by running the core file through "strings" but you can read the stack trace through gdb:


Not sure how much more difficult that will be being a Perl app.

Post Reply