Invalid access to memory location on 64-bit Strawberry Perl only - windows

Hi I am trying to get a Perl program running on Windows 64-bit using Strawberry Perl version 5.20, the 64-bit version. I have no problems running the 32-bit version (32-bit Strawberry Perl on 32-bit Windows), but it lacks the memory capabilities of the 64-bit.
All of the required modules compile correctly, however when I run the program I get the following error:
Can't load 'C:/Strawberry/perl/vendor/lib/auto/YAML/XS/LibYAML/LibYAML.xs.dll' for module YAML::XS::LibYAML:
load_file:Invalid access to memory location at
C:/Strawberry/perl/lib/XSLoader.pm line 68.
at C:/Strawberry/perl/vendor/lib/YAML/XS/LibYAML.pm line 7.
Any ideas on what is going on? Or how I can try to fix this? I have tried reinstalling both Perl and the modules.

Related

Getting the error: bash: (program): cannot execute binary file: Exec format error, on both 32-bit and 64-bit Windows

There is a program developed for linguistic research (http://people.csail.mit.edu/mcollins/code.html). When I try to run the parser using Git bash terminal on Windows, I get the error:
bash: cannot execute binary file: Exec format error.
First, I assumed it's because of my 64-bit OS, since the file is 32-bit. So, I tried the program on a 32-bit system, but got the same message.
Any ideas on how to fix the issue?:
file (program) shows:
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, with debug_info, not stripped
uname -srv for my 64-bit OS, shows:
MINGW64_NT-10.0-19042 3.1.7-340.x86_64 2021-03-26 22:17 UTC
uname -srv for my 32-bit OS, shows:
MINGW32_NT-6.1-7601 3.1.7-340.i686 2021-03-26 22:01 UTC
P.S.: If you'd like to give it a try, this code should work in the program directory, but it doesn't work for me:
gunzip -c models/model2/events.gz | code/parser examples/sec23.tagged models/model2/grammar 10000 1 1 1 1 > examples/sec23.model2
As indicated by file, your program is a Linux application so you can't run it on Windows. See
Why does a linux compiled program not work on Windows
Why won't Windows EXE files work on Linux?
Why do you need to recompile C/C++ for each OS?
Mingw is not an environment for running Linux executables, it's just a compiler that compiles POSIX code into native Windows binaries. Neither is Cygwin, which is a reimplementation of POSIX system calls in Windows, and Cygwin binaries are also native Windows binaries with a dependency on Cygwin DLLs. Read this if you want to know their differences. Bash is a shell and isn't a platform to execute files either. Only the runtime platform (OS or something like JVM or .NET CLR VM) can run programs and a shell is just a tool to interact with the OS
So you must run Linux programs in a Linux environment like a Linux machine or WSL1/2. Since the program is 32-bit, you can only run it in Linux or WSL2
Since you have the source code you can also compile the code with mingw or cygwin and run on Windows
Thanks to the answer provided by #phuclv, I realized I need to run the program in Linux. So, I installed 32-bit Linux (I used Linux Mint Debian Edition) on a virtual machine (VirtualBox) on my 64-bit Windows 10, and it worked!

Perl modules requiring later versions of perl available on windows

I'm currently trying to port a copy of a script I wrote in perl that uses the Statistics::R module to communicate with R from a linux -based OS to a Windows 7 OS. I have been successful at installing R and Strawberry Perl onto the system, but have hit a stumbling block when installing the Statistics::R module. One of the modules it relies upon (Regexp::Common) requires the installation of a newer version of perl than appears to be on my system- at least 5.01 as opposed to the 5.008008 that it identifies. I believe I have the latest Strawberry Perl version installed (5.24), and this works well on the system with other scripts used. I was wondering if anyone knows of a way to install a newer version of perl onto the system, or if there is an alternate way to fix this issue?
Thanks.
Use the "where" command to locate the cpan modules that are associated with the installation of new modules. Associated Perl versions can then be removed via the Programs and Features window found in the Start Menu by clicking on the "Uninstall" button. Re-installation of the latest perl version from either Strawberry Perl or other Windows- compatible Perl releases will allow for a newer Perl version to be accessed.

SonarQube - Unable to load the Wrapper's native library 'wrapper.dll'

I'm installing SonarQube v5.0.
I'm running Windows Server 2012 64-bit (a virtual OS), Java 1.8 64-bit, and the SonarQube windows-x86-64 wrapper.
SonarQube, whether run via StartSonar.bat using Command Prompt as Administrator or as a Windows Service, keeps throwing the following warning:
WARNING - Unable to load the Wrapper's native library 'wrapper.dll'.
The file is located on the path at the following location but
could not be loaded:
C:\sonarqube-5.0.1\bin\windows-x86-64\.\lib\wrapper.dll
Please verify that the file is readable by the current user
and that the file has not been corrupted in any way.
One common cause of this problem is running a 32-bit version
of the Wrapper with a 64-bit version of Java, or vica versa.
This is a 32-bit JVM.
Reported cause:
C:\sonarqube-5.0.1\bin\windows-x86-64\lib\wrapper.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
System signals will not be handled correctly.
The only info that I've found on the web is some JIRA's from 2010 that don't really help me. I can't create a sonar user on this Windows installation. All my other tools in my CI environment are running on Java 1.8 64-bit, which means that JAVA_HOME is set to JDK 1.8 64-bit. I really don't want to have to run Java 32-bit and the 32-bit Wrapper. That means that the JRE bin/java path at the top of wrapper.conf will have to specify the 32-bit JRE.
What can I do to get rid of this warning?
Not all applications use JAVA_HOME variable, so you can have JAVA_HOME pointing on your 64 bits version while you are using a 32 bits.
Note: the 'Java_Home' key in the registry is not the JAVA_HOME variable.
Well, one way to be sure is to uninstall the current service, with ..\windows-x86-64\UninstallNTService.bat and install the 32 bits version with ..\windows-x86-32\InstallNTService.bat.
If it works, you definitively have a 32 bits JVM.
Installed the service SonarQube in \sonarqube-5.1.2\bin\windows-x86-64.
I just went to the SonarQube in the Windows Services-->go to properties-->Log On tab--->select 'Local Service'(Entered the system password). Thats it!
Issue was resolved.
Hope this helps someone who was not able to resolve from the above posts.
I experienced the same problem with SonarQube 5.6.4 on Windows 7. Editing the sonar.properties file to add a wrapper.java.command=... had no effect. Editing my path statement did the trick, though.
The first two folders in my path statement had been
C:\ProgramData\Oracle\Java\javapath;C:\dev\sdks\jdk1.8.0_112\bin;....
The java.exe in the first (C:\ProgramData\Oracle\Java\javapath) is 32-bit. I just switched the two in my path:
C:\dev\sdks\jdk1.8.0_112\bin;C:\ProgramData\Oracle\Java\javapath;...
Suddenly SonarQube started using the 64-bit java.exe in C:\dev\sdks\jdk1.8.0_112\bin
After making this change, I was able to restart Firefox without any difficulty.
In my case, running on SonarQube 7.3 on window 7 or window 10, I have to update Java version to java 8 to pass this error.
No need for this, In my case I just Installed Java SE JDK 11.0.16 and installed it, and restarted the sonar server and it worked. Below is the URL to download
https://www.techspot.com/downloads/5553-java-jdk.html

How can I package my perl script as a 32-bit executable?

I'm on 64-bit Windows 7 machine, and I've been using PAR:Packager to package my scripts as .exe's.
However, I now need to run these .exe's on a 32-bit Windows 7 machine.
Is there anyway to package it as a 32-bit executable from a 64-bit machine? (is it possible with PAR:Packager?)
You could install a 32-bit perl on your 64-bit machine, but most folks will recommend you just keep a 32-bit VM laying about for those times you need to publish software for legacy machines.

Pyinstaller, how to make 32bit and 64bit .exe on 32bit linux?

I created executable using pyinstaller 2.0 and python2.7 on ubuntu 12.04 32bit (so I assume python is also 32bit).
It's a simple program in console (no gui), that connects to TCP/IP server and send frames.
It works under my ubuntu 32bit, but it does not run on Windows 7 32bit and 64bit.
On Win32bit it returns error "Device is not ready", and on Win64bit it returns error that "application has wrong architecture".
Where can be cause of this?
Here is a link to whole app code (it's small) http://pastebin.com/qj96vpgK
The Linux version of PyInstaller can not make .exes or any non-Linux-native format. In order to make a Windows executable, you need to either use WINE (or at least they say, but I'm not sure how to do that), or use a Windows computer.
Additionally, if the Windows computer you use is 32-bit, it can not make 64-bit binaries. If you have a 64-bit install of Windows, it can make 64-bit binaries easily, but in order to make 32-bit ones, you need to install a 32-bit version of Python (and all the required libraries for your program).
Thus, one way to make both 32- and 64-bit executables for a given program, copy your code over to a Windows 64-bit OS, install the 32 and 64-bit Python and pywin32, and use PyInstaller using each different Python.

Resources