Snort mailing list archives

Re: Snort 3.1.51.0 won't compile - gettid was not declared in this scope?


From: "Steve Chew \(stechew\) via Snort-devel" <snort-devel () lists snort org>
Date: Tue, 17 Jan 2023 19:45:53 +0000

We'll have a fix out for that soon. To work around the problem, add this to src/main/analyzer.cc:

#include "utils/util.h"


________________________________
From: Snort-devel <snort-devel-bounces () lists snort org> on behalf of Neville, Andrew via Snort-devel <snort-devel () 
lists snort org>
Sent: Monday, January 16, 2023 4:22 AM
To: snort-devel () lists snort org <snort-devel () lists snort org>
Subject: [Snort-devel] Snort 3.1.51.0 won't compile - gettid was not declared in this scope?


Hi,



Having trouble compiling the latest Snort 3.1.51.0  on Almalinux 8.7  (I would guess the same problem happens on RHEL 
and CentOS Stream too?)



Make seems to error with :



[ 16%] Built target log

[ 16%] Generating lua_finalize.h

[ 16%] Generating lua_bootstrap.h

[ 16%] Building CXX object src/main/CMakeFiles/main.dir/analyzer.cc.o

/opt/sources/snort3/src/main/analyzer.cc: In member function ‘void Analyzer::operator()(Swapper*, uint16_t)’:

/opt/sources/snort3/src/main/analyzer.cc:746:71: error: ‘gettid’ was not declared in this scope

     SnortConfig::get_conf()->thread_config->set_instance_tid(id, (int)gettid());

                                                                       ^~~~~~

/opt/sources/snort3/src/main/analyzer.cc:746:71: note: suggested alternative: ‘getgid’

     SnortConfig::get_conf()->thread_config->set_instance_tid(id, (int)gettid());

                                                                       ^~~~~~

                                                                       getgid

make[2]: *** [src/main/CMakeFiles/main.dir/build.make:84: src/main/CMakeFiles/main.dir/analyzer.cc.o] Error 1

make[1]: *** [CMakeFiles/Makefile2:3281: src/main/CMakeFiles/main.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

[ 16%] Generating pdf_tokenizer.cc

[ 16%] Generating js_tokenizer.cc

[ 16%] Building CXX object src/js_norm/CMakeFiles/js_norm.dir/pdf_tokenizer.cc.o

[ 16%] Building CXX object src/js_norm/CMakeFiles/js_norm.dir/js_tokenizer.cc.o

[ 16%] Building CXX object src/js_norm/CMakeFiles/js_norm.dir/js_identifier_ctx.cc.o

[ 17%] Building CXX object src/js_norm/CMakeFiles/js_norm.dir/js_norm.cc.o

[ 17%] Building CXX object src/js_norm/CMakeFiles/js_norm.dir/js_norm_module.cc.o

[ 17%] Building CXX object src/js_norm/CMakeFiles/js_norm.dir/js_normalizer.cc.o

[ 17%] Building CXX object src/js_norm/CMakeFiles/js_norm.dir/js_pdf_norm.cc.o

[ 17%] Built target js_norm

make: *** [Makefile:156: all] Error 2



If I simply checkout the 3.1.50.0 tag and re-run make it completes OK.



(Looks like there were some relevant commits between 3.1.50.0 and 3.1.51.0 which might have something to do with this 
error?)



Anyone have any ideas please?



Thanks,



Andrew.





Unless otherwise stated, this email has been sent from Fujitsu Services Limited (registered in England No 96056); 
Fujitsu EMEA PLC (registered in England No 2216100) both with registered offices at: 22 Baker Street, London W1U 3BW; 
PFU (EMEA) Limited, (registered in England No 1578652) registered offices at: Belmont, Belmont Road, Uxbridge, England, 
UB8 1HE and Fujitsu Research of Europe Ltd (registered in England No. 4153469) 4th Floor, Building 3, Hyde Park Hayes, 
11 Millington Road, Hayes, UB3 4AZ.

This email is only for the use of its intended recipient. Its contents are subject to a duty of confidence and may be 
privileged. Fujitsu does not guarantee that this email has not been intercepted and amended or that it is virus-free.
_______________________________________________
Snort-devel mailing list
Snort-devel () lists snort org
https://lists.snort.org/mailman/listinfo/snort-devel

Please visit http://blog.snort.org for the latest news about Snort!

Current thread: