ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Segmentation fault ChartDirector PHP API with php 5.6 on alpine
Posted by ndh on May-17-2018 23:31
In our development we use docker and I want to use ChartDirector with php 5.6 on alpine.
But when I load ChartDirector I get an error: "child pid 83 exit signal Segmentation fault (11)"

I included libchartdir.so & phpchartdir560.dll and used the gliderlabs/alpine image (which includs apache 2.4) and loaded these extensions: php5-apache2 curl php5-cli php5-json php5-mysql php5-mysqli php5-pdo php5-pdo_mysql php5-phar php5-openssl php5-ctype php5-intl

Any hint how to debug this?

  Re: Segmentation fault ChartDirector PHP API with php 5.6 on alpine
Posted by Peter Kwan on May-18-2018 18:49
Hi ndh,

I have never used docket or "gliderlabs/alpine image" before. I searched the Internet and it seems to be some kind of special compiled minimal Linux.

My general experience with this type of "minimal" Linux is that sometimes they lack some common libraries that are considered to be always available on Linux. (Unlike other OS, Linux is open source and there is no centralized distribution. So everyone can modify and compile some special Linux.) This type of Linux may not be able to run many other programs, other than the programs that are specially compiled for that Linux.

For ChartDirector, it needs the standard C library "libc.so", standard math library "libm.so" and the library that supports handling shared objects "libdl.so". You can use "ldd libchartdir.so" to check if these shared libraries can be found on the Linux. (Some "minimal" Linux may not even have the "ldd" command - that's why the Linux can be so small.)

Regards
Peter Kwan

  Re: Segmentation fault ChartDirector PHP API with php 5.6 on alpine
Posted by ndh on May-18-2018 19:05
If I run ldd it shows:

ldd /usr/lib/php5/modules/libchartdir.so
ldd (0x7fafbdf84000)
libdl.so.2 => ldd (0x7fafbdf84000)
libm.so.6 => ldd (0x7fafbdf84000)
libc.so.6 => ldd (0x7fafbdf84000)
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_GetIP: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: __isinf: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_Resume_or_Rethrow: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_GetRegionStart: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: __wcstod_internal: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: __wcstoul_internal: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_Resume: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_DeleteException: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_RaiseException: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_SetIP: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: __wcstol_internal: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: __strtod_internal: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_GetTextRelBase: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_GetLanguageSpecificData: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_SetGR: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: __isnan: symbol not found
Error relocating /usr/lib/php5/modules/libchartdir.so: _Unwind_GetDataRelBase: symbol not found

  Re: Segmentation fault ChartDirector PHP API with php 5.6 on alpine
Posted by ndh on May-18-2018 19:05
Sorry I forgot: Thank you very much for the quick answer ;-)

  Re: Segmentation fault ChartDirector PHP API with php 5.6 on alpine
Posted by Peter Kwan on May-19-2018 01:09
Hi ndh,

The ldd output is quite strange. It seems the ldd is trying to use itself to replace the "libc.so", "libm.so" and "libdl.so". Unluckily, the "ldd" does not have certain symbols that are expected to be available in the gcc implementation of these libraries. (The gcc implementation of libc is called "glibc".) I think it is similar to the issue mentioned below:

https://github.com/gliderlabs/docker-alpine/issues/149

Our code never uses the symbols in the error message. They are automatically referenced when the code is compiled by the gcc compiler. (As gcc is the standard toolchain on Linux, it is expected these symbols be available on Linux.) May be you can try to see if you can find the standard libc, libm and libdl for your Linux. (The link above seems to suggest there are some available for Alpine Linux.

Regards
Peter Kwan