Jump to content
OMRON Forums

Segmentation fault on code download


steveneads

Recommended Posts

Hi

 

I've recently started to experience code down-loading failing with the message "Download process failed with a segmentation fault" (465 board). I have now updated to IDE version 2.2.1.25 (PPMAC firmware is 2.1.1.3), but the problem persists.

 

If I repeat the download it's often OK the second time.

 

What's going wrong?

 

Another colleague is also having the same problem.

 

I've attached a copy of the messages given by the IDE during compiling and downloading.

 

Thanks

Steve

download error.txt

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

Just for a test can you make sure all C-programs (cplc, capps, usercode) and script PLC programs are stopped before you download.

 

And make sure nothing is started automatically during download. This would include setting the useraldo.cfunc=1 if you are doing this.

Link to comment
Share on other sites

Hi Brad

 

Currently my pp_startup.txt contains:

 

UserAlgo.CFunc=1;

enable plc 1;

 

I will try removing UserAlgo.CFunc=1 from pp_startup.txt, adding a 2 second delay at the start of PLC 1 and then set UserAlgo.CFunc=1 in this plc, to delay these actions. Is this what you had in mind? I'll see whether this helps.

 

Steve

Link to comment
Share on other sites

You do not need to add it to your PLC. For download testing just remove both of these from the pp_startup. Then if you can download several times with no problem we can assume the starting of these features is making the download problem.

 

Also make sure UserAlgo,CFunc=0 before you do any downloading.

Link to comment
Share on other sites

Hi Brad

 

I'm still getting this fault - but it doesn't happen all the time.

 

I have just had it again after being very careful to make sure that nothing I could think of was running. Firstly I set UserAlgo.CFunc=0, then using the task manager I made sure that all PLCs and C applications were stopped. I then did a build and download which generated the segmentation error (attached). Finally I checked that UserAlgo.CFunc was still zero and that nothing was running. This was the case.

 

What can be generating the error?

 

It seems to me that there's a problem in the download process. Is it because we have a large project? It seems that our problems have recently appeared with a sizeable amount of C application code being added.

 

We need some help here!

 

Steve

download error 2.txt

Link to comment
Share on other sites

At this point I think the next step is to get your project and try to duplicate the problem here. Please contact fmacaluso@deltatau.ch. He will of course ask some questions to come up to speed and will want the project to start testing and trying to duplicate.
Link to comment
Share on other sites

  • 2 years later...

Hi all!

 

I observed the same problem (segmentation fault) and I am suspecting that my large lines on one of my PLCs are causing the problem. Even if I comment them, the segmentation fault occurs, and, if I remove them, the segmetation fault disappear.

 

Any suggestions about what could I do to solve the problem? I would like to know if compilation does not support large lines of code and if there is a way to download the programs without breaking the calculation in other small pieces.

 

Thanks!

Link to comment
Share on other sites

What IDE and firmware version are you using?

 

IDE: 4.3.2.19

firmware: 2.5.4.0

 

Are you encrypting your project?

 

I do not know how to see it, could you please show me?

 

Maybe done by this: Sys.WpKey = $AAAAAAAA?

 

I put this just on one pmh file... All files must contain it?

 

Can you paste in an example line that causes a segmentation fault even when commented?

 

Sure, there are two screenshots showing the problem, one of my plc with large lines (which causes segmentation fault even commented) and the other show the output of the error.

 

The example line (there are many as you can see on screenshot):

 

P76=7.9992320737209082e-10*P62/(sqrt(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1)*sqrt(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1)) + 0.00050000000000000001*P62*(-5.3709337312250722e-13*P60 - 1.3430231271822752e-12*P61 + 3.7602330006095687e-8*P65)*(5.3194893290244149e-7*P60 + 1.5998464147441817e-6*P61 - 0.042635906952932505*P65)/(sqrt(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1)*pow(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1, 3.0/2.0)) + 0.00050000000000000001*P62*(-8.5103659313096439e-13*P60 - 2.5595085507698126e-12*P61 + 6.8210902878015602e-8*P65)*(5.3194893290244149e-7*P60 + 1.5998464147441817e-6*P61 - 0.042635906952932505*P65)/(pow(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1, 3.0/2.0)*sqrt(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1)) - 6.5106109364062736e-13*P64*(0.00049450793067729688*P63 - 172.09999999999999)/(sqrt(3.1561671506122976e-13*pow(P64, 2) + 1)*sqrt(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1)) - 5.6179775280898885e-7*P64*(0.00049450793067729688*P63 - 172.09999999999999)*(-5.3709337312250722e-13*P60 - 1.3430231271822752e-12*P61 + 3.7602330006095687e-8*P65)*(4.6345550827120609e-7*P60 + 1.1588887466803166e-6*P61 - 0.032446885099030487*P65)/(sqrt(3.1561671506122976e-13*pow(P64, 2) + 1)*pow(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1, 3.0/2.0)) + (629.10000000000002 - 7.3904712280461367e-5*P63)*(-5.3709337312250722e-13*P60 - 1.3430231271822752e-12*P61 + 3.7602330006095687e-8*P65)/(sqrt(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1)*pow(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1, 3.0/2.0)) + (629.10000000000002 - 7.3904712280461367e-5*P63)*(-8.5103659313096439e-13*P60 - 2.5595085507698126e-12*P61 + 6.8210902878015602e-8*P65)/(pow(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1, 3.0/2.0)*sqrt(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1)) + 1.5998464147441817e-6*(0.00049450793067729688*P63 - 172.09999999999999)/(sqrt(3.1561671506122976e-13*pow(P64, 2) + 1)*sqrt(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1)*sqrt(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1)) + (0.00049450793067729688*P63 - 172.09999999999999)*(-5.3709337312250722e-13*P60 - 1.3430231271822752e-12*P61 + 3.7602330006095687e-8*P65)*(5.3194893290244149e-7*P60 + 1.5998464147441817e-6*P61 - 0.042635906952932505*P65)/(sqrt(3.1561671506122976e-13*pow(P64, 2) + 1)*sqrt(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1)*pow(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1, 3.0/2.0)) + (0.00049450793067729688*P63 - 172.09999999999999)*(-8.5103659313096439e-13*P60 - 2.5595085507698126e-12*P61 + 6.8210902878015602e-8*P65)*(5.3194893290244149e-7*P60 + 1.5998464147441817e-6*P61 - 0.042635906952932505*P65)/(sqrt(3.1561671506122976e-13*pow(P64, 2) + 1)*pow(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1, 3.0/2.0)*sqrt(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1)) + 590.10000000000002*(-5.3709337312250722e-13*P60 - 1.3430231271822752e-12*P61 + 3.7602330006095687e-8*P65)/(sqrt(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1)*pow(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1, 3.0/2.0)) + 590.10000000000002*(-8.5103659313096439e-13*P60 - 2.5595085507698126e-12*P61 + 6.8210902878015602e-8*P65)/(pow(0.0018178205616991184*pow(1.2476547842401508e-5*P60 + 3.7523452157598445e-5*P61 - P65, 2) + 1, 3.0/2.0)*sqrt(0.0010528003526296867*pow(1.4283513097072426e-5*P60 + 3.5716486902927524e-5*P61 - P65, 2) + 1))

 

I am using P-variables in order to implement the newton method to solve a non trivial inverse kinematics. These P-variables goes to native matrix operators.

 

This line is one of the elements of jacobian matrix, which is used to implement newton method. It is very large due to the complexity of system kinematics

seg_fault_message.thumb.PNG.cdb484a3c3372619254c50b0e84ff4ab.PNG

large_plc_lines.thumb.PNG.9a9b08d763d9635e3153c2e3981dd56c.PNG

Link to comment
Share on other sites

  • 3 weeks later...

Hi Eric!

 

I solved the problem by spliting the large equations into sums. I think this is an intrinscic problem of the compiler, since I saw some reports of this problem on other C compilers (just speculating)

 

George

 

Good. :)

 

I learned the current IDE has a line length limit of 8192, but I was not able to confirm if it applies to IDE versions that old yet.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...