Closed suisou closed 4 years ago
/// insert row
the app aborted the the flush fun._**
By now I don't support smart pointer like shared_ptr or unique_ptr. I'll reproduce your problem and try to estimate the effort to implement the feature.
Oh, I've just seen that you doesn't serialize the smart pointer, but the DWORD. Maybe that is the problem. I'll take a look.
Did you find the problem?
My op system is centos 8 64bit . Dword is unsigned long 64bit
Sorry for the late reply. I've just started to successfully reproduce the behavior. By I think it has somesthing to do with the quotation of the sql statement. Stay tuned...
Here's a working gist of my test code: https://gist.github.com/zussel/d31f2507320cdb67f737a20f95997a3a
At first try it doesn't worked. But my build libs didn't match the code. After rebuilding the lib. Everything works fine.
If you work on develop and build the lib yourself, be aware that on 2020/1/7 I've added a new SQL token "LIKE" which could lead to wrong behavior if you doesn't rebuild matador.
Please give the gist a try and tell me the result.
I have rebult the master and develp lib , then test it ,but the issue is same.
free(): invalid pointer
Ok, did you use the code from my gist? And which fields are not written to db?
s_mediaserverconf _conf; auto conf = s.insert(&_conf); conf.modify()->id = i; s.flush();
test it with these code ,but the issue is same .
matador::object_proxy::destroy
(void * p) Line 372 C++ the fuction stacks . destroy pointer?
Which fields are not written to db?
All fields are written successfully.
I've set up a CentOS 8 VM 64bit and tried to reproduce this behavior - without success. Everthing worked fine.
The environment is:
Can you imagine any differences?
The environment same as mine. I think the the fields NOT serialized cause the issue. the gist code have remove the fields NOT serialized ,so it work normally. Do you test it with those fields ?
I've enhanced the gist with the not serialized fields and the code is still working. It must be something different.
Could you provide me the stacktrace of your attempt?
libc.so.6!raise
libc.so.6!abort
libc.so.6!__libc_message
libc.so.6!malloc_printerr
libc.so.6!_int_free
matador::object_proxy::destroy
libmatador-object.so.0!matador::prototype_node::clear(bool)
libmatador-object.so.0!matador::object_store::remove_prototype_node(matador::prototype_node, bool)
libmatador-object.so.0!matador::object_store::clear(bool)
libmatador-object.so.0!matador::object_store::~object_store()
libmatador-orm.so.0!matador::persistence::~persistence()
I think without the possibility to debug, it's hard to find the problem.
Does the code work if you remove the not serialized fields? Did you use the gist?
How is the object inserted in your code?
As far as can't reproduce the behavior and there is no further information neither debug information, I'll close this issue.
my app Aborted at this row. persistence p(MYSQL_LINK);
SQL: CREATE TABLE
mediaserver_conf
(id
BIGINT NOT NULL PRIMARY KEY,DEV_NAME
VARCHAR(255),strVhost
VARCHAR(255),strApp
VARCHAR(255),strId
VARCHAR(255),wchannel
INTEGER,dwStreamType
INTEGER UNSIGNED,fDuration
DOUBLE,bEanbleRtsp
INTEGER,bEanbleRtmp
INTEGER,bEanbleHls
INTEGER,bEnableMp4
INTEGER,bUseAsynLogin
INTEGER,wPort
INTEGER,sDeviceAddress
VARCHAR(255),sUserName
VARCHAR(255),sPassword
VARCHAR(255)) SQL: START TRANSACTION SQL: INSERT INTOmediaserver_conf
(id
,DEV_NAME
,strVhost
,strApp
,strId
,wchannel
,dwStreamType
,fDuration
,bEanbleRtsp
,bEanbleRtmp
,bEanbleHls
,bEnableMp4
,bUseAsynLogin
,wPort
,sDeviceAddress
,sUserName
,sPassword
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) SQL: COMMIT free(): invalid pointerstruct s_mediaserverconf { ///id identifier id;
char DEV_NAME[255];
char strVhost[255];
char strApp[255];
char strId[255];
int wchannel;
DWORD dwStreamType;
};
Some fileds will not stored in the mysql.
### Read the data from mysql normally, but create the table will abort.