[Glass] GemBuilder for C compilation on 3.6.1

Iwan Vosloo iwan at reahl.org
Sun Jun 20 23:45:01 PDT 2021


Hi Bill,

Sorry, I should have stated that to start with:

#0  0x0000000000000000 in ?? ()
#1  0x0000562e0511a0e6 in main () at test.c:10

(Thats the call to GciTsEncrypt. I have this issue with any call I make, 
hence the simple test case.)

Thank you
Iwan

On 2021/06/20 20:42, Bill Erickson wrote:
> Can you show us the C stack trace at the point of the SIGSEGV?
> 
> ------------------------------------------------------------------------
> Bill Erickson
> GemTalk Systems Engineering
> 15220 NW Greenbrier Parkway #240, Beaverton OR 97006
> ------------------------------------------------------------------------
> 
> 
> On Sun, Jun 20, 2021 at 2:03 AM Iwan Vosloo via Glass 
> <glass at lists.gemtalksystems.com <mailto:glass at lists.gemtalksystems.com>> 
> wrote:
> 
>     Hi all,
> 
>     I am trying to compile C code that calls GemBuilder for C functions.
>     I take inspiration from
>     https://downloads.gemtalksystems.com/docs/GemStone64/3.6.x/GS64-GemBuilderforC-3.6.pdf
>     <https://downloads.gemtalksystems.com/docs/GemStone64/3.6.x/GS64-GemBuilderforC-3.6.pdf>
> 
>     sections 5.2 and 5.3.
> 
>     I am doing this on Ubuntu 20.04, using g++ 9.3.0 all of which are
>     supported according to the above doc.
> 
>     I also have installed GemStone64Bit3.6.1-x86_64.Linux
> 
>     I have a simplified test program that just calls a simple function from
>     libgcits. I can compile and link, but when I run the resultant program
>     it segfaults when I callthe Gci function. I have to confess that I
>     haven't touched C in 20 years, so I am probably doing stupid things. (I
>     had this working with GemStone 3.4.1)
> 
>     Here is my program (test.c):
> 
>     #include <stdio.h>
>     #include <gcits.hf>
> 
>     int main() {
>         const char *unencrypted_password = "abcde";
>         char *out_buff;
>         char *encrypted_password;
>         int encrypted_char;
>         unsigned int out_buff_size = 1000;
>         out_buff = (char *)malloc(out_buff_size * sizeof(char));
>         GciTsEncrypt(unencrypted_password, out_buff, out_buff_size);
>         free(out_buff);
>         return 0;
>     }
> 
>     I build it using this makefile:
> 
>     COMPILE_FLAGS=-fmessage-length=0 -fcheck-new -O3 -ggdb -m64 -pipe \
>                     -D_REENTRANT -D_GNU_SOURCE -pthread -fPIC \
>                     -fno-strict-aliasing -fno-exceptions -x c++
> 
>     LINK_FLAGS=-m64 -Wl,-Bdynamic,--no-as-needed -lpthread -Wl,--as-needed \
>                  -lcrypt -ldl -lc -lm -lrt -Wl,-traditional -Wl,-z,lazy
> 
>     all:
>              g++ -I${GEMSTONE}/include ${COMPILE_FLAGS} -c test.c -o test.o
>              g++ -L${GEMSTONE}/lib -lgcits-3.6.1-64 ${LINK_FLAGS} test.o
>     -o test
> 
> 
>     The options above are taken from 5.3 of the doc, except that I link
>     gcits-3.6.1-64 library directly instead of using the run time
>     loading as
>     is explained earlier in the doc.
> 
>     What am I missing here?
> 
>     Regards
>     Iwan
> 
>     -- 
> 
> 
>     _______________________________________________
>     Glass mailing list
>     Glass at lists.gemtalksystems.com <mailto:Glass at lists.gemtalksystems.com>
>     https://lists.gemtalksystems.com/mailman/listinfo/glass
>     <https://lists.gemtalksystems.com/mailman/listinfo/glass>
> 


-- 



More information about the Glass mailing list