|Do you know where your variables are?|
Segmentation fault: problem with perl threadsby katharnakh (Novice)
|on Sep 15, 2008 at 11:47 UTC||Need Help??|
katharnakh has asked for the
wisdom of the Perl Monks concerning the following question:
I am working on a replication project, where i have to replicate dependencies of projects. I use rsync command to replicate dependencies. Since the dependency list of a project varies and will usually have a huge list, hence i want to it replicate parallely by giving a bunch of file-names to replicate to each rsync command(using --files-from=<filename>) through a file. I am doing the same using perl's threads module.
When i have more than one project(a common case), i create 10 threads to run rsync commands. This way i want to achieve replication of all dependencies parallely. I wait in main thread to finish all child threads using join() function of threads module. The script was running fine for somedays, but recently the script terminates, saying 'Segmentation fault', no line number is printed.
I have tried to debug(using perl -d <script-name>) the script, but the debugger does not comeup or no response when it lands on statement to create thread(threads->create(...)), i had to wait long time but i did not comeup so i have to kill the process.
I cannot post the whole code, because it is big and uses some of private packages, but here is how i create 10 threads for each project.
The script terminates by printing Segmentation fault, after executing last print statement in _replicate function. I not able to make out where and why that error is occuring. Or is there a other way to achieve parallel processing withoug using threads? Could someone help me here please?
I am using perl, v5.8.3 built for x86_64-linux-thread-multi
Thanks in advance,