fledge-iot / fledge

An open source platform for the Industrial Internet of Things, it acts as an edge gateway between sensor devices and cloud storage systems.
https://www.lfedge.org/projects/fledge/
Apache License 2.0
124 stars 44 forks source link

FOGL-8899: Fix for double free #1418

Closed AmandeepArora closed 2 months ago

AmandeepArora commented 2 months ago

Crash was due to double free for a sqlite's error msg buffer. That is fixed. But DB file is corrupted:

Jul 10 12:45:06 193PRC-EGD0001 FogLAMP Storage[834311]: ERROR: SQL statement DELETE FROM foglamp.statistics_history WHERE history_ts <= '2024-06-10 12:45:04.778127'; failed after maximum retries
Jul 10 12:45:06 193PRC-EGD0001 FogLAMP Storage[834311]: ERROR: Database error after maximum retries, executing DELETE operation on statistics_history
Jul 10 12:45:06 193PRC-EGD0001 FogLAMP Storage[834311]: ERROR: SQLite3 storage plugin raising error: delete: database disk image is malformed
Jul 10 12:45:06 193PRC-EGD0001 FogLAMP Storage[834311]: ERROR: SQL statement: DELETE FROM foglamp.statistics_history WHERE history_ts <= '2024-06-10 12:45:04.778127';
Jul 10 12:45:06 193PRC-EGD0001 FogLAMP purge[835279] ERROR: logger: foglamp.common.storage_client.storage_client: Error code: 400, reason: Bad Request, details: {'entryPoint': 'delete', 'message': 'database disk image is malformed', 'retryable': False}

Will investigate that further.