Perl system() call failed with return code 65280

五迷三道 提交于 2019-11-29 15:29:39

When using cleartool, it is best to ensure using ccperl (now called ratlperl), the perl packaged with ClearCase, instead of the very latest Active Perl (which actually is the 5.14.2).

So instead of launching your perl script by default, picking up the first perl.exe available in your %PATH%, try calling it with one of the perl included with ClearCase:

  • ratlperl: in C:\Program Files\Rational\Common.
  • or the legacy ccperl: in C:\Program Files\Rational\ClearCase\bin.

And see if the error persists.

The root cause was a PATH issue: several perl were available:

  • the ones from Rational ClearCase
  • the one from Active Perl

By making sure the PATH only reference one perl (the one shipped with ClearCase), the script could be launched successfully.

Remember that as documented in perldoc -f system, the return value of system "...is the exit status of the program as returned by the wait call. To get the actual exit value, shift right by eight...". Shifting 65280 by 8 yields 255.

But unfortunately that's not terribly helpful either, because as far as I can determine, the exact meaning of each possible cleartool exit code is not documented. The closest I can find is this link within the cleartool documentation, wherein it states, "The exit status from single-command mode depends on whether the command succeeded (zero exit status) or generated an error message (nonzero exit status)."

So there you have it; a 255 is a nonzero exit status, which indicates an error condition. On the bright side, maybe it's generating an error message that you're just not seeing.

As a troubleshooting technique, since you're already printing $cmd, from the command line invoke cleartool with the same command that your program generated. If you get the same result, the question becomes a cleartool question rather than a Perl question. And with a little luck that error condition will generate an error message that you can actually see rather than just an exit code.

On the other hand, if you get correct behavior, start looking at what is different between the Perl runtime environment and the command-line environment; permissions, environment variables, paths, working directory, etc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!