There is a patch fix for perl module net::ssh2 it fixes a seg fault error that happens on some machines.

It's located here: https://rt.cpan.org/Public/Bug/Display.html?id=36614

I downloaded the patch but i'm not sure how to apply it. I removed the module i previously installed, went to the build folder and did

patch ssh2.xs < p1

it asked me if the patch was in reverse. I wasn't sure so i hit yes. IT says patch succeed then tells me ok. modules installed. I don't think either the patch worked or i'm moving my patched version in correctly. I feel that way because i still get the seg fault and everyone say this fixes it.

  • We can't guide you because we don't know what you did after running patch. Copy-paste the exact commands that you ran and the output from these commands. – Gilles 'SO- stop being evil' Dec 30 '11 at 21:53
  • hi @Arian, how did this go for you? – Nikhil Mulley Jan 14 '12 at 10:44
  • After reading more about net:ssh2 i decided to use a different library that was more compatible with different archs. – Arian Jan 21 '12 at 16:45

Proper patch invocation will looks like:

patch -p1 < net-ssh2-0.18-perl5.10.patch

You have do this in the directory, where is file SSH2.xs.

| improve this answer | |
  • can you explain the "p1" parameter? – Arian Dec 29 '11 at 17:14
  • I checked man patch but it still doesn't make sense to me. – Arian Dec 29 '11 at 17:55
  • @Arian It's about a directory part in diff header. In this case you can see in diff header this string: Net-SSH-0.18.orig/SSH2.xs. If you use -p1 parametr, patch utility will strip from this string leading directory and you will get a /SSH2.xs, which you want patch. With -p0 parameter will patch don't strip from this string nothing. – Jan Marek Jan 2 '12 at 7:58

Direct excerpt from gnu patch manpage:

   -p<num>  or  --strip=num
      Strip the smallest prefix containing num leading slashes from each file name found in the patch file.  A sequence of  one  or  more  adjacent
      slashes  is  counted  as  a single slash.  This controls how file names found in the patch file are treated, in case you keep your files in a
      different directory than the person who sent out the patch.  For example, supposing the file name in the patch file was


      setting -p0 gives the entire file name unmodified, -p1 gives


      without the leading slash, -p4 gives


      and not specifying -p at all just gives you blurfl.c.  Whatever you end up with is looked for either in the current directory, or the  direc-
      tory specified by the -d option.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.