patrickfrey / strusWebService

web service (HTTP/JSON) to use the strus API as a service
http://project-strus.net
Mozilla Public License 2.0
4 stars 0 forks source link

re-registration of query weighting function results in out-of-memory #51

Closed andreasbaumann closed 6 years ago

andreasbaumann commented 6 years ago
2016-06-20 09:24:27; strusWebService, warning: registering weighting function 'test'
resulted in an error: error in database transaction commit: database transaction
with error: memory allocation error (strusContext.cpp:65)

Actually this looks more like memory corruption to me.

Besides, this should be fixed by changing the way we handle functions loaded from modules. We should not load them on every query request.

andreasbaumann commented 6 years ago

Also seen while inserting: the query works ok, but a message about a commit memory error appear underneath:

2016-07-13 08:05:06; strusWebService, warning: 
registering weighting function 'test' resulted in an error: 
storage transaction with error: 
storage transaction with error: storage transaction with error: 
storage transaction with error: storage transaction with error: 
storage transaction with error: storage transaction with error: 
storage transaction with error: storage transaction with error: 
storage transaction with error: storage transaction with error: 
error in database transaction commit: 
database transaction with error: memory allocation error (strusContext.cpp:65)

Inserting seems to run fine though. Maybe a transaction run into memory problems before? Maybe the buffer still contains a error messages from before?

andreasbaumann commented 6 years ago

This error happens when printing a message with a pointer to a format string used as argument. The implementation of the ErrorBufferInterface should print an error first with snprintf to a local buffer, before copying it into the thread-global buffer.

andreasbaumann commented 6 years ago

See https://github.com/patrickfrey/strusBase/blob/master/src/error/errorBuffer.cpp line 32-40

andreasbaumann commented 6 years ago

Is this fixed in strusBase or do I have to do something?

patrickfrey commented 6 years ago

It has been fixed in strusBase