Note that there are some explanatory texts on larger screens.

plurals
  1. POerror while loading shared libraries: ?: cannot open shared object file: No such file or directory
    primarykey
    data
    text
    <p>I'm trying to diagnose (and fix) a problem that sits on the boundary of several components; any insights into how to either gain more information or outright resolve the issue is very much appreciated.</p> <p>I have an application which starts as a C program that may launch a Java program and may then launch the same C program in a recursive fashion. <strong>It has been working on both Linux and Cygwin.</strong> Some bugs were found in the program launching paradigm within Java, and it was updated from the simpler Runtime strategy to the (new in 1.5) ProcessBuilder strategy. For various unsundry reasons, <strong>it launches bash with the -c option followed by whatever</strong> it is that needs to be called. It works on Linux, but when ported to Cygwin, it fails as described below. Unfortunately, I accidentally deleted the working Cygwin instance, so I can't readily discern if the issue is merely a configuration issue or something deeper.</p> <p>For the record, I don't think there's anything wrong with Cygwin, but I'm not sure because I had foolishly updated Cygwin at the same time. (What <em>was</em> I thinking?!)</p> <p>The error comes when Java is trying to launch the C program. It's always exactly the same error:</p> <blockquote> <p><strong>error while loading shared libraries: ?: cannot open shared object file: No such file or directory</strong></p> </blockquote> <p>Research on this error within cygwin yields nearly nothing, only this:<br> <a href="http://cygwin.com/ml/cygwin/2012-03/msg00396.html" rel="nofollow">http://cygwin.com/ml/cygwin/2012-03/msg00396.html</a> </p> <p>Notably, tests running images that are a part of the standard Cygwin distribution run and work fine. In contrast, the program bs.exe is compiled and linked in the Cygwin environment.</p> <p>Some things I was considering was if perhaps there are environment variables I've not included in the environment, but it's supposed to inherit the caller's environ, and I don't see that I've ever used any kind of LD_LIBRARY_PATH in cygwin environments in the past and didn't notice any similar references in the literature. Then, there's the Java policies, but that hasn't changed any from before, and when I added cygwin to the file, it didnt' help. </p> <p>...I've run out of ideas... Anybody?</p> <p>UPDATE: Here's a code excerpt of the ProcessBuilder code in Java:</p> <pre><code>public results ExecuteProgram(String program, String log) { results r = new results(); boolean returnString = false; if (Empty(log)) { log = getTempFile(); } File lf = null; ProcessBuilder pb; r.OK = true; r.err = "Unable to Run program: "; int status = 0; //Note that 0 = success! // Before we get here, we know the first space delimited substring // of the program string already has the full path to the program. The // rest (if any) are arguments. try { // Shell contains something like /bin/bash, depending on the system // pb = new ProcessBuilder(Shell, "-c", program); // Map&lt;String, String&gt; env = pb.environment(); // env.remove("PATH"); // env.put("PATH", Path); // env.remove("CLASSPATH"); // env.put("CLASSPATH", CLASSPATH); // env.remove("LD_LIBRARY_PATH"); // env.put("LD_LIBRARY_PATH", LD_LIBRARY_PATH); // ALSO DO: // LD_LIBRARY_PATH pb.directory(new File(wd)); pb.redirectErrorStream(true); lf = new File(log); pb.redirectOutput(Redirect.appendTo(lf)); Process p = pb.start(); assert p.getInputStream().read() == -1; if (!returnString) { assert pb.redirectInput() == Redirect.PIPE; assert pb.redirectOutput().file() == lf; } r.err = "OS Process started."; r.OK = true; try { r.Status = p.exitValue(); r.err = "OS Process completed."; } catch (IllegalThreadStateException e) { } } catch (IOException e) { r.err += "\nIOException while accessing IO stream: "+ e.toString(); r.OK = false; } if ((r.Status == 0) &amp;&amp; (r.OK)) { r.err = "Success"; } else { if (r.Status != 0) { r.err += "Process exit status: "+r.Status; } System.out.print(r.err); } return r; } </code></pre> <p>Oh yes, and as per the usual, cygcheck -s information follows, snipped a little. More on request as the whole dataset is huge and probably uninteresting. </p> <blockquote> <p>Cygwin Configuration Diagnostics Current System Time: Thu Dec 05 04:08:40 2013 Windows 7 Professional N Ver 6.1 Build 7600<br> Running under WOW64 on AMD64 Path: C:\Program Files\Java\jdk1.7.0\bin C:\opt\bin C:\cygwin\usr\local\bin C:\cygwin\bin C:\Program Files (x86)\Android\android-sdk\platform-tools C:\Program Files\PostgreSQL\9.3\bin C:\Program Files\Java\jdk1.7.0\bin C:\Program Files (x87)\PC Connectivity Solution C:\windows\system32 C:\windows C:\windows\System32\Wbem C:\windows\System32\WindowsPowerShell\v1.0 C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn C:\Program Files (x86)\Toshiba\Bluetooth Toshiba Stack\sys C:\Program Files (x86)\Toshiba\Bluetooth Toshiba Stack\sys\x64 C:\Program Files\Intel\WiFi\bin C:\Program Files\Common Files\Intel\WirelessCommon C:\cygwin\bin C:\Program Files\PostgreSQL\9.3\bin C:\cygwin\lib\lapack </p> <pre><code>Cygwin DLL version info: DLL version: 1.8.4 DLL epoch: 19 DLL old termios: 5 DLL malloc env: 28 Cygwin conv: 181 API major: 0 API minor: 262 Shared data: 5 DLL identifier: cygwin1 Mount registry: 3 Cygwin registry name: Cygwin Program options name: Program Options Installations name: Installations Cygdrive default prefix: Build date: Shared id: cygwin1S5 &lt;snip&gt; </code></pre> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload