• About Us
  • Blog
  • Basket
  • Account
  • Sign In
  •  

Forums

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 02 May 2018 09:58 AM by  JoshGrew
basic_string::_S_construct null not valid
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

INFOnline



New Member


Posts:1
New Member


--
18 Apr 2018 04:03 PM
    I'm trying to get 51degrees running on CentOS/Fedora. Both CentOS7 with php5 and Fedora27 with php7 are behaving the same way. After compiling the module and configuring the ini-file, I always get the following error:
    terminate called after throwing an instance of 'std::logic_error'
    what(): basic_string::_S_construct null not valid
    It doesn't matter what kind of module, pattern or trie or what kind of php-version.

    [root@localhost trie]# phpize
    Configuring for:
    PHP Api Version: 20100412
    Zend Module Api No: 20100525
    Zend Extension Api No: 220100525

    [root@localhost trie]# ./configure
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for cc... cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking whether cc understands -c and -o together... yes
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for PHP prefix... /usr
    checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
    checking for PHP extension directory... /usr/lib64/php/modules
    checking for PHP installed headers prefix... /usr/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... no
    configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking for gawk... gawk
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking how to run the C++ preprocessor... g++ -E
    checking whether to enable 51Degrees Detector... yes, shared
    checking how to print strings... printf
    checking for a sed that does not truncate output... (cached) /usr/bin/sed
    checking for fgrep... /usr/bin/grep -F
    checking for ld used by cc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking whether the shell understands some XSI constructs... yes
    checking whether the shell understands "+="... yes
    checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
    checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking for gawk... (cached) gawk
    checking command to parse /usr/bin/nm -B output from cc object... ok
    checking for sysroot... no
    checking for mt... no
    checking if : is a manifest tool... no
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if cc supports -fno-rtti -fno-exceptions... no
    checking for cc option to produce PIC... -fPIC -DPIC
    checking if cc PIC flag -fPIC -DPIC works... yes
    checking if cc static flag -static works... no
    checking if cc supports -c -o file.o... yes
    checking if cc supports -c -o file.o... (cached) yes
    checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    checking how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... /usr/bin/ld -m elf_x86_64
    checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
    checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking for g++ option to produce PIC... -fPIC -DPIC
    checking if g++ PIC flag -fPIC -DPIC works... yes
    checking if g++ static flag -static works... no
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking dynamic linker characteristics... (cached) GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    mkdir: cannot create directory 'src': File exists
    mkdir: cannot create directory 'src/php5': File exists
    configure: creating ./config.status
    config.status: creating config.h
    config.status: executing libtool commands

    [root@localhost trie]# make install
    /bin/sh /usr/local/src/Device-Detection/php/trie/libtool --mode=compile cc -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -lrt -c /usr/local/src/Device-Detection/php/trie/src/threading.c -o src/threading.lo
    libtool: compile: cc -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -lrt -c /usr/local/src/Device-Detection/php/trie/src/threading.c -fPIC -DPIC -o src/.libs/threading.o
    /bin/sh /usr/local/src/Device-Detection/php/trie/libtool --mode=compile cc -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -lrt -c /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees.c -o src/trie/51Degrees.lo
    libtool: compile: cc -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -lrt -c /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees.c -fPIC -DPIC -o src/trie/.libs/51Degrees.o
    /bin/sh /usr/local/src/Device-Detection/php/trie/libtool --mode=compile g++ -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp -o src/trie/51Degrees_PHP.lo
    libtool: compile: g++ -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp -fPIC -DPIC -o src/trie/.libs/51Degrees_PHP.o
    In file included from /usr/include/php/main/php_ini.h:24:0,
    from /usr/include/php/main/fopen_wrappers.h:26,
    from /usr/include/php/main/php.h:398,
    from /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:751:
    /usr/include/php/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    #define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
    ^
    /usr/include/php/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
    #define PHP_INI_END ZEND_INI_END
    ^
    /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:1141:2: note: in expansion of macro 'PHP_INI_END'
    PHP_INI_END()
    ^
    /usr/include/php/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    #define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
    ^
    /usr/include/php/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
    #define PHP_INI_END ZEND_INI_END
    ^
    /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:1141:2: note: in expansion of macro 'PHP_INI_END'
    PHP_INI_END()
    ^
    /usr/include/php/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    #define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
    ^
    /usr/include/php/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
    #define PHP_INI_END ZEND_INI_END
    ^
    /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:1141:2: note: in expansion of macro 'PHP_INI_END'
    PHP_INI_END()
    ^
    /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp: In function 'int zm_startup_FiftyOneDegreesTrieV3(int, int)':
    /usr/include/php/Zend/zend_ini.h:159:71: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    #define INI_STR(name) zend_ini_string_ex((name), sizeof(name), 0, NULL)
    ^
    /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:4667:19: note: in expansion of macro 'INI_STR'
    char *filePath = INI_STR("FiftyOneDegreesTrieV3.data_file");
    ^
    /usr/include/php/Zend/zend_ini.h:159:71: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    #define INI_STR(name) zend_ini_string_ex((name), sizeof(name), 0, NULL)
    ^
    /usr/local/src/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:4668:23: note: in expansion of macro 'INI_STR'
    char *propertyList = INI_STR("FiftyOneDegreesTrieV3.property_list");
    ^
    /bin/sh /usr/local/src/Device-Detection/php/trie/libtool --mode=compile g++ -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/Device-Detection/php/trie/src/trie/Provider.cpp -o src/trie/Provider.lo
    libtool: compile: g++ -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/Device-Detection/php/trie/src/trie/Provider.cpp -fPIC -DPIC -o src/trie/.libs/Provider.o
    /bin/sh /usr/local/src/Device-Detection/php/trie/libtool --mode=compile g++ -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/Device-Detection/php/trie/src/trie/Match.cpp -o src/trie/Match.lo
    libtool: compile: g++ -I. -I/usr/local/src/Device-Detection/php/trie -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/Device-Detection/php/trie/src/trie/Match.cpp -fPIC -DPIC -o src/trie/.libs/Match.o
    /bin/sh /usr/local/src/Device-Detection/php/trie/libtool --mode=link g++ -DPHP_ATOM_INC -I/usr/local/src/Device-Detection/php/trie/include -I/usr/local/src/Device-Detection/php/trie/main -I/usr/local/src/Device-Detection/php/trie -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -lrt -o FiftyOneDegreesTrieV3.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/src/Device-Detection/php/trie/modules src/threading.lo src/trie/51Degrees.lo src/trie/51Degrees_PHP.lo src/trie/Provider.lo src/trie/Match.lo
    libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginS.o src/.libs/threading.o src/trie/.libs/51Degrees.o src/trie/.libs/51Degrees_PHP.o src/trie/.libs/Provider.o src/trie/.libs/Match.o -lrt -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o -O2 -Wl,-soname -Wl,FiftyOneDegreesTrieV3.so -o .libs/FiftyOneDegreesTrieV3.so
    libtool: link: ( cd ".libs" && rm -f "FiftyOneDegreesTrieV3.la" && ln -s "../FiftyOneDegreesTrieV3.la" "FiftyOneDegreesTrieV3.la" )
    /bin/sh /usr/local/src/Device-Detection/php/trie/libtool --mode=install cp ./FiftyOneDegreesTrieV3.la /usr/local/src/Device-Detection/php/trie/modules
    libtool: install: cp ./.libs/FiftyOneDegreesTrieV3.so /usr/local/src/Device-Detection/php/trie/modules/FiftyOneDegreesTrieV3.so
    libtool: install: cp ./.libs/FiftyOneDegreesTrieV3.lai /usr/local/src/Device-Detection/php/trie/modules/FiftyOneDegreesTrieV3.la
    libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/src/Device-Detection/php/trie/modules
    ----------------------------------------------------------------------
    Libraries have been installed in:
    /usr/local/src/Device-Detection/php/trie/modules

    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the `-LLIBDIR'
    flag during linking and do at least one of the following:
    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
    during execution
    - add LIBDIR to the `LD_RUN_PATH' environment variable
    during linking
    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
    - have your system administrator add LIBDIR to `/etc/ld.so.conf'

    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ----------------------------------------------------------------------
    Installing shared extensions: /usr/lib64/php/modules/

    [root@localhost trie]# cat /etc/php.d/fiftyonedegrees.ini
    extension=/usr/lib64/php/modules/FiftyOneDegreesTrieV3.so
    FiftyOneDegreesPatternV3.data_file=/usr/share/nginx/51Degrees-EnterpriseV3.4.trie
    FiftyOneDegreesPatternV3.property_list=BrowserName,BrowserVendor,BrowserVersion,DeviceType,HardwareVendor,IsTablet,IsMobile,IsCrawler,ScreenInchesDiagonal,ScreenPixelsWidth
    FiftyOneDegreesPatternV3.cache_size=10000
    FiftyOneDegreesPatternV3.pool_size=20

    [root@localhost trie]# php -v
    terminate called after throwing an instance of 'std::logic_error'
    what(): basic_string::_S_construct null not valid
    Aborted
    0

    JoshGrew



    New Member


    Posts:18
    New Member


    --
    20 Apr 2018 10:08 AM
    Hi There

    In the example you have provided there are settings for Pattern within the ini file but with a Hash Trie module and data file. This will throw the error.

    You will want to have the following to your ini file and remove the rest:

    extension=/usr/lib64/php/modules/FiftyOneDegreesTrieV3.so
    FiftyOneDegreesTrieV3.data_file=/usr/share/nginx/51Degrees-EnterpriseV3.4.trie
    FiftyOneDegreesTrieV3.property_list=BrowserName,BrowserVendor,BrowserVersion,DeviceType,HardwareVendor,IsTablet,IsMobile,IsCrawler,ScreenInchesDiagonal,ScreenPixelsWidth

    cache_size and pool_size are not available settings within the Hash module as it does not use worksets and fetching a result from the cache will slow down the matching as opposed to just calling from the data file.

    However, you have mentioned that this happens on Pattern also. Are you able to send the above details for this issue so I can take a look.
    0

    JoshGrew



    New Member


    Posts:18
    New Member


    --
    02 May 2018 09:58 AM
    Just following up to see how you are getting on?

    Any questions let me know.
    0
    You are not authorized to post a reply.