SYSTEM ERROR: Memory violation. (49) as one user

Posted by MABeatty1978 on 31-Oct-2016 13:01

I've got a C shared object that I'm calling from Progress.  I'm calling the Progress (using /$DLC/bin/mpro) application from Java Runtime.exec.  When I'm running the java application as user root, I get a memory violation: 

All Rights ReservedOpenEdge Release 10.2A as of Fri Oct 31 20:01:39 EDT 2008SYSTEM ERROR: Memory violation. (49)** Save file named core for analysis by Progress Software Corporation. (439)

I can see in the core file that it is in fact the shared object that is having the problem.

What has me puzzled, however, is that it only happens when running the Progress program as root through the Java application.  If I use my other user, it works fine.  If I run it as root from a command line using the same mpro call, it works fine.

Any help would be appreciated.

Posted by MABeatty1978 on 01-Nov-2016 06:49

Yes, that is exactly what the root problem was.  I don't understand all the details, but for whatever reason Java didn't have access to the $HOSTNAME environment variable which the C library needed.  So while I was able to run it through Progress (which did have access to the variable), running it through Java caused a null memory violation.

Thank you for the help.

All Replies

Posted by Brian K. Maher on 31-Oct-2016 13:08

Is it possible that something is different in the OS environment variables between the two ways that you are executing the shared library that end up causing a wrong library to be loaded (i.e. some library that your library needs)?

Posted by George Potemkin on 31-Oct-2016 13:15

How to avoid common issues with Progress SQL-92 Server

knowledgebase.progress.com/.../21552

The recomendations in the article may be applied to this case as well.

If root starts Progress executables, _sqlsrv2 may not be able to find shared libraries in $DLC/lib directory on some platforms even when environment variables are set correctly. This is because some OS have implemented a security mechanism that only allows root to load shared libraries from /usr/lib directory.  Add a soft link to this directory if this is the case. 

Posted by MABeatty1978 on 01-Nov-2016 06:49

Yes, that is exactly what the root problem was.  I don't understand all the details, but for whatever reason Java didn't have access to the $HOSTNAME environment variable which the C library needed.  So while I was able to run it through Progress (which did have access to the variable), running it through Java caused a null memory violation.

Thank you for the help.

This thread is closed