{"action":"created","issue":{"url":"https://api.github.com/repos/clearlinux/swupd-server/issues/22","repository_url":"https://api.github.com/repos/clearlinux/swupd-server","labels_url":"https://api.github.com/repos/clearlinux/swupd-server/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/clearlinux/swupd-server/issues/22/comments","events_url":"https://api.github.com/repos/clearlinux/swupd-server/issues/22/events","html_url":"https://github.com/clearlinux/swupd-server/pull/22","id":155484311,"number":22,"title":"Do not prepend empty items","user":{"login":"igor-stoppa","id":886345,"avatar_url":"https://avatars.githubusercontent.com/u/886345?v=3","gravatar_id":"","url":"https://api.github.com/users/igor-stoppa","html_url":"https://github.com/igor-stoppa","followers_url":"https://api.github.com/users/igor-stoppa/followers","following_url":"https://api.github.com/users/igor-stoppa/following{/other_user}","gists_url":"https://api.github.com/users/igor-stoppa/gists{/gist_id}","starred_url":"https://api.github.com/users/igor-stoppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igor-stoppa/subscriptions","organizations_url":"https://api.github.com/users/igor-stoppa/orgs","repos_url":"https://api.github.com/users/igor-stoppa/repos","events_url":"https://api.github.com/users/igor-stoppa/events{/privacy}","received_events_url":"https://api.github.com/users/igor-stoppa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-05-18T12:03:49Z","updated_at":"2016-06-01T11:09:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/clearlinux/swupd-server/pulls/22","html_url":"https://github.com/clearlinux/swupd-server/pull/22","diff_url":"https://github.com/clearlinux/swupd-server/pull/22.diff","patch_url":"https://github.com/clearlinux/swupd-server/pull/22.patch"},"body":"When the item is not found, do not add it to the list.\r\nIt will cause segfaults later on, where the code\r\ndereferences the pointer under the assumption that it is\r\nnot NULL.\r\n\r\nSigned-off-by: Igor Stoppa <igor.stoppa@intel.com>"},"comment":{"url":"https://api.github.com/repos/clearlinux/swupd-server/issues/comments/222961994","html_url":"https://github.com/clearlinux/swupd-server/pull/22#issuecomment-222961994","issue_url":"https://api.github.com/repos/clearlinux/swupd-server/issues/22","id":222961994,"user":{"login":"incandescant","id":672,"avatar_url":"https://avatars.githubusercontent.com/u/672?v=3","gravatar_id":"","url":"https://api.github.com/users/incandescant","html_url":"https://github.com/incandescant","followers_url":"https://api.github.com/users/incandescant/followers","following_url":"https://api.github.com/users/incandescant/following{/other_user}","gists_url":"https://api.github.com/users/incandescant/gists{/gist_id}","starred_url":"https://api.github.com/users/incandescant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incandescant/subscriptions","organizations_url":"https://api.github.com/users/incandescant/orgs","repos_url":"https://api.github.com/users/incandescant/repos","events_url":"https://api.github.com/users/incandescant/events{/privacy}","received_events_url":"https://api.github.com/users/incandescant/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T11:09:57Z","updated_at":"2016-06-01T11:09:57Z","body":"I've been digging into this some more this morning, the [phase 3 processing loops](https://github.com/clearlinux/swupd-server/blob/ea02b67a93f2ce26508ed08c99eb9ed03a00acd3/src/create_update.c#L366-403) we load all of the manifests listed in the groups.ini file into hash tables, new manifests from the directory and old manifests from the files on disk.\r\n\r\nWe then iterate the manifests and expand any named includes, this is where we run into the segfault. When processing the first bundle there's an include for the os-core bundle (the default behaviour), however the groups.ini file we generate in meta-swupd doesn't list os-core. Thus when we do the [name_includes loop over the old_manifests](https://github.com/clearlinux/swupd-server/blob/ea02b67a93f2ce26508ed08c99eb9ed03a00acd3/src/create_update.c#L395-L402) the g_hash_table_lookup(old_manifests, \"os-core\") call returns NULL and we then insert that into the manifest->includes list with the os-core key.\r\n\r\nAt this point it's not clear to me whether swupd expects os-core to be explicitly listed in groups.ini? Or whether there should be some extra logic to do the right thing when the os-core named include is found?\r\n\r\nFWIW: not listing os-core in groups.ini hasn't caused any issues up to this point."}}
{"actor":{"display_login":"incandescant"}}