Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for -std=c++11 #171

Open
onlyjob opened this issue May 5, 2021 · 14 comments
Open

Update for -std=c++11 #171

onlyjob opened this issue May 5, 2021 · 14 comments

Comments

@onlyjob
Copy link
Contributor

onlyjob commented May 5, 2021

#164 was closed by 7a2bca9 that forced outdated standard -std=c++98.
Ideally code should be updated for current/default -std=c++11 (as per "FIXME comment).

@onlyjob
Copy link
Contributor Author

onlyjob commented Jun 18, 2021

@CompunixAustralia, could you have a look please?

@CompunixAustralia
Copy link
Contributor

CompunixAustralia commented Jun 18, 2021

See pull #184

and see below for more detail
noexcept specifier since C++11
https://en.cppreference.com/w/cpp/language/noexcept_spec

@onlyjob
Copy link
Contributor Author

onlyjob commented Jun 19, 2021

Thanks. I tried to build with -Wno-literal-suffix (due to large number of warnings) but got the following FTBFS together with deprecation warnings for throw (std::bad_alloc):

g++ -D_REENTRANT_ -D_CHECK_FORMAT_STRING_ -I. -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-write-strings -Wno-literal-suffix -c Clusterdb.cpp
In file included from Mem.cpp:3:
Mem.h:219:35: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  219 | void * operator new (size_t size) throw (std::bad_alloc);
      |                                   ^~~~~
Mem.cpp:233:35: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  233 | void * operator new (size_t size) throw (std::bad_alloc) {
      |                                   ^~~~~
Mem.cpp:233:8: error: declaration ofvoid* operator new(size_t) throw (std::bad_alloc)’ has a different exception specifier
  233 | void * operator new (size_t size) throw (std::bad_alloc) {
      |        ^~~~~~~~
In file included from Mem.cpp:3:
Mem.h:219:8: note: from previous declarationvoid* operator new(size_t)’
  219 | void * operator new (size_t size) throw (std::bad_alloc);
      |        ^~~~~~~~
Mem.cpp:337:38: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  337 | void * operator new [] (size_t size) throw (std::bad_alloc) {
      |                                      ^~~~~
make[1] *** [Makefile:588: Mem.o] Error 1

@CompunixAustralia
Copy link
Contributor

CompunixAustralia commented Jun 19, 2021

The deprecated warning from Mem.h should be suppressed by changing
void * operator new (size_t size) throw (std::bad_alloc);

To

void * operator new (size_t size) noexcept(false);

Edit: This is included in the compiler-warning branch. Work in progress.
https://github.com/CompunixAustralia/open-source-search-engine/tree/compiler-warnings

@lisawebcoder
Copy link

my code complies with similiar fix as you mentioned but when i run ./gb i get this error

mem: addMem: init failed Disabling checks

am i out of Ram? i ran before on 2 gb of ram
i am on vbox using ubunut 18.04 lts

@lisawebcoder
Copy link

I complied on a VMware Ubuntu 18 with 4 gb of ram
And i still get the same error after i run
./gb

Anybody know why?

@lisawebcoder
Copy link

lisawebcoder commented Jan 6, 2022

I am only able to run it on Ubuntu 16
And i had to leave the throw std allocation line of code in mem.cpl or it would give errors
But it fully compiles in Ubuntu 18 but when i run ./gb i get the error

Mem addmem init failed disabling checks
Why?

@lisawebcoder
Copy link

this is how i fixed it on ubunutu 20
sudo su

sudo rm -rf /var/lib/apt/lists/lock /var/cache/apt/archives/lock /var/lib/dpkg/lock and restart your system h.cdccdc

sudo apt-get clean all

sudo apt-get update && sudo apt-get upgrade

sudo apt-get dist-upgrade

sudo dpkg -l | grep ^..r | apt-get purge

make

./gb

@tcreek
Copy link

tcreek commented May 17, 2023

this is how i fixed it on ubunutu 20 sudo su

sudo rm -rf /var/lib/apt/lists/lock /var/cache/apt/archives/lock /var/lib/dpkg/lock and restart your system h.cdccdc

sudo apt-get clean all

sudo apt-get update && sudo apt-get upgrade

sudo apt-get dist-upgrade

sudo dpkg -l | grep ^..r | apt-get purge

make

./gb

Is this what you meant by how you got it to function?

@lisawebcoder
Copy link

yes exactly

@tcreek
Copy link

tcreek commented May 17, 2023

I am not sure what messing with the packages would have to do with it running, but I did the above and the results are:

If I try to run it as "./gb" then it will core dump immediately.

mem: addMem: Init failed. Disabling checks.
Segmentation fault (core dumped)

Giving it more access via "sudo ./gb" and it will start running.

Once I try adding a site to crawl, same thing again:


1684343818076 000 loop: sigbadhandler. disabling handler from recall.
1684343818076 000 gb: Printing stack trace. use 'addr2line -e gb' to decode the hex below.
1684343818077 000 addr2line -e gb 0x55622774c5e1
1684343818078 000 addr2line -e gb 0x55622774d339
1684343818078 000 addr2line -e gb 0x7fe718066730
1684343818078 000 addr2line -e gb 0x556227815d13
1684343818078 000 addr2line -e gb 0x55622781658e
1684343818078 000 addr2line -e gb 0x556227816ae9
1684343818079 000 addr2line -e gb 0x556227816cfa
1684343818079 000 addr2line -e gb 0x5562276cf507
1684343818079 000 addr2line -e gb 0x5562276cfa5a
1684343818079 000 addr2line -e gb 0x5562276cff7a
1684343818079 000 addr2line -e gb 0x5562276d0399
1684343818079 000 addr2line -e gb 0x55622774bd4f
1684343818079 000 addr2line -e gb 0x55622774cdfb
1684343818080 000 addr2line -e gb 0x55622774d01f
1684343818080 000 addr2line -e gb 0x5562276027d4
1684343818080 000 addr2line -e gb 0x5562275fbc85
1684343818080 000 addr2line -e gb 0x7fe7177f709b
1684343818080 000 addr2line -e gb 0x5562275fbb1a
1684343818080 000 loop: sigbadhandler. trying to save now. mode=0
1684343818081 000 mem: checking mem for breeches
1684343818139 000 gb: Shutting down urgently. Timed try #0.
1684343818139 000 gb: disabling threads
1684343818141 000 gb: trying to shutdown
1684343818141 000 gb: calling save tree for titledb
1684343818141 000 gb: calling save tree for sectiondb
1684343818141 000 gb: calling save tree for posdb
1684343818141 000 gb: calling save tree for spiderdb
1684343818141 000 db: Saving /home/trent/search//spiderdb-saved.dat
1684343818142 000 gb: calling save tree for clusterdb
1684343818142 000 gb: calling save tree for tagdb
1684343818142 000 gb: calling save tree for catdb
1684343818142 000 gb: calling save tree for statsdb
1684343818142 000 gb: calling save tree for linkdb
1684343818142 000 gb: calling save tree for rdbid 0
1684343818143 000 gb: calling save tree for rdbid 0
1684343818143 000 gb: calling save tree for rdbid 0
1684343818143 000 gb: calling save tree for doledb
1684343818143 000 db: Saving /home/trent/search//doledb-saved.dat
1684343818143 000 gb: calling save tree for rdbid 0
1684343818143 000 gb: calling save tree for rdbid 0
1684343818144 000 gb: calling save tree for rdbid 0
1684343818144 000 gb: calling save tree for rdbid 0
1684343818144 000 gb: calling save tree for rdbid 0
1684343818144 000 gb: calling save tree for rdbid 0
1684343818144 000 gb: calling save tree for rdbid 0
1684343818144 000 spider: saving waiting tree for cn=0
1684343818145 000 db: Saving /home/trent/search/coll.main.0/waitingtree-saved.dat
1684343818145 000 gb: Shutting down udp server port 5998.
1684343818145 000 gb: Closing udp server socket port 5998.
1684343818145 000 gb: Shut down udp server port 5998 successfully.
1684343818145 000 gb: Shutting down udp server port 9000.
1684343818145 000 gb: Closing udp server socket port 9000.
1684343818146 000 gb: Shut down udp server port 9000 successfully.
1684343818146 000 admin: stopping real time profiler
1684343818146 000 gb: Saving miscellaneous data files.
1684343818152 000 build: Saving /home/trent/search/addsinprogress.saving
1684343818153 000 build: Renamed /home/trent/search/addsinprogress.saving to /home/trent/search/addsinprogress.dat
1684343818153 000 db: Saving 3000000 bytes of cache to /home/trent/search//robots.txt.cache
1684343818161 000 db: Saving 128000 bytes of cache to /home/trent/search//dns.cache
1684343818162 000 gb: calling abort from main process with pid of 1760 (main process)
1684343818162 000 gb: Joining with all threads
1684343818163 000 threads: killing all threads
1684343818164 000 gb: Dumping core after saving.
Segmentation fault

I guess we see why it appears to be an abandoned project. Can't even get it to function.,

@lisawebcoder
Copy link

Hello ok so you are in the gui admin crwaling?
I actually got to the cms gui admin and i crwaling there
I left tge project cuz i didn't know how to add shards or nodes

@tcreek
Copy link

tcreek commented May 17, 2023

image

@tcreek
Copy link

tcreek commented May 17, 2023

You probably have to do nodes by making a cluster of computers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants