Re: wxPerl crashes on Windows when installed into a localized path

Mark Dootson <[email protected]> Thu, 16 Feb 2017 18:06:10 +0000
Newsgroups gmane.comp.lang.perl.wxperl
Message-ID <[email protected]>
--------------EC8B8BD2360C0F627D3D75BB
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I think you can fix it for Wx at least by expanding the BEGIN block at 
the top of slicr3.pl to include the following.
In the Wx case, the loading fails because you cannot add a wide 
character string to $ENV{PATH}.
The snippet assumes you are actually using 'msw_3_0_2_uni_gcc_3_4' 
flavour of wxWidgets.
I'll fix the issue for Wx in the next release.

BEGIN {
     use FindBin;
     use lib "$FindBin::Bin/lib";

     package Wx;

     our $wx_path;
     foreach ( @INC ) {
         if( -d "$_/Alien/wxWidgets/msw_3_0_2_uni_gcc_3_4" ) {
           $wx_path = "$_/Alien/wxWidgets/msw_3_0_2_uni_gcc_3_4/lib";
           last;
         }
     }

     if( $wx_path && $^O =~ /mswin/i ) {
        require Win32;
        $wx_path = Win32::GetShortPathName( $wx_path );
     }
}

package main;







On 16/02/2017 17:20, bubnikv . wrote:
>
> It seems the perl itself is broken and the core perl dynaloader fails 
> to work, if the perl was started with long names. For example, running 
> slic3r with the following slic3r.bat fails:
>
> "%~dp0\perl5.24.0.exe" "%~dp0\slic3r.pl <http://slic3r.pl>" %*
>
> It works though, if one replaces the magic %~dp0 with %~dps0:
>
> "%~dps0\perl5.24.0.exe" "%~dps0\slic3r.pl <http://slic3r.pl>" %*
>
> That way both the paths of the perl.exe and slic3r.pl 
> <http://slic3r.pl> use the 8.3 characters only per directory entry.
>
>
> For the reference, this is the original github issue:
>
> https://github.com/prusa3d/Slic3r/issues/133
>
>
> I think this may be interesting to some, but it seems not to be a 
> wxPerl issue per se, so I think I will stop rumbling about it here :-)
>
>
> On Thu, Feb 16, 2017 at 4:55 PM, bubnikv . <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     I analyzed the crash further. It is sufficient to load any of the
>     following modules to get perl crashing, when the perl is installed
>     in a folder with local characters:
>
>     use Wx::DND;
>     use Wx::GLCanvas;
>     use Wx::GLCanvas qw(:all);
>     use Wx::Grid;
>     use Wx::Html;
>     use Wx::Print;
>
>
>     On Thu, Feb 16, 2017 at 2:42 PM, bubnikv . <[email protected]
>     <mailto:[email protected]>> wrote:
>
>         Hello.
>
>         I am supporting and ehancing a fork of Slic3r, one of the main
>         applications for fused filamet 3D printing.
>         http://slic3r.org/
>         https://github.com/prusa3d/Slic3r/releases
>         <https://github.com/prusa3d/Slic3r/releases>
>
>         It is likely one of the largest wxPerl applications, combining
>         perl, wxWidgets and a lot of custom C++ code.
>
>         Our customers have currently issues running Slic3r on Windows,
>         when installed into a path with localized characters, for
>         example Russian. This often happens if one installs Slic3r
>         into his home directory.
>
>         I verified that wxPerl outright crashes, when installed into a
>         localized directory on Windows 10 64bit and Strawberry Perl
>         5.24.0, tested with wxdemo.
>
>         Is there a chance that this will be looked into by someone,
>         please? Or has been wxPerl abandoned and I am left to provide
>         a fix myself?
>
>         Thanks,
>         Vojtech
>
>
>


--------------EC8B8BD2360C0F627D3D75BB
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi, <br>
      <br>
      I think you can fix it for Wx at least by expanding the BEGIN
      block at the top of slicr3.pl to include the following.<br>
      In the Wx case, the loading fails because you cannot add a wide
      character string to $ENV{PATH}.<br>
      The snippet assumes you are actually using 'msw_3_0_2_uni_gcc_3_4'
      flavour of wxWidgets.<br>
      I'll fix the issue for Wx in the next release.<br>
      <br>
      BEGIN {<br>
          use FindBin;<br>
          use lib "$FindBin::Bin/lib";<br>
          <br>
          package Wx;<br>
          <br>
          our $wx_path;<br>
          foreach ( @INC ) {<br>
              if( -d "$_/Alien/wxWidgets/msw_3_0_2_uni_gcc_3_4" ) {<br>
                $wx_path =
      "$_/Alien/wxWidgets/msw_3_0_2_uni_gcc_3_4/lib";<br>
                last;<br>
              }<br>
          }<br>
        <br>
          if( $wx_path &amp;&amp; $^O =~ /mswin/i ) {<br>
             require Win32;<br>
             $wx_path = Win32::GetShortPathName( $wx_path );<br>
          }<br>
      }<br>
      <br>
      package main;<br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      On 16/02/2017 17:20, bubnikv . wrote:<br>
    </div>
    <blockquote
cite="mid:CAAE6JuzQ+tJxui89Zw5uBbntCUq+aXzBKmBk-Z+pWDXRPPk-Jw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <p
style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,&quot;segoe
            ui&quot;,helvetica,arial,sans-serif,&quot;apple color
            emoji&quot;,&quot;segoe ui emoji&quot;,&quot;segoe ui
            symbol&quot;;font-size:14px;margin-top:0px">It seems the
            perl itself is broken and the core perl dynaloader fails to
            work, if the perl was started with long names. For example,
            running slic3r with the following slic3r.bat fails:</p>
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,&quot;segoe
            ui&quot;,helvetica,arial,sans-serif,&quot;apple color
            emoji&quot;,&quot;segoe ui emoji&quot;,&quot;segoe ui
            symbol&quot;;font-size:14px">"%~dp0\perl5.24.0.exe" "%~dp0\<a
              moz-do-not-send="true" href="http://slic3r.pl">slic3r.pl</a>"
            %*</p>
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,&quot;segoe
            ui&quot;,helvetica,arial,sans-serif,&quot;apple color
            emoji&quot;,&quot;segoe ui emoji&quot;,&quot;segoe ui
            symbol&quot;;font-size:14px">It works though, if one
            replaces the magic %~dp0 with %~dps0:</p>
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,&quot;segoe
            ui&quot;,helvetica,arial,sans-serif,&quot;apple color
            emoji&quot;,&quot;segoe ui emoji&quot;,&quot;segoe ui
            symbol&quot;;font-size:14px">"%~dps0\perl5.24.0.exe"
            "%~dps0\<a moz-do-not-send="true" href="http://slic3r.pl">slic3r.pl</a>"
            %*</p>
          <p
style="box-sizing:border-box;margin-top:0px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,&quot;segoe
            ui&quot;,helvetica,arial,sans-serif,&quot;apple color
            emoji&quot;,&quot;segoe ui emoji&quot;,&quot;segoe ui
            symbol&quot;;font-size:14px;margin-bottom:0px">That way both
            the paths of the perl.exe and <a moz-do-not-send="true"
              href="http://slic3r.pl">slic3r.pl</a> use the 8.3
            characters only per directory entry.</p>
          <p
style="box-sizing:border-box;margin-top:0px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,&quot;segoe
            ui&quot;,helvetica,arial,sans-serif,&quot;apple color
            emoji&quot;,&quot;segoe ui emoji&quot;,&quot;segoe ui
            symbol&quot;;font-size:14px;margin-bottom:0px"><br>
          </p>
          <p
            style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><font
              face="-apple-system, blinkmacsystemfont, segoe ui,
              helvetica, arial, sans-serif, apple color emoji, segoe ui
              emoji, segoe ui symbol" color="#333333"><span
                style="font-size:14px">For the reference, this is the
                original github issue:</span></font></p>
          <p
            style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><a
                moz-do-not-send="true"
                href="https://github.com/prusa3d/Slic3r/issues/133">https://github.com/prusa3d/Slic3r/issues/133</a></span><br>
          </p>
        </div>
        <div><br>
        </div>
        <div>I think this may be interesting to some, but it seems not
          to be a wxPerl issue per se, so I think I will stop rumbling
          about it here :-)</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Thu, Feb 16, 2017 at 4:55 PM,
          bubnikv . <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:[email protected]" target="_blank">[email protected]</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>I analyzed the crash further. It is sufficient to
                load any of the following modules to get perl crashing,
                when the perl is installed in a folder with local
                characters:</div>
              <div><br>
              </div>
              <div>use Wx::DND;</div>
              <div>use Wx::GLCanvas;</div>
              <div>use Wx::GLCanvas qw(:all);</div>
              <div>use Wx::Grid;</div>
              <div>use Wx::Html;</div>
              <div>use Wx::Print;</div>
              <div><br>
              </div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Thu, Feb 16, 2017 at 2:42
                    PM, bubnikv . <span dir="ltr">&lt;<a
                        moz-do-not-send="true"
                        href="mailto:[email protected]" target="_blank">[email protected]</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr">Hello.
                        <div><br>
                        </div>
                        <div>I am supporting and ehancing a fork of
                          Slic3r, one of the main applications for fused
                          filamet 3D printing.</div>
                        <div><a moz-do-not-send="true"
                            href="http://slic3r.org/" target="_blank">http://slic3r.org/</a> </div>
                        <div><a moz-do-not-send="true"
                            href="https://github.com/prusa3d/Slic3r/releases"
                            target="_blank">https://github.com/prusa3d/Sli<wbr>c3r/releases</a><br>
                        </div>
                        <div><br>
                        </div>
                        <div>It is likely one of the largest wxPerl
                          applications, combining perl, wxWidgets and a
                          lot of custom C++ code.</div>
                        <div><br>
                        </div>
                        <div>Our customers have currently issues running
                          Slic3r on Windows, when installed into a path
                          with localized characters, for example
                          Russian. This often happens if one installs
                          Slic3r into his home directory.</div>
                        <div><br>
                        </div>
                        <div>I verified that wxPerl outright crashes,
                          when installed into a localized directory on
                          Windows 10 64bit and Strawberry Perl 5.24.0,
                          tested with wxdemo.</div>
                        <div><br>
                        </div>
                        <div>Is there a chance that this will be looked
                          into by someone, please? Or has been wxPerl
                          abandoned and I am left to provide a fix
                          myself?</div>
                        <div><br>
                        </div>
                        <div>Thanks,</div>
                        <div>Vojtech</div>
                        <div><br>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>

--------------EC8B8BD2360C0F627D3D75BB--