Skip to content
This repository has been archived by the owner. It is now read-only.

[dev.icinga.com #3409] ido2db_get_cached_object_ids fetches only one object_id and leaves memory fragments #1154

Closed
icinga-migration opened this issue Oct 29, 2012 · 4 comments

Comments

Projects
None yet
1 participant
@icinga-migration
Copy link
Member

commented Oct 29, 2012

This issue has been migrated from Redmine: https://dev.icinga.com/issues/3409

Created by abraxas on 2012-10-29 02:35:43 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2012-11-09 16:55:00 +00:00)
Target Version: 1.8.2
Last Update: 2014-12-08 14:46:50 +00:00 (in Redmine)

Icinga Version: 1.10.0
OS Version: any

ido2db_get_cached_object_ids does issue a select of all object_ids in the database, but within the while loop idi->dbinfo.dbi_result is freed and set to NULL preventing retrieval of any object_ids beyond the first. This step should only be called if the dbi_result_next_row returns 0. dbi_result_free should be called even if the SELECT call does return IDO_ERROR.

Additionaly dbi_result_get_string_copy (returns an allocated string) is handed over to ido2db_add_cached_object_id which created it's own allocated string via strdup. This leaks memory. As this function is only called during startup phase, the memory does not grow over time and the leaked memory is minimal.

Changesets

2012-10-29 18:59:49 +00:00 by mfriedrich 60124e9

idoutils: cleanly free name1/2 strings on libdbi ido2db_add_cached_object_id() call (refs #3409)

2012-10-29 19:17:36 +00:00 by mfriedrich 74dea3f

idoutils: fix ido2db_get_cached_object_ids fetches only one object_id and leaves memory fragments (thx Klaus Wagner) refs #3409
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Oct 29, 2012

Updated by mfriedrich on 2012-10-29 19:21:18 +00:00

  • Status changed from New to Assigned
  • Assigned to set to mfriedrich
  • Target Version set to 1.8.2

without a fix

Mon Oct 29 20:20:16 2012 .401212 [001.2] [pid=27739] [tid=140324736288512] ido2db_get_cached_object_ids(1) end

with the fix

Mon Oct 29 20:15:45 2012 .302910 [001.2] [pid=21020] [tid=140018895361792] ido2db_get_cached_object_ids(4391) end

thanks for the finding, fixes are up in git 'dev/ido' soon.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Nov 1, 2012

Updated by mfriedrich on 2012-11-01 14:37:29 +00:00

  • Status changed from Assigned to 7
  • Done % changed from 0 to 100
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Nov 9, 2012

Updated by mfriedrich on 2012-11-09 16:55:00 +00:00

  • Status changed from 7 to Resolved
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Dec 8, 2014

Updated by mfriedrich on 2014-12-08 14:46:50 +00:00

  • Project changed from 18 to Core, Classic UI, IDOUtils
  • Category changed from 79 to IDOUtils
  • Icinga Version changed from 1 to 1
  • OS Version set to any

@icinga-migration icinga-migration added this to the 1.8.2 milestone Jan 17, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.