Project

Profile

Help

Bug #5228

closed

Saxon-C example dir and Saxon-C and/or documentation is out of sync?

Added by Øyvind Liland Gjesdal almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Category:
C API
Start date:
2022-01-24
Due date:
% Done:

100%

Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
1.2.1
Fixed in version:
11.1
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:

Description

This may be a user error, but I've followed the current documentation, to set up a working saxon-c, to test running the examples:

FROM rockylinux

# Set required environment vars
ENV SAXONC_VERSION=1.2.1
ENV SAXONC_DEST=/opt/
ENV SAXONC_HOME=/usr/lib

WORKDIR /opt
RUN dnf -y update && \
dnf -y clean all && \
dnf -y groupinstall "Development Tools"
# Begin saxon-c getting started guide https://www.saxonica.com/saxon-c/documentation1.2/index.html#!starting/installing/installingLinux
RUN curl -o libsaxon-HEC-setup64-v${SAXONC_VERSION}.zip https://www.saxonica.com/saxon-c/libsaxon-HEC-setup64-v${SAXONC_VERSION}.zip && ls  && \
unzip libsaxon-HEC-setup64-v${SAXONC_VERSION}.zip && pwd  && \
./libsaxon-HEC-setup64-v${SAXONC_VERSION} -batch && ls
WORKDIR /opt/Saxonica/SaxonHEC${SAXONC_VERSION}
RUN cp libsaxonhec.so /usr/lib/. && \
cp -r rt /usr/lib/. && \
cp -r saxon-data /usr/lib/.

# build example apps for C https://www.saxonica.com/saxon-c/documentation1.2/index.html#!samples/samples_c
WORKDIR /opt/Saxonica/SaxonHEC${SAXONC_VERSION}/samples/cTests
# Attempts to work around 32-64 bit changes, commented out
#RUN chmod +x buildhec.sh && \
#./buildhec.sh && \
#chmod +x build64-linux.sh &&  \
#./build64-linux.sh && ls -alh && chmod +x testXSLT && \
#./testXPATH
# Failing instructions from https://www.saxonica.com/saxon-c/documentation1.2/index.html#!samples/samples_c
RUN ./build.sh

This results in:

In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCGlue.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXSLT.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCGlue.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXQuery.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCGlue.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ../../Saxon.C.API/jni/jni.h:39,
                 from ../../Saxon.C.API/SaxonCGlue.h:11,
                 from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.h:4,
                 from testXPath.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
Error: error building at STEP "RUN ./build.sh": error while running runtime: exit status 1

This looks from my limited googling like it is connected Saxon-C removing 32 bit support?

I tried working around it, by using some of the other shell files present (see comments in Dockerfile), but I did not succeed and t is not a field I am very familiar with.

Best regards, Øyvind


Files

testXQuery.c (1.69 KB) testXQuery.c O'Neil Delpratt, 2022-01-25 10:59
testXSLT.c (1.63 KB) testXSLT.c O'Neil Delpratt, 2022-01-25 10:59
Actions #1

Updated by O'Neil Delpratt almost 3 years ago

  • Category set to C API
  • Status changed from New to AwaitingInfo
  • Assignee set to O'Neil Delpratt
  • Priority changed from Low to Normal

Hi,

Saxon/C no longer supports 32-bit machines. We would need to build a 32-bit version of the crossed compiled SaxonC library.

Please can you explain what you are trying to do?

Actions #2

Updated by O'Neil Delpratt almost 3 years ago

It looks like there is a bug against the documentation. The shell script file in the installer is up-to-date.

Actions #3

Updated by Øyvind Liland Gjesdal almost 3 years ago

I am going through the documentation. The main idea was to get the examples to work and then to continue from there.

After trying first the documentation, I guessed (wrongly?) I could try

./build64-linux.sh

The output doesn't return an error code, but none of the binaries are built, and the output is:

../../Saxon.C.API/SaxonCProcessor.c: In function 'xsltApplyStylesheet':
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'executeQueryToString':
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
testXSLT.c: In function 'main':
testXSLT.c:35:24: warning: passing argument 1 of 'initDefaultJavaRT' from incompatible pointer type [-Wincompatible-pointer-types]
     initDefaultJavaRT (&environi);
                        ^~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXSLT.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'sxnc_environment **' {aka 'struct <anonymous> **'}
 void initDefaultJavaRT(sxnc_environment * env);
                        ~~~~~~~~~~~~~~~~~~~^~~
testXSLT.c:39:32: error: incompatible type for argument 1 of 'integerValue'
     jobject num = integerValue(*environi, 5);
                                ^~~~~~~~~
In file included from testXSLT.c:2:
../../Saxon.C.API/SaxonCXPath.h:30:40: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'sxnc_environment' {aka 'struct <anonymous>'}
 jobject integerValue(sxnc_environment* environi, int i);
                      ~~~~~~~~~~~~~~~~~~^~~~~~~~
testXSLT.c:43:46: error: incompatible type for argument 1 of 'xsltApplyStylesheet'
     const char *result = xsltApplyStylesheet(environi, &processor, NULL, "cat.xml","test.xsl", 0 ,0, 0, 0);
                                              ^~~~~~~~
In file included from testXSLT.c:1:
../../Saxon.C.API/SaxonCProcessor.h:33:14: note: expected 'sxnc_environment' {aka 'struct <anonymous>'} but argument is of type 'sxnc_environment *' {aka 'struct <anonymous> *'}
 const char * xsltApplyStylesheet(sxnc_environment environi, sxnc_processor ** proc, char * cwd, const char * source, const char* stylesheet, sxnc_parameter *parameters, sxnc_property * properties, int parLen, int propLen);
              ^~~~~~~~~~~~~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'xsltApplyStylesheet':
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'executeQueryToString':
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
testXQuery.c: In function 'main':
testXQuery.c:36:24: warning: passing argument 1 of 'initDefaultJavaRT' from incompatible pointer type [-Wincompatible-pointer-types]
     initDefaultJavaRT (&environi);
                        ^~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXQuery.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'sxnc_environment **' {aka 'struct <anonymous> **'}
 void initDefaultJavaRT(sxnc_environment * env);
                        ~~~~~~~~~~~~~~~~~~~^~~
testXQuery.c:45:48: error: incompatible type for argument 1 of 'executeQueryToString'
     const char * result = executeQueryToString(environi, &processor, NULL, 0,properties,0,propLen);
                                                ^~~~~~~~
In file included from testXQuery.c:1:
../../Saxon.C.API/SaxonCProcessor.h:37:14: note: expected 'sxnc_environment' {aka 'struct <anonymous>'} but argument is of type 'sxnc_environment *' {aka 'struct <anonymous> *'}
 const char * executeQueryToString(sxnc_environment environi, sxnc_processor ** proc, char * cwd, sxnc_parameter *parameters, sxnc_property * properties, int parLen, int propLen);
              ^~~~~~~~~~~~~~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'xsltApplyStylesheet':
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'executeQueryToString':
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
testXPath.c: In function 'main':
testXPath.c:34:24: warning: passing argument 1 of 'initDefaultJavaRT' from incompatible pointer type [-Wincompatible-pointer-types]
     initDefaultJavaRT (&environi);
                        ^~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.h:4,
                 from testXPath.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'sxnc_environment **' {aka 'struct <anonymous> **'}
 void initDefaultJavaRT(sxnc_environment * env);                        ~~~~~~~~~~~~~~~~~~~^~~

Actions #4

Updated by O'Neil Delpratt almost 3 years ago

  • Status changed from AwaitingInfo to In Progress
  • Found in version set to 1.2.1

Thanks for reporting this issue. There is a bug in the C API. I have reproduced the failure, which has been fixed in the development code already for the next release.`

This only appears in the C API. The C++ API is unaffected.

Currently looking at a workaround for the C API.

Actions #5

Updated by O'Neil Delpratt almost 3 years ago

Please ignore my last message. The failure is actually in the samples. I have attached the patched testXSLT.c and testXQuery.c files to this bug issue.

Actions #6

Updated by Øyvind Liland Gjesdal almost 3 years ago

Thank you.

I added a copy stage, before building

COPY testXSLT.c testXQuery.c .

and now I get new datestamps/built testXSLT and testXQuery files.

However I still get a verbose output during the build:

../../Saxon.C.API/SaxonCProcessor.c: In function 'xsltApplyStylesheet':
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'executeQueryToString':
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
testXSLT.c: In function 'main':
testXSLT.c:35:24: warning: passing argument 1 of 'initDefaultJavaRT' from incompatible pointer type [-Wincompatible-pointer-types]
     initDefaultJavaRT (&environi);
                        ^~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXSLT.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'sxnc_environment **' {aka 'struct <anonymous> **'}
 void initDefaultJavaRT(sxnc_environment * env);
                        ~~~~~~~~~~~~~~~~~~~^~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'xsltApplyStylesheet':
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'executeQueryToString':
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
testXQuery.c: In function 'main':
testXQuery.c:36:24: warning: passing argument 1 of 'initDefaultJavaRT' from incompatible pointer type [-Wincompatible-pointer-types]
     initDefaultJavaRT (&environi);
                        ^~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXQuery.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'sxnc_environment **' {aka 'struct <anonymous> **'}
 void initDefaultJavaRT(sxnc_environment * env);
                        ~~~~~~~~~~~~~~~~~~~^~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'xsltApplyStylesheet':
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function 'executeQueryToString':
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of 'checkForException' from incompatible pointer type [-Wincompatible-pointer-types]
     checkForException( *(environi.env), cpp);
                        ^~~~~~~~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:14: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'JNIEnv' {aka 'const struct JNINativeInterface_ *'}
 const char * checkForException(sxnc_environment *environi, jobject callingObject);
              ^~~~~~~~~~~~~~~~~
testXPath.c: In function 'main':
testXPath.c:34:24: warning: passing argument 1 of 'initDefaultJavaRT' from incompatible pointer type [-Wincompatible-pointer-types]
     initDefaultJavaRT (&environi);
                        ^~~~~~~~~
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.h:4,
                 from testXPath.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected 'sxnc_environment *' {aka 'struct <anonymous> *'} but argument is of type 'sxnc_environment **' {aka 'struct <anonymous> **'}
 void initDefaultJavaRT(sxnc_environment * env);
                        ~~~~~~~~~~~~~~~~~~~^~~

and when I run

./testXSLT

for the last step, I get *container exited on segmentation fault

Actions #7

Updated by Øyvind Liland Gjesdal almost 3 years ago

I'll do a local build to see if that changes anything

Actions #8

Updated by Øyvind Liland Gjesdal almost 3 years ago

I got the same error when running the steps locally

./build64-linux.sh
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet’:
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  191 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘executeQueryToString’:
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  309 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
testXSLT.c: In function ‘main’:
testXSLT.c:35:24: warning: passing argument 1 of ‘initDefaultJavaRT’ from incompatible pointer type [-Wincompatible-pointer-types]
   35 |     initDefaultJavaRT (&environi);
      |                        ^~~~~~~~~
      |                        |
      |                        sxnc_environment **
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXSLT.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected ‘sxnc_environment *’ but argument is of type ‘sxnc_environment **’
  165 | void initDefaultJavaRT(sxnc_environment * env);
      |                        ~~~~~~~~~~~~~~~~~~~^~~
testXSLT.c:43:46: error: incompatible type for argument 1 of ‘xsltApplyStylesheet’
   43 |     const char *result = xsltApplyStylesheet(environi, &processor, NULL, "cat.xml","test.xsl", 0 ,0, 0, 0);
      |                                              ^~~~~~~~
      |                                              |
      |                                              sxnc_environment *
In file included from testXSLT.c:1:
../../Saxon.C.API/SaxonCProcessor.h:33:51: note: expected ‘sxnc_environment’ but argument is of type ‘sxnc_environment *’
   33 | const char * xsltApplyStylesheet(sxnc_environment environi, sxnc_processor ** proc, char * cwd, const char * source, const char* stylesheet, sxnc_parameter *parameters, sxnc_property * properties, int parLen, int propLen);
      |                                  ~~~~~~~~~~~~~~~~~^~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet’:
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  191 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘executeQueryToString’:
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  309 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
testXQuery.c: In function ‘main’:
testXQuery.c:36:24: warning: passing argument 1 of ‘initDefaultJavaRT’ from incompatible pointer type [-Wincompatible-pointer-types]
   36 |     initDefaultJavaRT (&environi);
      |                        ^~~~~~~~~
      |                        |
      |                        sxnc_environment **
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXQuery.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected ‘sxnc_environment *’ but argument is of type ‘sxnc_environment **’
  165 | void initDefaultJavaRT(sxnc_environment * env);
      |                        ~~~~~~~~~~~~~~~~~~~^~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet’:
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  191 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘executeQueryToString’:
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  309 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
testXPath.c: In function ‘main’:
testXPath.c:34:24: warning: passing argument 1 of ‘initDefaultJavaRT’ from incompatible pointer type [-Wincompatible-pointer-types]
   34 |     initDefaultJavaRT (&environi);
      |                        ^~~~~~~~~
      |                        |
      |                        sxnc_environment **
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.h:4,
                 from testXPath.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected ‘sxnc_environment *’ but argument is of type ‘sxnc_environment **’
  165 | void initDefaultJavaRT(sxnc_environment * env);
      |                        ~~~~~~~~~~~~~~~~~~~^~~
[oyvind@localhost cTests]$ vi testXpath^C
[oyvind@localhost cTests]$ sudo vi testXSLT.c 
[oyvind@localhost cTests]$ sudo vi testXSLT.c 
[oyvind@localhost cTests]$ sudo ./build64-linux.sh
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet’:
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  191 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘executeQueryToString’:
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  309 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
testXSLT.c: In function ‘main’:
testXSLT.c:35:24: warning: passing argument 1 of ‘initDefaultJavaRT’ from incompatible pointer type [-Wincompatible-pointer-types]
   35 |     initDefaultJavaRT (&environi);
      |                        ^~~~~~~~~
      |                        |
      |                        sxnc_environment **
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXSLT.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected ‘sxnc_environment *’ but argument is of type ‘sxnc_environment **’
  165 | void initDefaultJavaRT(sxnc_environment * env);
      |                        ~~~~~~~~~~~~~~~~~~~^~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet’:
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  191 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘executeQueryToString’:
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  309 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
testXQuery.c: In function ‘main’:
testXQuery.c:36:24: warning: passing argument 1 of ‘initDefaultJavaRT’ from incompatible pointer type [-Wincompatible-pointer-types]
   36 |     initDefaultJavaRT (&environi);
      |                        ^~~~~~~~~
      |                        |
      |                        sxnc_environment **
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from testXQuery.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected ‘sxnc_environment *’ but argument is of type ‘sxnc_environment **’
  165 | void initDefaultJavaRT(sxnc_environment * env);
      |                        ~~~~~~~~~~~~~~~~~~~^~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet’:
../../Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  191 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘executeQueryToString’:
../../Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types]
  309 |     checkForException( *(environi.env), cpp);
      |                        ^~~~~~~~~~~~~~~
      |                        |
      |                        JNIEnv {aka const struct JNINativeInterface_ *}
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/SaxonCGlue.h:214:50: note: expected ‘sxnc_environment *’ but argument is of type ‘JNIEnv’ {aka ‘const struct JNINativeInterface_ *’}
  214 | const char * checkForException(sxnc_environment *environi, jobject callingObject);
      |                                ~~~~~~~~~~~~~~~~~~^~~~~~~~
testXPath.c: In function ‘main’:
testXPath.c:34:24: warning: passing argument 1 of ‘initDefaultJavaRT’ from incompatible pointer type [-Wincompatible-pointer-types]
   34 |     initDefaultJavaRT (&environi);
      |                        ^~~~~~~~~
      |                        |
      |                        sxnc_environment **
In file included from ../../Saxon.C.API/SaxonCProcessor.h:4,
                 from ../../Saxon.C.API/SaxonCXPath.h:4,
                 from testXPath.c:1:
../../Saxon.C.API/SaxonCGlue.h:165:43: note: expected ‘sxnc_environment *’ but argument is of type ‘sxnc_environment **’
  165 | void initDefaultJavaRT(sxnc_environment * env);
      |                        ~~~~~~~~~~~~~~~~~~~^~~

./testXSLT

Segmentation fault (core dumped)

Actions #9

Updated by O'Neil Delpratt almost 3 years ago

  • Status changed from AwaitingInfo to Resolved
  • % Done changed from 0 to 100
  • Fixed in version set to 11.1

The C API examples have been fixed in SaxonC 11.1. There have also been related bug issues fixed which will go out in SaxonC 11.2

Actions #10

Updated by Debbie Lockett almost 3 years ago

  • Status changed from Resolved to Closed

Closing now related bug fixes applied in the Saxon 11.2 maintenance release.

Please register to edit this issue

Also available in: Atom PDF