Code Monkey home page Code Monkey logo

51degrees / device-detection Goto Github PK

View Code? Open in Web Editor NEW
111.0 111.0 46.0 509.82 MB

THE Fastest and most Accurate device detection for C / PHP / Perl / Python and Node.js - professionally maintained device data

Home Page: https://51degrees.com/device-detection

License: Other

Makefile 0.84% C 21.87% C# 10.21% C++ 52.37% Batchfile 0.19% JavaScript 2.16% Perl 1.52% Python 2.44% Shell 0.20% PHP 3.45% HTML 0.06% M4 0.17% CMake 0.07% Java 1.12% Lua 0.30% VCL 0.03% Go 2.72% SWIG 0.26% ASP.NET 0.03%

device-detection's People

Contributors

ben51degrees avatar joseph51d avatar joshgrew51d avatar jotich avatar justadreamer avatar kirstin51d avatar otternq avatar steve51d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

device-detection's Issues

Node version must be >= 6.5 and <= 12.

Expected Behavior

To be able to install fiftyonedegreescore in a project based on Node.js 14, the current Long Term Support (LTS) version.

Current Behavior

If your active Node install is 14.x and either run yarn/npm install on a repo with the latest version of fiftyonedegreescore as a dependency or if you try to add the latest version of fiftyonedegreescore to a new repo, the install fails with the following error:

/clickster-admin/node_modules/fiftyonedegreescore/versionCheck.js:28
        throw "Node version must be >= 6.5 and <= 12.";
        ^
Node version must be >= 6.5 and <= 12.

trie: expose more useful variables and functions

Hey @51Degrees,
see this commit 51Degrees/51degrees.node@7028545 from 51degrees.node..

Node is a v8 program, so it has built-in json/js library, in this case the processDeviceJSON will be expensive(convert to string, and call JSON.parse).

So I do implement the dataSet iterator at c++ part, it's more faster and scale.

Caveat in Trie

In trie mode, you use few static variables like _requiredPropertiesNames, _requiredPropertiesCount etc, those variables/functions cannot be accessed from any other places, it caused difficult to implement a parser based on v8 api.

To address the issue, i injected your source code to expose those variables/functions what i'd like to use in my parser function, however it's hacky, so i'm looking forward this change will be merged into c library.

Another problem with your processDeviceJSON

see 51Degrees/51degrees.node#6
I'm inspired by this issue that says "Kindle Fire HDX 7" (3rd Gen)" should be converted to "Kindle Fire HDX 7\" (3rd Gen)", this maybe a bug of c library or data? I'm unsure this problem.

Nginx Not Releasing Deleted Data Files

Our nginx.conf has the entry '51D_filePath /etc/51Degrees/51Degrees-EnterpriseV3_2.dat'. We update this file daily and reload Nginx, but it seems the nginx processes don't release the deleted files, many of which can be viewed by running 'lsof | grep deleted'. These files eventually fill our disks unless we restart (rather than reload) the Nginx service. Nginx Plus support also tell me that the the master process should reopen the file on reload, and if not there may be a bug in the module.

Nginx headers

Hello, right now I can see following headers in instructions

add_header x-device $http_x_device;
add_header x-mobile $http_x_mobile;
add_header x-tablet $http_x_tablet;
add_header x-smartphone $http_x_smartphone;
add_header x-metrics $http_x_metrics;

Is there any other headers? Like hardwareModel, hardwareFamily, browserName etc. ?

Varnish Device-Detection module crashes with OperaMini custom request headers

Hi,

We have a Varnish (varnish-4.1.10 revision 1d090c5a08f41c36562644bafcce9d3cb85d824f)
production environment with 51Degrees device detection module installed (last version and last database) handmade compiled.
99% of received request are working fine but a simple request can made the service crash...
We found that Opera-Mini for Android send a lot of custom headers per request and some of this headers make 52Degrees to crash (SegFault).

Backtrace :
"Assert error in child_signal_handler(), mgt/mgt_child.c line 296: Condition(Signal 11 (Segmentation fault) received at (nil) si_code 128) not true. thread = (cache-worker) version = varnish-4.1.10 revision 1d090c5a08f41c36562644bafcce9d3cb85d824f ident = Linux,4.4.0-87-generic,x86_64,-junix,-smalloc,-smalloc,-hcritbit,epoll now = 96182.163202 (mono), 1543491228.981447 (real) Backtrace: 0x4346c1: pan_ic+0x191 0x454f2c: varnishd() [0x454f2c] 0x7f95cdbf0390: libpthread.so.0(+0x11390) [0x7f95cdbf0390] 0x7f95bd9f8320: libvmod_fiftyonedegrees.so(fiftyoneDegreesGetHttpHeaderCount+0) [0x7f95bd9f8320] 0x7f95bd9f5e14: libvmod_fiftyonedegrees.so(setImportantHeaders+0x54) [0x7f95bd9f5e14] 0x7f95bd9f5fe9: libvmod_fiftyonedegrees.so(vmod_match_all+0x69) [0x7f95bd9f5fe9] 0x7f95c1dd023c: vgc.so(VGC_function_vcl_recv+0x3fc) [0x7f95c1dd023c] 0x440b9c: vcl_call_method+0x1fc 0x442eba: VCL_recv_method+0x5a 0x437f0e: CNT_Request+0xcfe

Problematic Request Headers :

\"X-Clacks-Overhead: GNU ph\", \"X-OperaMini-Phone-UA: Mozilla/5.0 (Linux; Android 6.0; MYA-L03 Build/HUAWEIMYA-L03; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4. \"X-OperaMini-Features: advanced, camera, download, file_system, folding, httpping, pingback, routing, touch, viewport\", \"X-OperaMini-Phone: Android #\",

You can try to reproduce this error sending a GET request to a document with some of above headers.

Error downloading object: 20000 Evidence Records.yml

Cloning failed because of the 20000 Evidence Records.yml file when I tried to clone the repository.

/ # git clone https://github.com/51Degrees/device-detection-data
Cloning into 'device-detection-data'...
remote: Enumerating objects: 125, done.
remote: Counting objects: 100% (125/125), done.
remote: Compressing objects: 100% (110/110), done.
remote: Total 125 (delta 36), reused 101 (delta 14), pack-reused 0
Receiving objects: 100% (125/125), 21.65 KiB | 2.41 MiB/s, done.
Resolving deltas: 100% (36/36), done.
Downloading 20000 Evidence Records.yml (4.2 MB)
Error downloading object: 20000 Evidence Records.yml (ed53f4f): Smudge error: Error downloading 20000 Evidence Records.yml (ed53f4fdccc763e143dfeaacfbb9652583ceb277bd791bd7543df7318ca647a1): batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.

Errors logged to '/device-detection-data/.git/lfs/logs/20230417T080817.4354716.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: 20000 Evidence Records.yml: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

Node v12 Version Support

Hi,

We are currently lifting the NodeJS Version in our infrastructure to NodeJS v12. We noticed that fiftyonedegreescore has a node versionCheck.js. So every npm install with a version >= v10.0.0 will be aborted with an error. Installing without the versionCheck results in this error:

node.js git:(master) ✗ npm install fiftyonedegreescore/

> [email protected] preinstall /Users/martin.karrer/Documents/Development/devicedetection/Device-Detection/node.js/node_modules/fiftyonedegreescore
> node versionCheck.js

12.5

> [email protected] install /Users/martin.karrer/Documents/Development/devicedetection/Device-Detection/node.js/node_modules/fiftyonedegreescore
> node-gyp configure && node-gyp build

  CC(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/51Degrees.o
../src/pattern/51Degrees.c:1469:8: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
static const int32_t getSignatureNodeOffsetsCount(const fiftyoneDegreesDataSet *dataSet, const byte *signature) {
       ^~~~~~
../src/pattern/51Degrees.c:1507:8: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
static const int32_t getRankFromSignature(const fiftyoneDegreesDataSet *dataSet, const byte *signature) {
       ^~~~~~
../src/pattern/51Degrees.c:3170:12: warning: unused function 'resultsetCacheValidate' [-Wunused-function]
static int resultsetCacheValidate(const fiftyoneDegreesResultsetCache *cache) {
           ^
3 warnings generated.
  CC(target) Release/obj.target/FiftyOneDegreesPatternV3/src/cityhash/city.o
  CXX(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/Provider.o
../src/pattern/Provider.cpp:200:3: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
                delete properties;
                ^
                      []
../src/pattern/Provider.cpp:187:28: note: allocated with 'new[]' here
        const char **properties = new const char*[propertiesArray.size()];
                                  ^
1 warning generated.
  CXX(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/Match.o
../src/pattern/Match.cpp:145:5: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
    delete buffer;
    ^
          []
../src/pattern/Match.cpp:139:20: note: allocated with 'new[]' here
    char *buffer = new char[ws->dataSet->header.maxUserAgentLength];
                   ^
../src/pattern/Match.cpp:160:5: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
    delete buffer;
    ^
          []
../src/pattern/Match.cpp:157:20: note: allocated with 'new[]' here
    char *buffer = new char[bufferSize];
                   ^
2 warnings generated.
  CXX(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/Profiles.o
  CC(target) Release/obj.target/FiftyOneDegreesPatternV3/src/threading.o
  CXX(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/51Degrees_node.o
../src/pattern/51Degrees_node.cpp:874:47: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
  SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_STRING_NEW(msg)));
                                              ^
../src/pattern/51Degrees_node.cpp:823:44: note: expanded from macro 'SWIGV8_STRING_NEW'
#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str)
                                           ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pattern/51Degrees_node.cpp:909:7: error: no template named 'Handle' in namespace 'v8'
  v8::Handle<v8::Value> err;
  ~~~~^
../src/pattern/51Degrees_node.cpp:904:32: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    err = v8::Exception::Error(SWIGV8_STRING_NEW(msg));
                               ^
../src/pattern/51Degrees_node.cpp:823:44: note: expanded from macro 'SWIGV8_STRING_NEW'
#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str)
                                           ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pattern/51Degrees_node.cpp:974:65: error: expected '(' for function-style cast or type construction
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                      ~~~~~~~~~~^
../src/pattern/51Degrees_node.cpp:974:48: error: no member named 'Handle' in namespace 'v8'
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                           ~~~~^
../src/pattern/51Degrees_node.cpp:974:67: error: use of undeclared identifier 'objRef'
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                  ^
../src/pattern/51Degrees_node.cpp:974:80: error: expected '(' for function-style cast or type construction
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                          ~~~~ ^
../src/pattern/51Degrees_node.cpp:974:82: error: use of undeclared identifier 'ptr'
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                 ^
../src/pattern/51Degrees_node.cpp:974:87: error: unexpected type name 'swig_type_info': expected expression
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                      ^
../src/pattern/51Degrees_node.cpp:974:103: error: use of undeclared identifier 'info'
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                                      ^
../src/pattern/51Degrees_node.cpp:974:113: error: expected '(' for function-style cast or type construction
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                                            ~~~ ^
../src/pattern/51Degrees_node.cpp:974:119: error: expected ';' after top level declarator
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                                                      ^
                                                                                                                      ;
../src/pattern/51Degrees_node.cpp:1247:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
SWIGRUNTIMEINLINE
^
../src/pattern/51Degrees_node.cpp:214:40: note: expanded from macro 'SWIGRUNTIMEINLINE'
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
                                       ^
../src/pattern/51Degrees_node.cpp:55:23: note: expanded from macro 'SWIGINLINE'
#   define SWIGINLINE inline
                      ^
../src/pattern/51Degrees_node.cpp:1248:44: error: expected '(' for function-style cast or type construction
int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
                                  ~~~~~~~~~^
../src/pattern/51Degrees_node.cpp:1248:28: error: no member named 'Handle' in namespace 'v8'
int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
                       ~~~~^
../src/pattern/51Degrees_node.cpp:1248:46: error: use of undeclared identifier 'valRef'
int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
                                             ^
../src/pattern/51Degrees_node.cpp:1248:53: error: expected ';' after top level declarator
int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
                                                    ^
                                                    ;
../src/pattern/51Degrees_node.cpp:1443:17: error: no template named 'Handle' in namespace 'v8'
SWIGRUNTIME v8::Handle<v8::FunctionTemplate> SWIGV8_CreateClassTemplate(const char* symbol) {
            ~~~~^
../src/pattern/51Degrees_node.cpp:1447:31: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    class_templ->SetClassName(SWIGV8_SYMBOL_NEW(symbol));
                              ^
../src/pattern/51Degrees_node.cpp:824:44: note: expanded from macro 'SWIGV8_SYMBOL_NEW'
#define SWIGV8_SYMBOL_NEW(sym) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym)
                                           ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pattern/51Degrees_node.cpp:1449:34: error: expected '(' for function-style cast or type construction
    v8::Handle<v8::ObjectTemplate> inst_templ = class_templ->InstanceTemplate();
               ~~~~~~~~~~~~~~~~~~^
../src/pattern/51Degrees_node.cpp:1449:9: error: no member named 'Handle' in namespace 'v8'
    v8::Handle<v8::ObjectTemplate> inst_templ = class_templ->InstanceTemplate();
    ~~~~^
../src/pattern/51Degrees_node.cpp:1449:36: error: use of undeclared identifier 'inst_templ'; did you mean 'class_templ'?
    v8::Handle<v8::ObjectTemplate> inst_templ = class_templ->InstanceTemplate();
                                   ^~~~~~~~~~
                                   class_templ
../src/pattern/51Degrees_node.cpp:1446:37: note: 'class_templ' declared here
    v8::Local<v8::FunctionTemplate> class_templ = SWIGV8_FUNCTEMPLATE_NEW_VOID();
                                    ^
../src/pattern/51Degrees_node.cpp:1450:5: error: use of undeclared identifier 'inst_templ'
    inst_templ->SetInternalFieldCount(1);
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4 warnings and 20 errors generated.
make: *** [Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/51Degrees_node.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/12.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /Users/martin.karrer/Documents/Development/devicedetection/Device-Detection/node.js/fiftyonedegreescore
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/Users/martin.karrer/Documents/Development/devicedetection/Device-Detection/node.js/package.json'
npm WARN node.js No description
npm WARN node.js No repository field.
npm WARN node.js No README data
npm WARN node.js No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/martin.karrer/.npm/_logs/2019-07-08T17_18_42_777Z-debug.log

Current System:
19.0.0 Darwin Kernel Version 19.0.0: Thu Jun 13 21:52:56 PDT 2019; root:xnu-6110.0.0.121.5~2/RELEASE_X86_64 x86_64
same on 4.4.0-1069-aws #79-Ubuntu SMP Mon Sep 24 15:01:41 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Is there any ETA for NodeJS v12.x.x Support?

HAProxy support seems to be broken with new htx represenation enabled

We switched from HAProxy 1.9.10 to 2.0.12 and enabled the new htx representation. This option seems to break the device detection. With htx disabled it works as expected. I opened haproxy/haproxy#450 as well.

haproxy.cfg

global
  chroot /tmp/haproxy
  user haproxy
  group haproxy

  51degrees-data-file /tmp/haproxy/51Degrees-PremiumV3.4.trie
  51degrees-property-name-list IsMobile LayoutEngine ScreenPixelsHeight ScreenPixelsWidth DeviceType HardwareFamily HardwareName PlatformName JavascriptVersion BrowserName BrowserVersion IsCrawler

defaults
  mode http
  #no option http-use-htx


frontend foo
  bind *:10000
  http-request set-header X-51D-DeviceType %[51d.all(DeviceType)]
  http-request set-header X-51D-HardwareFamily %[51d.all(HardwareFamily)]
  http-request set-header X-51D-PlatformName %[51d.all(PlatformName)]
  http-request set-header X-51D-LayoutEngine %[51d.all(LayoutEngine)]
  http-request set-header X-51D-JavascriptVersion %[51d.all(JavascriptVersion)]
  http-request set-header X-51D-BrowserName %[51d.all(BrowserName)]
  http-request set-header X-51D-BrowserVersion %[51d.all(BrowserVersion)]
  http-request set-header X-51D-IsCrawler %[51d.all(IsCrawler)]

  http-request set-header Host httpbin.org
  default_backend bar


backend bar
  # httpbin.org
  server s1 34.193.212.251:80
  server s2 54.172.95.6:80

actual behaviour

$ curl -H "accept: application/json" http://127.1:10000/anything
{
  "args": {}, 
  "data": "", 
  "files": {}, 
  "form": {}, 
  "headers": {
    "Accept": "application/json", 
    "Host": "httpbin.org", 
    "User-Agent": "curl/7.29.0", 
    "X-51D-Browsername": "1", 
    "X-51D-Browserversion": "1", 
    "X-51D-Devicetype": "1", 
    "X-51D-Hardwarefamily": "1", 
    "X-51D-Iscrawler": "1", 
    "X-51D-Javascriptversion": "1", 
    "X-51D-Layoutengine": "1", 
    "X-51D-Platformname": "1"
  }, 
  "json": null, 
  "method": "GET", 
  "origin": "<deducted>", 
  "url": "https://httpbin.org/anything"
}

expected behaviour

$ curl -H "accept: application/json" http://127.1:10000/anything
{
  "args": {}, 
  "data": "", 
  "files": {}, 
  "form": {}, 
  "headers": {
    "Accept": "application/json", 
    "Host": "httpbin.org", 
    "User-Agent": "curl/7.29.0", 
    "X-51D-Browsername": "Unknown Crawler", 
    "X-51D-Browserversion": "Unknown", 
    "X-51D-Devicetype": "Desktop", 
    "X-51D-Hardwarefamily": "Emulator", 
    "X-51D-Iscrawler": "True", 
    "X-51D-Javascriptversion": "Unknown", 
    "X-51D-Layoutengine": "Unknown", 
    "X-51D-Platformname": "Unknown"
  }, 
  "json": null, 
  "method": "GET", 
  "origin": "<deducted>", 
  "url": "https://httpbin.org/anything"
}

Bad Detections

Using node.js client

Mozilla/5.0 (iPad; CPU OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPad5,3;FBMD/iPad;FBSN/iOS;FBSV/13.7;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5] Mozilla/5.0 (iPad; CPU OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPad7,5;FBMD/iPad;FBSN/iOS;FBSV/13.5.1;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5]

Returns Axxxx instead of iPad for hardwaremodel

Mozilla/5.0 (iPad; CPU OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148

Throws exception when parsing that agent

Error: in method 'EvidenceBaseSwig_set', argument 3 of type 'std::string const &'

Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone13,2;FBMD/iPhone;FBSN/iOS;FBSV/14.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5]

devicetype = desktop, should be phone

get DeviceId by ProfileId, get ProfileId by DeviceId

Sorry for this issue, but I have read all documentation a few times(many times) and didn't find any related info.
I have 2 question:

  1. I have ProfileId( e.g 11625), how I can get DeviceId?
  2. I have DeviceId (e.g 91279-80764-84765-18092), how I can get ProfileId?

Could not build pattern with GCC 8

With gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1~18.10) i could not build pattern, was getting errors like this:

src/http/modules/ngx_http_proxy_module.c: In function ‘ngx_http_proxy_init_headers’:
src/http/modules/ngx_http_proxy_module.c:3528:22: error: cast between incompatible function types from ‘size_t (*)(ngx_http_script_engine_t *)’ {aka ‘long unsigned int (*)(struct <anonymous> *)’} to ‘void (*)(ngx_http_script_engine_t *)’ {aka ‘void (*)(struct <anonymous> *)’} [-Werror=cast-function-type]
         copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;

It solved with workaround from official repo, see changeset. Replace the source files to changed files from nginx repo and the pattern will be compiled.

The data file '51Degrees-LiteV4.1.hash' could not be found

Hi,
I cloned the device-detection-cxx repository with:
git clone --recurse-submodules https://github.com/51Degrees/device-detection-cxx.git
and everything works fine.
Now when I try to reference the API from my C program. It gives me this error when I run the program:
The data file '51Degrees-LiteV4.1.hash' could not be found. Check the file path and that the program has sufficient read permissions.

I built the libraries with CMake, then added to the lib folder of my project and added it to my makefile.
I don't know why this happens, sorry but I'm new to programming in C, maybe I' doing this in the wrong way.
Thanks in advice.

Slow test during nginx -t with version R11.

nginx/1.11.5 (nginx-plus-r11): We have noticed that after doing an nginx -t command, the configuration test results take time to come back when the 51Degree module pattern is loaded vs. when it is not. Is this is a normal behavior?

Crash php7.0 with installed module.

Hi,
I am trying to run php7 with builded module.

OS: Debian GNU/Linux 8.10 (jessie)
GCC version 4.9.2
PHP 7.0

Module is installed is successfully.
But when run it with module gets same error:

terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Aborted

Cannot use hash trie data file on Node.js 8.9.3 using module version 3.2.18-dev

using this config

const fiftyonedegreescoreConfig = {

 dataFile: 'static/51degrees/51Degrees-EnterpriseV3.4.trie',
 properties: [
   'HardwareVendor', 
   'HardwareModel', 
   'HardwareFamily', 
   'PriceBand', 
   'PlatformName', 
   'PlatformVersion', 
   'ScreenPixelsHeight', 
   'ScreenPixelsWidth',
   'ReleaseMonth',
   'ReleaseYear',
   'DeviceType',
   'HardwareModelVariants',
 ],
 cacheSize: 10000,
 poolSize: 20,
}
const provider = DeviceDetection.provider(fiftyonedegreescoreConfig) //Error was throw here
const match =  provider.getMatch(ctx.header['user-agent'])
match.close()

Error: Illegal arguments for construction of _exports_Provider
Please help

Does not build for node 7.10.1 WeakCallbackData does not exist

When attempting to install with Node 7.10.1 the compile step fails due to missing template WeakCallbackData (see below). Node 7 > has changed the api and deprecated some of the modules and classes.

It would be great to get an update so this will work.

Reproduction

  • Install node 7.10.1
  • npm install fiftyonedegreescore

Here are some of the errors :
../src/pattern/51Degrees_node.cpp:966:27: error: no template named 'WeakCallbackData' in namespace 'v8'; did you mean 'WeakCallbackInfo'?
void (*dtor) (const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data);
~~~~^~~~~~~~~~~~~~~~
WeakCallbackInfo
/Users/robert/.node-gyp/7.10.1/include/node/v8.h:7475:16: note: 'WeakCallbackInfo' declared here
friend class WeakCallbackInfo;
^
../src/pattern/51Degrees_node.cpp:966:27: error: too many template arguments for class template 'WeakCallbackInfo'
void (*dtor) (const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data);
^ ~~~~~~~~~~~~~
/Users/robert/.node-gyp/7.10.1/include/node/v8.h:7475:16: note: template is declared here
friend class WeakCallbackInfo;
^
../src/pattern/51Degrees_node.cpp:1014:53: error: no template named 'WeakCallbackData' in namespace 'v8'; did you mean 'WeakCallbackInfo'?
SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) {
~~~~^~~~~~~~~~~~~~~~
WeakCallbackInfo

Issues building for PHP7 in Docker

Hello,

I am currently having issues installing the PHP extension API inside of a Dockerized environment running php-fpm.

Here is the system I'm working in:

Ubuntu 16.04
PHP 7.0.3
g++ 5.4.0

Unlike the other PHP7 issues that I've researched while trying to debug this, I'm not hitting any errors when running make install. A few warnings are generated (see below), but the extension is still compiled and installed into the correct directory. We have been able to observe an error when PHP loads the extension (also below) that causes the container to terminate itself on startup because of a thrown instance of std::logic_error.

I've tried installing and compiling swig from the source as mentioned in previous PHP7 issues. I am able to verify that version 4.0.0 is installed into /usr/local/share/swig/[swig version]/, however even with version 4, I can still observe the warnings being generated during make install and the container still terminates.

Build Process

# Install and compile [email protected] (PHP7 support)
RUN cd / && \
    git clone https://github.com/swig/swig.git

RUN cd swig && \
    sh ./autogen.sh && \
    ./configure && \
    make && \
    make install

# Clean up
RUN cd / && \
    rm -rf swig

# Install & configure the 51Degrees extension
RUN cd / && \
    git clone https://github.com/51Degrees/Device-Detection.git

RUN cd Device-Detection/php/pattern && \
    phpize && \
    ./configure PHP7=1 && \
    make install

Warnings

In file included from /usr/include/php/20151012/main/php_ini.h:24:0,
                 from /usr/include/php/20151012/main/fopen_wrappers.h:26,
                 from /usr/include/php/20151012/main/php.h:391,
                 from /Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:751:
/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp: In function ‘int zm_startup_FiftyOneDegreesPatternV3(int, int)’:
/usr/include/php/20151012/Zend/zend_ini.h:141:73: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 #define INI_STR(name) zend_ini_string_ex((name), sizeof(name)-1, 0, NULL)
                                                                         ^
/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:4807:19: note: in expansion of macro ‘INI_STR’
  char *filePath = INI_STR("FiftyOneDegreesPatternV3.data_file");
                   ^
/usr/include/php/20151012/Zend/zend_ini.h:139:62: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 #define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
                                                              ^
/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:4808:17: note: in expansion of macro ‘INI_INT’
  int poolSize = INI_INT("FiftyOneDegreesPatternV3.pool_size");
                 ^
/usr/include/php/20151012/Zend/zend_ini.h:139:62: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 #define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
                                                              ^
/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:4809:18: note: in expansion of macro ‘INI_INT’
  int cacheSize = INI_INT("FiftyOneDegreesPatternV3.cache_size");
                  ^
/usr/include/php/20151012/Zend/zend_ini.h:141:73: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 #define INI_STR(name) zend_ini_string_ex((name), sizeof(name)-1, 0, NULL)
                                                                         ^
/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:4810:23: note: in expansion of macro ‘INI_STR’
  char *propertyList = INI_STR("FiftyOneDegreesPatternV3.property_list");

Docker Logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 99-change-ownership: executing...
[cont-init.d] 99-change-ownership: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Allowing for debug
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

Thoughts on what I might be missing here?

wrong matching Chrome 80.x, Edge 80.x (new); 51Degrees-PremiumV3.4.trie

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36

{
  "fifty_one_degrees": {
    "profile_id": 15364,
    "native_platform": "",
    "is_smart_phone": false,
    "is_crawler": false,
    "crawler_name": "NotCrawler",
    "device_type": "Desktop",
    "browser_name": "Chrome",
    "browser_version": "51", <====
    "platform_name": "Windows",
    "platform_version": "10.0",
    "hardware_vendor": "Unknown",
    "hardware_name": [
      "Emulator",
      "Desktop"
    ]
  }
}

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 Edg/80.0.361.48

{
 "profile_id": 15364,
        "native_platform": "",
        "is_smart_phone": false,
        "is_crawler": false,
        "crawler_name": "NotCrawler",
        "device_type": "Desktop",
        "browser_name": "Chrome", <====
        "browser_version": "Unknown", <====
        "platform_name": "Windows",
        "platform_version": "10.0",
        "hardware_vendor": "Unknown",
        "hardware_name": [
          "Emulator",
          "Desktop"
        ],
        "hardware_model": "Unknown"
  }
}

2/5/2020 | Premium | HashTrieV​34 | 42.74MB | 9e8f0822144aa2a6c90943445f3e3fa6
I didn't have that issue with `BinaryV32`.


Unable to load Database

Error: Allocated continuous memory containing 51Degrees data file appears to be smaller than expected. Most likely because the data file was not fully loaded into the allocated memory

Nginx module problem

I am using 51 degrees built as nginx loadable module. But each time I turn on it I've got and error

2017/08/11 12:01:41 [alert] 27799#27799: *37513 open socket #3121 left in connection 3108
2017/08/11 12:01:41 [alert] 27799#27799: *38522 open socket #1001 left in connection 3123
2017/08/11 12:01:41 [alert] 27799#27799: *37847 open socket #3138 left in connection 3125
2017/08/11 12:01:41 [alert] 27799#27799: *38171 open socket #3173 left in connection 3160
2017/08/11 12:01:41 [alert] 27799#27799: *38211 open socket #3186 left in connection 3173

nginx.conf

load_module "/etc/nginx/modules/ngx_http_51D_module.so";
user www-data;
worker_processes auto;
pid /var/run/nginx.pid;
worker_rlimit_nofile 65536;
events {
        use epoll;
        worker_connections 32768;
        multi_accept on;
}
http {
	51D_filePath /etc/nginx/data/51Degrees-PremiumV3_2.dat;
        51D_cache 10000;
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 30;
        keepalive_requests 100;
        types_hash_max_size 2048;
        client_body_timeout 10;
        send_timeout 2;
        reset_timedout_connection on;

        include /etc/nginx/mime.types;
	server_tokens off;

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";
        gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

This is location

location / {
        proxy_pass         http://mysite.com;
        proxy_http_version 1.1;
        proxy_pass_header       Server;
        proxy_set_header   X-Real-IP          $remote_addr;
        proxy_set_header   X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header   X_FORWARDED_PROTO  $scheme;
        proxy_set_header   Host               $host;
        proxy_set_header   Connection         "";
	##51D
 	51D_match_single x-hardware-name HardwareName;
#        51D_match_single x-hardware-family HardwareFamily;
#        51D_match_single x-hardware-model HardwareModel;
#        51D_match_single x-hardware-vendor HardwareVendor;
#
#        51D_match_single x-device-type DeviceType;
#        51D_match_single x-browser-name BrowserName;
#        51D_match_single x-browser-version BrowserVersion;
#
#        51D_match_single x-platform-name PlatformName;
#        51D_match_single x-platform-version PlatformVersion;
#        51D_match_single x-platform-vendor PlatformVendor;
#
#        ## Do a multiple HTTP header match for IsMobile, IsTablet and IsSmartphone ##
#        51D_match_all x-mobile IsMobile;
#        51D_match_all x-tablet IsTablet;
#        51D_match_all x-smartphone IsSmartPhone;
#
#        51D_match_all x-crawler IsCrawler;
#        51D_match_all x-html5 HTML5;
#        51D_match_all x-layout-engine LayoutEnginee;
#
#        ## Do a multiple HTTP header match for match metrics ##
#        51D_match_all x-device-id DeviceId;

        access_log off;
	error_log off;
}

dynamic module for nginx 1.10.3

Good afternoon,
I'm dealing with problems while making dynamic module for Nginx [version 1.10.3]. Your readme says

51Degrees dynamic module can be used in Nginx version 1.9.11 or later. It is important to check you have '--with-compat' available within your configure arguments.

Dynamic modules were indeed introduced in nginx 1.9.11 but --with-compat option is available from version 1.11.5.
Using
make module trie VERSION=1.10.3
or
make install trie VERSION=1.10.3
I get

if [ -d "51Degrees_module/src" ]; then
rm -rf 51Degrees_module/src;
fi
if [ -d "build" ]; then
rm -rf build;
fi
if [ -f "nginx" ]; then
rm -f nginx;
fi
if [ -f "vendor/nginx-1.10.3/Makefile" ]; then
cd /home/martinrepa/Stažené/Device-Detection-3.2.18.5/nginx/vendor/nginx-1.10.3 && make clean;
fi
if [ -d "tests/nginx-tests" ]; then
rm -r tests/nginx-tests;
fi;
mkdir -p 51Degrees_module/src/trie
if [ -d "51Degrees_module/src/pattern" ]; then
mkdir -p 51Degrees_module/src/cityhash &&
cp ../src/cityhash/* 51Degrees_module/src/cityhash/ ;
fi
exit
cp module_conf/trie_config 51Degrees_module/config
cp ../src/trie/51Degrees.c 51Degrees_module/src/trie/
cp ../src/trie/51Degrees.h 51Degrees_module/src/trie/
if [ ! -d "vendor/nginx-1.10.3" ]; then make get-source; fi
cd /home/martinrepa/Stažené/Device-Detection-3.2.18.5/nginx/vendor/nginx-1.10.3 &&
./configure
--prefix=/home/martinrepa/Stažené/Device-Detection-3.2.18.5/nginx/build
--with-ld-opt="-lm"
--add-dynamic-module=/home/martinrepa/Stažené/Device-Detection-3.2.18.5/nginx/51Degrees_module
--with-compat
--with-cc-opt="-DFIFTYONEDEGREES_TRIE -DFIFTYONEDEGREES_NO_THREADING"
--with-debug
--sbin-path=/home/martinrepa/Stažené/Device-Detection-3.2.18.5/nginx
--conf-path="nginx.conf"
./configure: error: invalid option "--with-compat"

Am I missing something or shall I get the dynamic module for my nginx in a different way (I cannot use different nginx version)?
Thanks for your response.

Node.js Module stuck at provider.getMatch() on 3.2.18-dev

Hi,

I'm 51degrees premium data customer. I'm found problem if call provider.getMatch() 5 times Node will stuck. It seems that If I increase poolSize to 10 It will stuck at 11th getMatch function call.

I'm using npm install fiftyonedegreescore@dev
and run on node.js 8.6

Thank you

import * as fiftyonedegrees from 'fiftyonedegreescore'
const provider = fiftyonedegrees.provider({
  dataFile: '...',
  cacheSize: 10000,
  poolSize: 4,
})
provider.getMatch(ctx.header['user-agent'])
provider.getMatch(ctx.header['user-agent'])
provider.getMatch(ctx.header['user-agent'])
provider.getMatch(ctx.header['user-agent'])
provider.getMatch(ctx.header['user-agent']) // Process stuck here

Nginx Scope for 51D_match_all directive

Currently this is scoped to only the location context, which means you must include the directive for every single path in your Nginx config. It would be super useful to have this available at the http,server,location and possibly even if in location contexts.

trie vs dat

Hi there.

Just signed up for free version to try out trie database and for some reason the results differ vastly.
Used this UA to test against: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36

DETECTION_METHOD = 'v3-trie-wrapper':

{
 'AnimationTiming': 'True',
 'BlobBuilder': 'True',
 'BrowserName': 'Unknown',
 'BrowserPropertySource': 'RingMark',
 'BrowserVersion': 'Unknown',
 'Canvas': 'True',
 'CssBackground': 'True',
 'CssBorderImage': 'True',
 'CssCanvas': 'Unknown',
 'CssColor': 'True',
 'CssColumn': 'Unknown',
 'CssFlexbox': 'True',
 'CssFont': 'True',
 'CssImages': 'True',
 'CssMediaQueries': 'True',
 'CssMinMax': 'True',
 'CssOverflow': 'True',
 'CssPosition': 'True',
 'CssText': 'True',
 'CssTransforms': 'True',
 'CssTransitions': 'True',
 'CssUI': 'True',
 'DataSet': 'True',
 'DataUrl': 'True',
 'DeviceOrientation': 'True',
 'FileReader': 'True',
 'FileSaver': 'Unknown',
 'FileWriter': 'Unknown',
 'FormData': 'True',
 'Fullscreen': 'True',
 'GeoLocation': 'True',
 'History': 'True',
 'Html-Media-Capture': 'True',
 'Html5': 'True',
 'Id': '15364-18110-17470-18092',
 'Iframe': 'True',
 'IndexedDB': 'True',
 'IsEmulatingDesktop': 'False',
 'IsMobile': 'False',
 'JavascriptImageOptimiser': blablabla,
 'Json': 'True',
 'LayoutEngine': 'Unknown',
 'Masking': 'True',
 'Meter': 'Unknown',
 'PlatformName': 'Linux',
 'PlatformVersion': 'Unknown',
 'PostMessage': 'True',
 'Progress': 'True',
 'Promise': 'None',
 'Prompts': 'True',
 'ScreenPixelsHeight': 'Unknown',
 'ScreenPixelsHeightJavaScript': '',
 'ScreenPixelsWidth': 'Unknown',
 'ScreenPixelsWidthJavaScript': '',
 'Selector': 'True',
 'SupportsWebGL': 'Unknown',
 'Svg': 'True',
 'TouchEvents': 'True',
 'Track': 'True',
 'Video': 'True',
 'Viewport': 'True',
 'WebWorkers': 'True',
 'Xhr2': 'True'
}

And DETECTION_METHOD = 'v3-wrapper':

{'AnimationTiming': 'True',
 'BlobBuilder': 'True',
 'BrowserName': 'Chrome',
 'BrowserPropertySource': 'Caniuse',
 'BrowserVersion': '70',
 'Canvas': 'True',
 'CssBackground': 'True',
 'CssBorderImage': 'False',
 'CssCanvas': 'False',
 'CssColor': 'True',
 'CssColumn': 'True',
 'CssFlexbox': 'True',
 'CssFont': 'True',
 'CssImages': 'False',
 'CssMediaQueries': 'True',
 'CssMinMax': 'True',
 'CssOverflow': 'True',
 'CssPosition': 'True',
 'CssText': 'True',
 'CssTransforms': 'True',
 'CssTransitions': 'True',
 'CssUI': 'True',
 'DataSet': 'True',
 'DataUrl': 'True',
 'DeviceOrientation': 'False',
 'Difference': 1,
 'FileReader': 'True',
 'FileSaver': 'Unknown',
 'FileWriter': 'Unknown',
 'FormData': 'True',
 'Fullscreen': 'False',
 'GeoLocation': 'True',
 'History': 'True',
 'Html-Media-Capture': 'True',
 'Html5': 'True',
 'Id': '15364-18110-86672-18092',
 'Iframe': 'True',
 'IndexedDB': 'True',
 'IsEmulatingDesktop': 'N/A',
 'IsMobile': 'False',
 'JavascriptImageOptimiser': blablabla,
 'Json': 'True',
 'LayoutEngine': 'Blink',
 'Masking': 'False',
 'MatchMethod': 3,
 'Meter': 'True',
 'PlatformName': 'Linux',
 'PlatformVersion': 'Unknown',
 'PostMessage': 'True',
 'Progress': 'True',
 'Promise': 'Full',
 'Prompts': 'True',
 'Rank': 7415,
 'ScreenPixelsHeight': 'Unknown',
 'ScreenPixelsHeightJavaScript': blablabla,
 'ScreenPixelsWidth': 'Unknown',
 'ScreenPixelsWidthJavaScript': blablabla,
 'Selector': 'True',
 'SupportsWebGL': 'True',
 'Svg': 'True',
 'TouchEvents': 'True',
 'Track': 'True',
 'Video': 'True',
 'Viewport': 'True',
 'WebWorkers': 'True',
 'Xhr2': 'True'
}

While the trie database works amazingly fast and it would be a great deal for some high load, it looks inferior in detecting some important stuff for me. More precisely, the browser info is missing.

Could you shed some light on this, please? Was it me misconfiguring or misusing something, maybe?

I'm using python 3.6

databases:
51Degrees-LiteV3.2.dat
51Degrees-LiteV3.4.trie

packages:
51degrees-mobile-detector==3.2.18.4
51degrees-mobile-detector-v3-trie-wrapper==3.2.18.4
51degrees-mobile-detector-v3-wrapper==3.2.18.4

script example:

from fiftyone_degrees import mobile_detector
ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36'
device = mobile_detector.match(ua)

the settings are left as is in default values, except database paths changed

Python quit unexpectedly (Mac, fiftyone_degrees_mobile_detector_v3_wrapper)

Hi, there. Thank you for your very nice job.
This is report for you:
Python libs has been Installed from source from master branch. But version from pypi affected too.

Code:

def populate_db_init():
    import os
    from settings import ABSPATH
    from collections import OrderedDict
    from FiftyOneDegrees import fiftyone_degrees_mobile_detector_v3_wrapper
    from fiftyone_degrees.mobile_detector.conf import settings
    dataFile = os.path.join(ABSPATH, 'data', '51degrees', '51Degrees-PremiumV3_2.dat')
    properties = settings.PROPERTIES
    cacheSize = settings.CACHE_SIZE
    poolSize = settings.POOL_SIZE
    provider = fiftyone_degrees_mobile_detector_v3_wrapper.Provider(
        dataFile,
        properties,
        cacheSize,
        poolSize
    )
    profiles = provider.findProfiles("IsMobile", "True")
    print("There are %d mobile profiles in the %s data file." % (profiles.getCount(), provider.getDataSetName()))
    for profile_index in reversed(range(0, profiles.getCount())):
        DeviceId = profiles.getProfileId(profile_index)
        device_object = provider.getMatchForDeviceId("%s" % DeviceId)
        item = OrderedDict([
            ('HardwareVendor', device_object.getValue('HardwareVendor')),
            ('HardwareModel', device_object.getValue('HardwareModel')),
            ('HardwareName', device_object.getValue('HardwareName') or None),
            ('HardwareFamily', device_object.getValue('HardwareFamily') or None),
            ('HardwareProfileSource', device_object.getValue('HardwareProfileSource') or None),
        ])
        print(dict(item), profile_index)
    return ### <<< HAPPENED HERE


if __name__ == '__main__':
    populate_db_init()

Log:

Process:               Python [12397]
Path:                  /Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               3.7.4 (3.7.4)
Code Type:             X86-64 (Native)
Parent Process:        pycharm [75569]
Responsible:           Python [12397]
User ID:               502

Date/Time:             2019-10-16 01:11:09.148 +0300
OS Version:            Mac OS X 10.14.6 (18G103)
Report Version:        12



Time Awake Since Boot: 770000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [12397]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_pthread.dylib       	0x00007fff7c8f0d1b pthread_mutex_destroy + 27
1   _fiftyone_degrees_mobile_detector_v3_wrapper.cpython-37m-darwin.so	0x0000000110529e2f fiftyoneDegreesWorksetRelease + 127
2   _fiftyone_degrees_mobile_detector_v3_wrapper.cpython-37m-darwin.so	0x000000011055090d Match::~Match() + 29
3   _fiftyone_degrees_mobile_detector_v3_wrapper.cpython-37m-darwin.so	0x000000011053ca40 _wrap_delete_Match(_object*, _object*) + 96
4   org.python.python             	0x000000010dde0cf4 _PyMethodDef_RawFastCallDict + 548
5   org.python.python             	0x000000010dddfeb3 _PyObject_FastCallDict + 227
6   org.python.python             	0x000000010dde214c object_vacall + 316
7   org.python.python             	0x000000010dde2334 PyObject_CallFunctionObjArgs + 148
8   _fiftyone_degrees_mobile_detector_v3_wrapper.cpython-37m-darwin.so	0x0000000110544f99 SwigPyObject_dealloc(_object*) + 249
9   org.python.python             	0x000000010de0be04 dict_dealloc + 132
10  org.python.python             	0x000000010de294f5 subtype_dealloc + 949
11  org.python.python             	0x000000010ddf5854 frame_dealloc + 180
12  org.python.python             	0x000000010dde0a97 function_code_fastcall + 263
13  org.python.python             	0x000000010de9f8c2 call_function + 738
14  org.python.python             	0x000000010de9c92e _PyEval_EvalFrameDefault + 25342
15  org.python.python             	0x000000010dea0413 _PyEval_EvalCodeWithName + 2467
16  org.python.python             	0x000000010de96554 PyEval_EvalCode + 100
17  org.python.python             	0x000000010ded3c31 PyRun_FileExFlags + 209
18  org.python.python             	0x000000010ded34aa PyRun_SimpleFileExFlags + 890
19  org.python.python             	0x000000010def2903 pymain_main + 6915
20  org.python.python             	0x000000010def2e6a _Py_UnixMain + 58
21  libdyld.dylib                 	0x00007fff7c6fe3d5 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0xf000000000000150  rcx: 0x0000000000000307  rdx: 0x0000000110562510
  rdi: 0xf000000000000150  rsi: 0x0000000000000000  rbp: 0x00007ffee1e45bc0  rsp: 0x00007ffee1e45ba0
   r8: 0x00007ffee1e45970   r9: 0x000000010e2878d0  r10: 0x00007ffee1e45be0  r11: 0x0000000000000001
  r12: 0x0000000000000000  r13: 0x0000000000000001  r14: 0xf000000000000158  r15: 0x00007feaa18123a0
  rip: 0x00007fff7c8f0d1b  rfl: 0x0000000000010246  cr2: 0x000000c00008b010
  
Logical CPU:     2
Error Code:      0x00000000
Trap Number:     13

Reload from file mem leak

Hi,

I am currently testing code very similar to example/ReloadFromFileTrie.c. I've got lot of threads reading properties value and the main thread reloading the data occasionally. I am using Linux and threading is not disabled by defining FIFTYONEDEGREES_NO_THREADING.

When I use the valgrind memchecker, it says there is a leak on original dataset (from the very first initialization). I've tracked it to line 3040 where active dataset is already switched by the reloading thread, but last ("oldActive") user does not free the data. Problem could be, that FIFTYONEDEGREES_INTERLOCK_DEC macro target (__sync_fetch_and_add(v, -1)) returns previous value of passed variable, so for the last user of the dataSet it will be 1 == 0, thus this dataset won't be freed at all.

When I changed that condition to if (FIFTYONEDEGREES_INTERLOCK_DEC(&offsets->active->inUse) == 1 && ..., mem leak is gone. Unfortunatelly another problem arises in highly concurrent environment (lot of dataset reader threads and often data reloading). When dataset is being read while another thread reloads the dataset, while at line 2989 goes another iteration as provider active dataset has changed. So the line 2993 executes and goes to free dataset as well. And segmentation fault occurs.

So this "mem leak fix" is making it worse, further investigation is still necessary...


Another suspicious code I saw was that if reader reads active data set, and just before it will increment inUse variable, another thread making reload switched active dataset and as the reader yet did not incremented inUse value, line 1791 will pass and free the data. Reader can read some deleted data, until line 3009, where it will try to switch to active dataset again (and maybe it will make a second free() call through line 2993). Do not know yet, but could be relevant to behaviour I saw with the sigsegv...

Build errors

Hello, when I try build dynamic module 51Degrees for nginx I got this error after command

make install trie

objs/src/http/modules/ngx_http_upstream_ip_hash_module.o
objs/src/http/modules/ngx_http_upstream_least_conn_module.o
objs/src/http/modules/ngx_http_upstream_random_module.o
objs/src/http/modules/ngx_http_upstream_keepalive_module.o
objs/src/http/modules/ngx_http_upstream_zone_module.o
objs/ngx_modules.o
-lm -lcrypt -lpcre -lz
-Wl,-E
cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -DFIFTYONEDEGREES_TRIE -DFIFTYONEDEGREES_NO_THREADING -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules
-o objs/addon/51Degrees_module/ngx_http_51D_module.o
/devmod-detection/nginx/51Degrees_module/ngx_http_51D_module.c
cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -DFIFTYONEDEGREES_TRIE -DFIFTYONEDEGREES_NO_THREADING -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules
-o objs/addon/trie/51Degrees.o
/devmod-detection/nginx/51Degrees_module/src/trie/51Degrees.c
cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -DFIFTYONEDEGREES_TRIE -DFIFTYONEDEGREES_NO_THREADING -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules
-o objs/ngx_http_51D_module_modules.o
objs/ngx_http_51D_module_modules.c
cc -o objs/ngx_http_51D_module.so
objs/addon/51Degrees_module/ngx_http_51D_module.o
objs/addon/trie/51Degrees.o
objs/ngx_http_51D_module_modules.o
-lm
-shared
/usr/bin/ld: objs/addon/trie/51Degrees.o:/devmod-detection/nginx/51Degrees_module/src/trie/51Degrees.h:720: multiple definition of fiftyoneDegreesMalloc'; objs/addon/51Degrees_module/ngx_http_51D_module.o:/devmod-detection/nginx/51Degrees_module/src/trie/51Degrees.h:720: first defined here /usr/bin/ld: objs/addon/trie/51Degrees.o:/devmod-detection/nginx/51Degrees_module/src/trie/51Degrees.h:727: multiple definition of fiftyoneDegreesFree'; objs/addon/51Degrees_module/ngx_http_51D_module.o:/devmod-detection/nginx/51Degrees_module/src/trie/51Degrees.h:727: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [objs/Makefile:1205: objs/ngx_http_51D_module.so] Error 1
make[2]: Leaving directory '/devmod-detection/nginx/vendor/nginx-1.16.1'
make[1]: *** [Makefile:11: install] Error 2
make[1]: Leaving directory '/devmod-detection/nginx/vendor/nginx-1.16.1'
make: *** [Makefile:101: install] Error 2

different PlatformName for Mac OS X, HashTrieV​34

RESULT:

PlatformName: Mac OS X, ua: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:70.0) Gecko/20100101 Firefox/70.0 
PlatformName: macOS, ua: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:70.0) Gecko/20100101 Firefox/70.0

CODE:

import os

ABSPATH = os.path.dirname(__file__)


def match_ua_trie():
    user_agents = [
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:70.0) Gecko/20100101 Firefox/70.0',
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:70.0) Gecko/20100101 Firefox/70.0'
    ]
    from FiftyOneDegrees import fiftyone_degrees_mobile_detector_v3_trie_wrapper
    from fiftyone_degrees.mobile_detector.conf import settings

    provider_trie = fiftyone_degrees_mobile_detector_v3_trie_wrapper.Provider(
        os.path.join(ABSPATH, 'data', '51degrees', '51Degrees-PremiumV3.4.trie'),
        settings.PROPERTIES,
    )
    for ua in user_agents:
        device_object = provider_trie.getMatch(ua)
        print("PlatformName: %s, ua: %s" % (device_object.getValue('PlatformName'), ua))


if __name__ == '__main__':
    match_ua_trie()

Can't update submodules

Hi,
I'm facing an error while cloning the repository with the submodules.
While the cloning with:
git clone --recurse-submodules https://github.com/51Degrees/device-detection-cxx.git
The error:
Fetched in submodule path 'src/common-cxx', but it did not contain 54de38e846f9974f21259ac8ed5e25ee3a5410f0. Direct fetching of that commit failed.

So I tried to manually download the common-cxx from the common repository and put it manually in the src/common-cxx folder. But building the whole solution, even with the Visual Studio Solution didn't work giving me errors of any kind such as missing semicolons, definitions not found, etc. I'm guessing that putting the common folder manually is not the right way to proceed. So how can I resolve this problem?
Sorry, maybe I'm not understanding how to deal with this very well, but I'm developing a web server in C and I need to go on with this great service.

Thanks in advice.

ipad and iphone detection nginx module

Good day.

I've tried both trie and pattern (lite version) for nginx and it seems that plugin doesn't detect difference between ipad and iphone (tried on real devices) even though it clearly states which is which in user agent. I've used nginx config from example.
Please let me know if this is expected behavior.

Thanks.

unexpected matched with HashTrieV​34

RESULT:

provider_trie: Facebook for Android  <== wrong
provider_32: Chrome Mobile <== as expected

DB:

11/6/2019 | Premium | HashTrieV​34 | 40.76MB | 671f20632d15a9e702e00c5219fd1385

CODE:

import os
ABSPATH = os.path.dirname(__file__)


def match_ua_trie(ua):
    from FiftyOneDegrees import fiftyone_degrees_mobile_detector_v3_trie_wrapper
    from fiftyone_degrees.mobile_detector.conf import settings

    provider_trie = fiftyone_degrees_mobile_detector_v3_trie_wrapper.Provider(
        os.path.join(ABSPATH, 'data', '51degrees', '51Degrees-PremiumV3.4.trie'),
        settings.PROPERTIES,
    )

    device_object = provider_trie.getMatch(ua)
    print("provider_trie: %s" % device_object.getValue('BrowserName'))


def match_ua_32(ua):
    from FiftyOneDegrees import fiftyone_degrees_mobile_detector_v3_wrapper
    from fiftyone_degrees.mobile_detector.conf import settings
    dataFile = os.path.join(ABSPATH, 'data', '51degrees', '51Degrees-PremiumV3_2.dat')
    properties = settings.PROPERTIES
    cacheSize = settings.CACHE_SIZE
    poolSize = settings.POOL_SIZE
    provider32 = fiftyone_degrees_mobile_detector_v3_wrapper.Provider(
        dataFile,
        properties,
        cacheSize,
        poolSize
    )

    device_object = provider32.getMatch(ua)
    print("provider_32: %s" % device_object.getValue('BrowserName'))


if __name__ == '__main__':
    ua = 'Mozilla/5.0 (Linux; Android 9; Redmi Note 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36'
    match_ua_trie(ua)
    match_ua_32(ua)

distribute is long deprecated

The distribute package has been deprecated for quite some time.

In setup.py:

install_requires=[
        'distribute',
]

Installation of distribute causes installation to fail on newer versions of pip/setuptools with ImportError: No module named _markerlib.

Probably this dependency should be changed to setuptools.

Build error for php7.1

Hello,

I am trying to install php extension api. I have received some errors on built stage.

Here is my system :

Ubuntu 16.04
PHP 7.1.11
g++ 5.4.0 

The error that I receive when try to make install

/root/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp: In function ‘void _wrap_Provider_reloadFromMemory(zend_execute_data*, zval*)’:
/root/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:3583:63: error: no matching function for call to ‘Provider::reloadFromMemory(const string&, int&)’
       (arg1)->reloadFromMemory((std::string const &)*arg2,arg3);;
                                                               ^
In file included from /root/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:1083:0:
/root/Device-Detection/php/trie/src/trie/Provider.hpp:108:8: note: candidate: void Provider::reloadFromMemory(void*, int)
   void reloadFromMemory(void *source, int length);
        ^
/root/Device-Detection/php/trie/src/trie/Provider.hpp:108:8: note:   no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string<char>}’ to ‘void*’
/root/Device-Detection/php/trie/src/trie/Provider.hpp:109:8: note: candidate: void Provider::reloadFromMemory(unsigned char*, int)
   void reloadFromMemory(unsigned char source[], int length);
        ^
/root/Device-Detection/php/trie/src/trie/Provider.hpp:109:8: note:   no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string<char>}’ to ‘unsigned char*’
In file included from /usr/include/php/20160303/main/php_ini.h:24:0,
                 from /usr/include/php/20160303/main/fopen_wrappers.h:26,
                 from /usr/include/php/20160303/main/php.h:408,
                 from /root/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:751:
/root/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp: In function ‘int zm_startup_FiftyOneDegreesTrieV3(int, int)’:
/usr/include/php/20160303/Zend/zend_ini.h:141:73: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 #define INI_STR(name) zend_ini_string_ex((name), sizeof(name)-1, 0, NULL)
                                                                         ^
/root/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:4065:19: note: in expansion of macro ‘INI_STR’
  char *filePath = INI_STR("FiftyOneDegreesTrieV3.data_file");
                   ^
/usr/include/php/20160303/Zend/zend_ini.h:141:73: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 #define INI_STR(name) zend_ini_string_ex((name), sizeof(name)-1, 0, NULL)
                                                                         ^
/root/Device-Detection/php/trie/src/trie/51Degrees_PHP.cpp:4066:23: note: in expansion of macro ‘INI_STR’
  char *propertyList = INI_STR("FiftyOneDegreesTrieV3.property_list");
                       ^
Makefile:199: recipe for target 'src/trie/51Degrees_PHP.lo' failed
make: *** [src/trie/51Degrees_PHP.lo] Error 1

Build error for php7

Hi,

I am trying to get this module built for php7, what I have done so far is:

  1. Install php7 from source
  2. Install swig newest release 3.0.12
  3. Build 51Degrees php7 extension (pattern):
$ /php7/bin/phpize
$ ./configure PHP7=1 --with-php-config=/php7/bin/php-config
$ make

And then this error(s) showed up:

g++ -I. -I/root/sources/Device-Detection/php/pattern -DPHP_ATOM_INC -I/root/sources/Device-Detection/php/pattern/include -I/root/sources/Device-Detection/php/pattern/main -I/roo
t/sources/Device-Detection/php/pattern -I/php7/include/php -I/php7/include/php/main -I/php7/include/php/TSRM -I/php7/i
nclude/php/Zend -I/php7/include/php/ext -I/php7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/sources/Device-Detection/php/pattern/src/pa
ttern/51Degrees_PHP.cpp  -fPIC -DPIC -o src/pattern/.libs/51Degrees_PHP.o
/root/sources/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp: In functionvoid SWIG_FAIL()’:
/root/sources/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:1024:27: error: ‘FiftyOneDegreesPatternV3_globalswas not declared in this scope
 #define SWIG_ErrorCode() (FiftyOneDegreesPatternV3_globals.error_code)
                           ^
/root/sources/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:1030:16: note: in expansion of macroSWIG_ErrorCodezend_error(SWIG_ErrorCode(), "%s", SWIG_ErrorMsg());
                ^
/root/sources/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp: In functionvoid SWIG_ResetError()’:
/root/sources/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:1023:26: error: ‘FiftyOneDegreesPatternV3_globalswas not declared in this scope
 #define SWIG_ErrorMsg() (FiftyOneDegreesPatternV3_globals.error_msg)
                          ^
/root/sources/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp:1039:3: note: in expansion of macroSWIG_ErrorMsgSWIG_ErrorMsg() = default_error_msg;
   ^
/root/sources/Device-Detection/php/pattern/src/pattern/51Degrees_PHP.cpp: In functionvoid _wrap_new_MapStringString__SWIG_1(zend_execute_data*, zval*)’:

How can i fix this?

Thank,

Problem with building of nginx pattern or just nignx with 51D as a dynamic module

Hi.
I have faced trouble with building nginx as a patternt or just a nignx(from source code) with a dynamic module
What i'm doing.
I use ubuntu 16.04
case first - building pattern

# git clone https://github.com/51Degrees/Device-Detection.git
# cd Device-Detection/nginx
# make install pattern
.....................
make[1]: Entering directory '/usr/local/src/Device-Detection/nginx'                                                                                                                                          
if [ ! -d "vendor" ]; then mkdir vendor; fi                                                                                                                                                                  
cd vendor && curl -L -O "http://nginx.org/download/nginx-1.11.10.tar.gz"                                                                                                                                     
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                                              
                                 Dload  Upload   Total   Spent    Left  Speed                                                                                                                                
100  945k  100  945k    0     0   115k      0  0:00:08  0:00:08 --:--:-- 95441                                                                                                                               
cd vendor && tar xzf "nginx-1.11.10.tar.gz"                                                                                                                                                                  
make[1]: Leaving directory '/usr/local/src/Device-Detection/nginx'                                                                                                                                           
cd /usr/local/src/Device-Detection/nginx/vendor/nginx-1.11.10 && \                                                                                                                                           
./configure \                                                                                                                                                                                                
--prefix=/usr/local/src/Device-Detection/nginx/build \                                                                                                                                                       
--with-ld-opt="-lm" \                                                                                                                                                                                        
--add-dynamic-module=/usr/local/src/Device-Detection/nginx/51Degrees_module \                                                                                                                                
--with-compat \                                                                                                                                                                                              
--with-cc-opt="-DFIFTYONEDEGREES_PATTERN -DFIFTYONEDEGREES_NO_THREADING -Wno-ignored-qualifiers -Wno-unused-result -Wno-unused-but-set-variable -Wno-unused-function" \                                      
--with-debug \                                                                                                                                                                                               
--sbin-path=/usr/local/src/Device-Detection/nginx \                                                                                                                                                          
--conf-path="nginx.conf"                                                                                                                                                                                     
checking for OS                                                                                                                                                                                              
 + Linux 4.10.17-2-pve x86_64                                                                                                                                                                                
checking for C compiler ... found                                                                                                                                                                            
 + using GNU C compiler                            
 + gcc version: 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) 
...............................
make: Nothing to be done for 'pattern'.

What it is does mean?
But root problem for me is: how to build nginx with extended option.

For this reason i tried to build nginx from source code with 51D as a dynamic module
second case:

# cd /usr/local/src
# wget http://nginx.org/download/nginx-1.12.2.tar.gz
# tar xzf nginx-1.12.2.tar.gz
# git clone https://github.com/51Degrees/Device-Detection.git
# cd nginx-1.12.2
# ./configure --with-compat \
--with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' \
--with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' \
--prefix=/usr/share/nginx \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--lock-path=/var/lock/nginx.lock \
--pid-path=/run/nginx.pid \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-debug \
--with-pcre-jit \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_auth_request_module \
--with-http_addition_module \
--with-http_dav_module \
--with-http_geoip_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_image_filter_module \
--with-http_v2_module \
--with-http_sub_module \
--with-http_xslt_module \
--with-stream \
--with-stream_ssl_module \
--with-mail \
--with-mail_ssl_module \
--with-threads  \
--add-dynamic-module=/usr/local/src/51Degrees_module
# make 
AND I GET ERROR

objs/ngx_modules.o \                                                                                                                                                                                         
-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -ldl -lpthread -lpthread -lcrypt -lpcre -lssl -lcrypto -ldl -lz -lxml2 -lxslt -lexslt -lgd -lGeoIP \                                             
-Wl,-E                                                                                                                                                                                                       
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I src/core -I src/eve
nt -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/mail -I src/stream \                                                            
        -o objs/addon/51Degrees_module/ngx_http_51D_module.o \                                                                                                                                               
        /usr/local/src/51Degrees_module/ngx_http_51D_module.c                                                                                                                                                
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:142:2: error: unknown type name ‘fiftyoneDegreesDataSet’                                                                                               
  fiftyoneDegreesDataSet *dataSet;             /* 51Degrees data set, shared                                                                                                                                 
  ^                                                                                                                                                                                                          
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:221:62: error: unknown type name ‘fiftyoneDegreesDataSetInitStatus’                                                                                    
 static ngx_int_t reportDatasetInitStatus(ngx_cycle_t *cycle, fiftyoneDegreesDataSetInitStatus status,                                                                                                       
                                                              ^                                                                                                                                              
/usr/local/src/51Degrees_module/ngx_http_51D_module.c: In function ‘ngx_http_51D_post_conf’:                                                                                                                 
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:289:26: error: ‘FIFTYONEDEGREES_DEFAULTFILE’ undeclared (first use in this function)                                                                   
   fdmcf->dataFile.data = FIFTYONEDEGREES_DEFAULTFILE;                                                                                                                                                       
                          ^                                                                                                                                                                                  
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:289:26: note: each undeclared identifier is reported only once for each function it appears in                                                         
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:312:10: error: implicit declaration of function ‘reportDatasetInitStatus’ [-Werror=implicit-function-declaration]                                      
   return reportDatasetInitStatus(cf->cycle, 0, (const char*)fdmcf->dataFile.data);                                                                                                                          
          ^                                                                                                                                                                                                  
/usr/local/src/51Degrees_module/ngx_http_51D_module.c: In function ‘ngx_http_51D_init_shm_dataSet’:                                                                                                          
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:486:2: error: unknown type name ‘fiftyoneDegreesDataSet’                                                                                               
  fiftyoneDegreesDataSet *dataSet;                                                                                                                                                                           
  ^                                                                                                                                                                                                          
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:490:13: error: ‘fiftyoneDegreesDataSet’ undeclared (first use in this function)                                                                        
  dataSet = (fiftyoneDegreesDataSet*)ngx_slab_alloc(shpool, sizeof(fiftyoneDegreesDataSet));                                                                                                                 
             ^                                                                                                                                                                                               
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:490:36: error: expected expression before ‘)’ token                                                                                                    
  dataSet = (fiftyoneDegreesDataSet*)ngx_slab_alloc(shpool, sizeof(fiftyoneDegreesDataSet));                                                                                                                 
                                    ^                                                                                                                                                                        
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:485:19: error: variable ‘shpool’ set but not used [-Werror=unused-but-set-variable]                                                                    
  ngx_slab_pool_t *shpool;                         
                   ^                               
/usr/local/src/51Degrees_module/ngx_http_51D_module.c: In function ‘ngx_http_51D_init_module’:        
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:944:2: error: unknown type name ‘fiftyoneDegreesDataSetInitStatus’                                                                                     
  fiftyoneDegreesDataSetInitStatus status;         
  ^                                                
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:951:20: error: ‘fiftyoneDegreesDataSet’ undeclared (first use in this function)                                                                        
  fdmcf->dataSet = (fiftyoneDegreesDataSet*)ngx_http_51D_shm_dataSet->data;                           
                    ^                              
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:951:43: error: expected expression before ‘)’ token                                                                                                    
  fdmcf->dataSet = (fiftyoneDegreesDataSet*)ngx_http_51D_shm_dataSet->data;                           
                                           ^       
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:956:2: error: ‘fiftyoneDegreesMalloc’ undeclared (first use in this function)                                                                          
  fiftyoneDegreesMalloc = ngx_http_51D_shm_alloc;  
  ^                                                
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:957:2: error: ‘fiftyoneDegreesFree’ undeclared (first use in this function)                                                                            
  fiftyoneDegreesFree = ngx_http_51D_shm_free;     
  ^
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:964:11: error: implicit declaration of function ‘fiftyoneDegreesInitWithPropertyString’ [-Werror=implicit-function-declaration]                        
  status = fiftyoneDegreesInitWithPropertyString((const char*)fdmcf->dataFile.data, fdmcf->dataSet, (const char*)fdmcf->properties);                                                                         
           ^                                       
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:966:16: error: ‘DATA_SET_INIT_STATUS_SUCCESS’ undeclared (first use in this function)                                                                  
  if (status != DATA_SET_INIT_STATUS_SUCCESS) {    
                ^                                  
/usr/local/src/51Degrees_module/ngx_http_51D_module.c: In function ‘ngx_http_51D_exit_process’:       
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:1109:2: error: unknown type name ‘fiftyoneDegreesDataSet’                                                                                              
  fiftyoneDegreesDataSet *dataSet = (fiftyoneDegreesDataSet*)ngx_http_51D_shm_dataSet->data;          
  ^                                                
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:1109:37: error: ‘fiftyoneDegreesDataSet’ undeclared (first use in this function)                                                                       
  fiftyoneDegreesDataSet *dataSet = (fiftyoneDegreesDataSet*)ngx_http_51D_shm_dataSet->data;          
                                     ^             
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:1109:60: error: expected expression before ‘)’ token                                                                                                   
  fiftyoneDegreesDataSet *dataSet = (fiftyoneDegreesDataSet*)ngx_http_51D_shm_dataSet->data;          
                                                            ^                                         
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:1124:4: error: ‘fiftyoneDegreesFree’ undeclared (first use in this function)                                                                           
    fiftyoneDegreesFree = ngx_http_51D_shm_free;   
    ^                                              
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:1125:4: error: implicit declaration of function ‘fiftyoneDegreesDataSetFree’ [-Werror=implicit-function-declaration]                                   
    fiftyoneDegreesDataSetFree(dataSet);           
    ^                                              
/usr/local/src/51Degrees_module/ngx_http_51D_module.c: In function ‘ngx_http_51D_handler’:            
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:1404:36: error: variable ‘haveMatch’ set but not used [-Werror=unused-but-set-variable]                                                                
  ngx_uint_t matchIndex = 0, multi, haveMatch;     
                                    ^              
/usr/local/src/51Degrees_module/ngx_http_51D_module.c: At top level:                                  
/usr/local/src/51Degrees_module/ngx_http_51D_module.c:1159:1: error: ‘search_headers_in’ defined but not used [-Werror=unused-function]                                                                      
 search_headers_in(ngx_http_request_t *r, u_char *name, size_t len) {                                 
 ^                                                 
cc1: all warnings being treated as errors          
objs/Makefile:1733: recipe for target 'objs/addon/51Degrees_module/ngx_http_51D_module.o' failed      
make[1]: *** [objs/addon/51Degrees_module/ngx_http_51D_module.o] Error 1                              
make[1]: Leaving directory '/usr/local/src/nginx-1.12.2'                                              
Makefile:8: recipe for target 'build' failed       
make: *** [build] Error 2

So my goal is update nginx to latest stable version with fresh 51Deegres module.

How can i resolve this trouble?

Segmentation fault when loading data file

I have been trying to compile the module - the compilation works but the module crashes varnish (segmentation fault) when running fiftyonedegrees.start() in vcl_init(). I have tried compiling with varnish 4.0, 4.1.6, 4.1.7, 4.1.8, 4.1.9, 4.1.10 on ubuntu Trusty, Xenial and Bionic

The following output is varnishtest on Ubuntu "Trusty", the error is similar on all distros for all tested versions of varnish:

vagrant@vagrant-ubuntu-trusty-64:/tmp/Device-Detection/varnish$ sudo varnishtest /tmp/Device-Detection/varnish/src/tests/* -Dvmod_topbuild=/tmp/Device-Detection/varnish
**** top   0.0 macro def varnishd=varnishd
**** top   0.0 macro def varnishadm=varnishadm
**** top   0.0 macro def varnishstat=varnishstat
**** top   0.0 macro def varnishhist=varnishhist
**** top   0.0 macro def varnishlog=varnishlog
**** top   0.0 macro def varnishncsa=varnishncsa
**** top   0.0 macro def vmod_std=std
**** top   0.0 macro def vmod_debug=debug
**** top   0.0 macro def vmod_directors=directors
**** top   0.0 macro def pwd=/tmp/Device-Detection/varnish
**** top   0.0 macro def vmod_topbuild=/tmp/Device-Detection/varnish
**** top   0.0 macro def bad_ip=192.0.2.255
**** top   0.0 macro def tmpdir=/tmp/vtc.11897.722493c0
*    top   0.0 TEST /tmp/Device-Detection/varnish/src/tests/match_all.vtc starting
**   top   0.0 === varnishtest "Test fiftyonedegrees vmod"
*    top   0.0 TEST Test fiftyonedegrees vmod
**   top   0.0 === server s1 {
**   s1    0.0 Starting server
**** s1    0.0 macro def s1_addr=127.0.0.1
**** s1    0.0 macro def s1_port=37655
**** s1    0.0 macro def s1_sock=127.0.0.1 37655
*    s1    0.0 Listen on 127.0.0.1 37655
**   top   0.0 === varnish v1 -vcl+backend {
**   s1    0.0 Started on 127.0.0.1 37655
**   v1    0.0 Launch
***  v1    0.0 CMD: cd ${pwd} && exec ${varnishd}  -d -n /tmp/vtc.11897.722493c0/v1 -l 2m,1m,- -p auto_restart=off -p syslog_cli_traffic=off -p sigsegv_handler=on -p thread_pool_min=10 -p debug=+vtc_mode -a '127.0.0.1:0' -M '127.0.0.1 51104' -P /tmp/vtc.11897.722493c0/v1/varnishd.pid 
***  v1    0.0 CMD: cd /tmp/Device-Detection/varnish && exec varnishd  -d -n /tmp/vtc.11897.722493c0/v1 -l 2m,1m,- -p auto_restart=off -p syslog_cli_traffic=off -p sigsegv_handler=on -p thread_pool_min=10 -p debug=+vtc_mode -a '127.0.0.1:0' -M '127.0.0.1 51104' -P /tmp/vtc.11897.722493c0/v1/varnishd.pid 
***  v1    0.0 PID: 11903
**** v1    0.0 macro def v1_pid=11903
**** v1    0.0 macro def v1_name=/tmp/vtc.11897.722493c0/v1
***  v1    0.0 debug| Debug: Platform: Linux,3.13.0-67-generic,x86_64,-jnone,-smalloc,-smalloc,-hcritbit\n
***  v1    0.0 debug| \n
***  v1    0.0 debug| 200 281     \n
***  v1    0.0 debug| -----------------------------\n
***  v1    0.0 debug| Varnish Cache CLI 1.0\n
***  v1    0.0 debug| -----------------------------\n
***  v1    0.0 debug| Linux,3.13.0-67-generic,x86_64,-jnone,-smalloc,-smalloc,-hcritbit\n
***  v1    0.0 debug| varnish-4.1.7 revision NOGIT\n
***  v1    0.0 debug| \n
***  v1    0.0 debug| Type 'help' for command list.\n
***  v1    0.0 debug| Type 'quit' to close CLI session.\n
***  v1    0.0 debug| Type 'start' to launch worker process.\n
***  v1    0.0 debug| \n
**** v1    0.1 CLIPOLL 1 0x1 0x0
***  v1    0.1 CLI connection fd = 10
***  v1    0.1 CLI RX  107
**** v1    0.1 CLI RX| qykbtdlwlrntmhemyhobbcsmqdgiyctp\n
**** v1    0.1 CLI RX| \n
**** v1    0.1 CLI RX| Authentication required.\n
**** v1    0.1 CLI TX| auth accdb6a6fe66020b49c5b87b25f63ec0bedcbfb707334165874eebeb384e926d\n
***  v1    0.1 CLI RX  200
**** v1    0.1 CLI RX| -----------------------------\n
**** v1    0.1 CLI RX| Varnish Cache CLI 1.0\n
**** v1    0.1 CLI RX| -----------------------------\n
**** v1    0.1 CLI RX| Linux,3.13.0-67-generic,x86_64,-jnone,-smalloc,-smalloc,-hcritbit\n
**** v1    0.1 CLI RX| varnish-4.1.7 revision NOGIT\n
**** v1    0.1 CLI RX| \n
**** v1    0.1 CLI RX| Type 'help' for command list.\n
**** v1    0.1 CLI RX| Type 'quit' to close CLI session.\n
**** v1    0.1 CLI RX| Type 'start' to launch worker process.\n
**** v1    0.1 CLI TX| vcl.inline vcl1 << %XJEIFLH|)Xspa8P\n
**** v1    0.1 CLI TX| vcl 4.0;\n
**** v1    0.1 CLI TX| backend s1 { .host = "127.0.0.1"; .port = "37655"; }\n
**** v1    0.1 CLI TX| \n
**** v1    0.1 CLI TX| \n
**** v1    0.1 CLI TX| \timport fiftyonedegrees from "/tmp/Device-Detection/varnish/src/.libs/libvmod_fiftyonedegrees.so";\n
**** v1    0.1 CLI TX| \n
**** v1    0.1 CLI TX| \tsub vcl_deliver {\n
**** v1    0.1 CLI TX| \t\tset resp.http.ismobile = fiftyonedegrees.match_all("IsMobile");\n
**** v1    0.1 CLI TX| \t}\n
**** v1    0.1 CLI TX| \tsub vcl_init {\n
**** v1    0.1 CLI TX| \t\tfiftyonedegrees.start("/tmp/Device-Detection/varnish/data/51Degrees-LiteV3.2.dat");\n
**** v1    0.1 CLI TX| \t}\n
**** v1    0.1 CLI TX| \n
**** v1    0.1 CLI TX| \n
**** v1    0.1 CLI TX| %XJEIFLH|)Xspa8P\n
***  v1    0.5 CLI RX  200
**** v1    0.5 CLI RX| VCL compiled.\n
**** v1    0.5 CLI TX| vcl.use vcl1
***  v1    0.5 CLI RX  200
**   v1    0.5 Start
**** v1    0.5 CLI TX| start
***  v1    0.5 debug| Debug: Child (11915) Started\n
**** v1    0.6 vsl|          0 CLI             - Rd vcl.load "vcl1" vcl_vcl1.1525940889.916246653/vgc.so 1auto
***  v1    1.1 debug| Error: Child (11915) Pushing vcls failed:\n
***  v1    1.1 debug| CLI communication error (hdr)\n
***  v1    1.1 debug| Debug: Stopping Child\n
***  v1    2.1 debug| Error: Child (11915) died signal=6 (core dumped)\n
***  v1    2.1 debug| Error: Child (11915) Last panic at: Thu, 10 May 2018 08:28:11 GMT\n
***  v1    2.1 debug| "Assert error in child_sigsegv_handler(), mgt/mgt_child.c line 290:\n
***  v1    2.1 debug|   Condition(Segmentation fault by instruction at 0x90) not true.\n
***  v1    2.1 debug| thread = (cache-main)\n
***  v1    2.1 debug| version = varnish-4.1.7 revision NOGIT\n
***  v1    2.1 debug| ident = Linux,3.13.0-67-generic,x86_64,-jnone,-smalloc,-smalloc,-hcritbit,epoll\n
***  v1    2.1 debug| now = 50976.127462 (mono), 1525940890.469682 (real)\n
***  v1    2.1 debug| Backtrace:\n
***  v1    2.1 debug|   0x434112: varnishd() [0x434112]\n
***  v1    2.1 debug|   0x454203: varnishd() [0x454203]\n
***  v1    2.1 debug|   0x7f5c94ffd330: libpthread.so.0(+0x10330) [0x7f5c94ffd330]\n
***  v1    2.1 debug|   0x7f5c94ff72f0: libpthread.so.0(pthread_mutex_init+0x40) [0x7f5c94ff72f0]\n
***  v1    2.1 debug|   0x7f5c901c04bf: libvmod_fiftyonedegrees.so(fiftyoneDegreesMutexCreate+0xf) [0x7f5c901c04bf]\n
***  v1    2.1 debug|   0x7f5c901bea01: libvmod_fiftyonedegrees.so(fiftyoneDegreesInitProviderWithPropertyString+0x51) [0x7f5c901bea01]\n
***  v1    2.1 debug|   0x7f5c901b9a06: libvmod_fiftyonedegrees.so(vmod_start+0x36) [0x7f5c901b9a06]\n
***  v1    2.1 debug|   0x7f5c903c7d2b: vgc.so(VGC_function_vcl_init+0x2b) [0x7f5c903c7d2b]\n
***  v1    2.1 debug|   0x7f5c903c820f: vgc.so(+0x220f) [0x7f5c903c820f]\n
***  v1    2.1 debug|   0x43fbb3: varnishd() [0x43fbb3]\n
***  v1    2.1 debug| \n
***  v1    2.1 debug| "\n
***  v1    2.1 debug| Info: Child (11915) said Child starts\n
***  v1    2.1 debug| Debug: Child cleanup complete\n
***  v1    2.1 CLI RX  400
---- v1    2.1 CLI start command failed: 400 
***  v1    2.1 wait-running
**** v1    2.1 CLI TX| status
***  v1    2.1 CLI RX  200
**** v1    2.1 CLI RX| Child in state stopped
---- v1    2.1 Child stopped before running: 200 Child in state stopped
**** v1    2.1 CLI TX| debug.xid 999
***  v1    2.2 CLI RX  101
**** v1    2.2 CLI RX| Unknown request in manager process (child not running).\n
**** v1    2.2 CLI RX| Type 'help' for more info.
*    top   2.2 RESETTING after /tmp/Device-Detection/varnish/src/tests/match_all.vtc
**   s1    2.2 Waiting for server (4/-1)
**** s1    2.2 macro undef s1_addr
**** s1    2.2 macro undef s1_port
**** s1    2.2 macro undef s1_sock
**   v1    2.2 Wait
**** v1    2.2 STDOUT poll 0x10
**   v1    2.2 R 11903 Status: 0000 (u 0.108880 s 0.100234)
*    top   2.2 TEST /tmp/Device-Detection/varnish/src/tests/match_all.vtc FAILED

#     top  TEST /tmp/Device-Detection/varnish/src/tests/match_all.vtc FAILED (2.230) exit=1
root@vagrant-ubuntu-trusty-64:/tmp# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) 
root@vagrant-ubuntu-trusty-64:/tmp# varnishd -V
varnishd (varnish-4.1.7 revision NOGIT)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2015 Varnish Software AS

Automatic update not working

Following is my provider's config JSON of mine in Node.js
var config = { "Licence":"MyLisenceKey-I-Put-here", "dataFile" : require('../db-file'), "poolSize" : 50, "cacheSize" : 5000 };

But automatic update doesn't seem to be working. Do I need to change anything else? actually, I have just bought the licence so I'm following the documentation and not very sure if I'm missing any part

Running Go with Device Detection

go run project

# command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/tmp/go-link-523840537/000003.o: In function `std_vector_Sl_std_string_Sg__get':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:313: undefined reference to `std::out_of_range::out_of_range(char const*)'
/tmp/go-link-523840537/000003.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000003.o:/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: more undefined references to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' follow
/tmp/go-link-523840537/000003.o: In function `std_vector_Sl_std_string_Sg__set':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:320: undefined reference to `std::out_of_range::out_of_range(char const*)'
/tmp/go-link-523840537/000003.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000003.o: In function `std_map_Sl_std_string_Sc_std_string_Sg__get':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:292: undefined reference to `std::out_of_range::out_of_range(char const*)'
/tmp/go-link-523840537/000003.o: In function `std_map_Sl_std_string_Sc_std_string_Sg(double,...)(long)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:302: undefined reference to `std::out_of_range::out_of_range(char const*)'
/tmp/go-link-523840537/000003.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000003.o: In function `_wrap_delete_VectorString_FiftyOneDegreesTrieV3_0acf7431d65d9469':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:853: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000003.o: In function `_wrap_delete_MapStringString_FiftyOneDegreesTrieV3_0acf7431d65d9469':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:589: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000003.o: In function `_wrap_new_VectorString__SWIG_1_FiftyOneDegreesTrieV3_0acf7431d65d9469':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:632: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000003.o: In function `_wrap_new_Provider__SWIG_0_FiftyOneDegreesTrieV3_0acf7431d65d9469':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:1278: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000003.o: In function `_wrap_new_Provider__SWIG_1_FiftyOneDegreesTrieV3_0acf7431d65d9469':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:1309: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000003.o:/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/51Degrees_go.cxx:1337: more undefined references to `operator delete(void*, unsigned long)' follow
/tmp/go-link-523840537/000003.o: In function `void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag)':
/usr/local/include/c++/8.1.0/bits/basic_string.tcc:219: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
/tmp/go-link-523840537/000003.o: In function `void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag)':
/usr/local/include/c++/8.1.0/bits/basic_string.tcc:219: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
/tmp/go-link-523840537/000004.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1420: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000004.o: In function `Match::~Match()':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Match.cpp:39: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000004.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1420: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::getMatchJson[abi:cxx11](char const*)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:565: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::basic_istream<char, std::char_traits<char> >::basic_istream()':
/usr/local/include/c++/8.1.0/istream:607: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::basic_stringbuf(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:101: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()':
/usr/local/include/c++/8.1.0/sstream:732: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/include/c++/8.1.0/sstream:732: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/include/c++/8.1.0/sstream:732: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
/usr/local/include/c++/8.1.0/sstream:65: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000005.o: In function `std::basic_istream<char, std::char_traits<char> >::basic_istream()':
/usr/local/include/c++/8.1.0/istream:607: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::basic_stringbuf(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:101: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `Provider::initException(e_fiftyoneDegreesDataSetInitStatus, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:122: undefined reference to `std::runtime_error::runtime_error(char const*)'
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:104: undefined reference to `std::runtime_error::runtime_error(char const*)'
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:108: undefined reference to `std::runtime_error::runtime_error(char const*)'
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:112: undefined reference to `std::runtime_error::runtime_error(char const*)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::initException(e_fiftyoneDegreesDataSetInitStatus, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:118: undefined reference to `std::invalid_argument::invalid_argument(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:128: undefined reference to `std::runtime_error::runtime_error(char const*)'
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:132: undefined reference to `std::runtime_error::runtime_error(char const*)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000005.o: In function `std::basic_istream<char, std::char_traits<char> >::basic_istream()':
/usr/local/include/c++/8.1.0/istream:607: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::basic_stringbuf(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:101: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
/usr/local/include/c++/8.1.0/sstream:65: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000005.o: In function `std::basic_istream<char, std::char_traits<char> >::basic_istream()':
/usr/local/include/c++/8.1.0/istream:607: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::basic_stringbuf(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:101: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
/usr/local/include/c++/8.1.0/sstream:65: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000005.o: In function `std::basic_istream<char, std::char_traits<char> >::basic_istream()':
/usr/local/include/c++/8.1.0/istream:607: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::basic_stringbuf(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:101: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()':
/usr/local/include/c++/8.1.0/sstream:732: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/include/c++/8.1.0/sstream:732: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/include/c++/8.1.0/sstream:732: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
/usr/local/include/c++/8.1.0/sstream:65: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1913: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1347: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000005.o: In function `std::basic_istream<char, std::char_traits<char> >::basic_istream()':
/usr/local/include/c++/8.1.0/istream:607: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:705: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::basic_stringbuf(std::_Ios_Openmode)':
/usr/local/include/c++/8.1.0/sstream:101: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
/usr/local/include/c++/8.1.0/sstream:65: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::str() const':
/usr/local/include/c++/8.1.0/sstream:780: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const'
/tmp/go-link-523840537/000005.o: In function `Provider::Provider(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:758: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/go-link-523840537/000005.o: In function `Provider::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:182: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)':
/usr/local/include/c++/8.1.0/bits/basic_string.h:1420: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::getMatchJson(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:594: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::getMatchMap(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:546: undefined reference to `operator delete(void*, unsigned long)'
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:547: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::~Provider()':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:89: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::getMatchWithTolerances(char const*, int, int, int)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:430: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::getDataSetPublishedDate[abi:cxx11]()':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:281: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()'
/tmp/go-link-523840537/000005.o: In function `Provider::initException(e_fiftyoneDegreesDataSetInitStatus, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:101: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()'
/tmp/go-link-523840537/000005.o: In function `Provider::getDataSetFormat[abi:cxx11]()':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:272: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()'
/tmp/go-link-523840537/000005.o: In function `Provider::getDataSetName[abi:cxx11]()':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:263: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()'
/tmp/go-link-523840537/000005.o: In function `Provider::getDataSetNextUpdateDate[abi:cxx11]()':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:292: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()'
/tmp/go-link-523840537/000005.o:/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:742: more undefined references to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()' follow
/tmp/go-link-523840537/000005.o: In function `Provider::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:172: undefined reference to `__cxa_throw_bad_array_new_length'
/tmp/go-link-523840537/000005.o: In function `Provider::getMatchWithTolerances(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, int, int)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:474: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::buildArray(int, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >*)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:399: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `Provider::buildArray(fiftyoneDegrees_device_offsets_t*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >*)':
/web/go/src/github.com/reoxey/particle/vendor/Device-Detection/go/src/trie/Provider.cpp:372: undefined reference to `operator delete(void*, unsigned long)'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
/usr/local/include/c++/8.1.0/sstream:65: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
/usr/local/include/c++/8.1.0/sstream:65: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/tmp/go-link-523840537/000005.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
/usr/local/include/c++/8.1.0/sstream:65: undefined reference to `operator delete(void*, unsigned long)'
collect2: error: ld returned 1 exit status

What could be the issue?

os: Centos 7
gcc: 8..1.0
go: go1.10.3 linux/amd64

Inconsistent results, unable to detect device type.

I've tried this with the latest chrome.

51D_match_all x-device-type DeviceType;
51D_match_all x-desktop IsDesktop;
51D_match_all x-tablet IsTablet;
51D_match_all x-mobile IsMobile;

These return NA, NA, NA and False respectively using a recent trie data file.

[Golang] Can't use Trie - error: redefinition of

Hello,
in before thank you for greate database.

I have problems with usage Trie module on Golang language:

go run StronglyTypedHashTrie.go
In file included from ./../cache.h:31:0,
                 from ./../cache.c:1,
                 from ../../pkg/FiftyOneDegrees/trie/FiftyOneDegreesTrieV3.go:20:
./../threading.h:294:1: error: redefinition of '__fod_sync_bool_compare_and_swap_16'
 __fod_sync_bool_compare_and_swap_16(
 ^
In file included from ./../threading.c:28:0,
                 from ../../pkg/FiftyOneDegrees/trie/FiftyOneDegreesTrieV3.go:19:
./../threading.h:294:1: note: previous definition of '__fod_sync_bool_compare_and_swap_16' was here
 __fod_sync_bool_compare_and_swap_16(
 ^

Steps to Reproduce

Expected and Actual Results

Expected output:

Mobile User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 7_1 like Mac OS X)   AppleWebKit/537.51.2 (KHTML, like Gecko) 'Version/7.0 Mobile/11D167 Safari/9537.53

and other user-agents outputs

Actual results:

In file included from ./../cache.h:31:0,
                 from ./../cache.c:1,
                 from ../../pkg/FiftyOneDegrees/trie/FiftyOneDegreesTrieV3.go:20:
./../threading.h:294:1: error: redefinition of '__fod_sync_bool_compare_and_swap_16'
 __fod_sync_bool_compare_and_swap_16(
 ^
In file included from ./../threading.c:28:0,
                 from ../../pkg/FiftyOneDegrees/trie/FiftyOneDegreesTrieV3.go:19:
./../threading.h:294:1: note: previous definition of '__fod_sync_bool_compare_and_swap_16' was here
 __fod_sync_bool_compare_and_swap_16(
 ^

Additional info

Data File version: 51Degrees-EnterpriseV3.4.trie
OS: Ubuntu 16.04 (also tried on fresh installed Ubuntu 18.04 on VPS)
go version: go1.14 linux/amd64 (go version go1.14.4 linux/amd64 on VPS)

Thx in advance

P.S. Pattern module works just fine

Error downloading object: 20000 Evidence Records.yml

Cloning fails because the LFS bandwidth quota has been exceeded.

➜  repos git clone https://github.com/51Degrees/device-detection-data
Cloning into 'device-detection-data'...
remote: Enumerating objects: 145, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 145 (delta 3), reused 7 (delta 1), pack-reused 133
Receiving objects: 100% (145/145), 27.28 KiB | 473.00 KiB/s, done.
Resolving deltas: 100% (41/41), done.
Downloading 20000 Evidence Records.yml (4.2 MB)
Error downloading object: 20000 Evidence Records.yml (ed53f4f): Smudge error: Error downloading 20000 Evidence Records.yml (ed53f4fdccc763e143dfeaacfbb9652583ceb277bd791bd7543df7318ca647a1): batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.

Errors logged to '/Users/radi/Documents/repos/device-detection-data/.git/lfs/logs/20230920T125143.503175.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: 20000 Evidence Records.yml: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

Since it happened other times (I opened two other issues), may I suggest, if possible, to set up an automated system that notifies automatically when the quota is exceeded? Thanks.

Cross platform support

Is 51Degrees Device-Detection support for all linux distributions?.

Is it support for Alpine OS?.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.