I am getting segmentation fault in my perl code. I am not able to find out,from where this arises.Can anyone suggest em a good debugger to find it out.thanks a lot.

10 Years
Discussion Span
Last Post by KevinADC

Since Iam not sure from where the error arises, I am not able to provide code.Actually it uses inline CPP. the cpp program has memory allocations and deallocations done properly in a thread environment.(I create threads in a loop.When I create many threads, seg fault comes. if I create few threads no error).help me out pls.


Sorry, but your question is out of my range of knowledge and experience. A question of this nature might be best asked on the perlmonks website.


I've never seen segmentation faults in Perl apps, so I'd guess the problem is between the inline CPP code and the CPP program itself.

The "best debugger" is assuming everything's going to go wrong before you start and making adequate provision for real-time/recorded logging throughout your code.

Break the program apart and test the CPP application from command line/within a C environment; if it works as expected, the problem is in the inline CPP perl module/with your usage of the module.


okay.I will try that .Thanks. meanwhile, I tried using GDB(since perl is written in c too),But gdb requires a program in executable form.How will I put that .pl there ? :(.It naturally says not exe format.How do I come out of this?


The perl interpretter is written in C but .pl files aren't executable. You can't make them executable without using some kind of Perl-to-C translater.

I wouldn't advise translating them!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.