{"action":"created","issue":{"url":"https://api.github.com/repos/sqlcipher/sqlcipher/issues/179","repository_url":"https://api.github.com/repos/sqlcipher/sqlcipher","labels_url":"https://api.github.com/repos/sqlcipher/sqlcipher/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/sqlcipher/sqlcipher/issues/179/comments","events_url":"https://api.github.com/repos/sqlcipher/sqlcipher/issues/179/events","html_url":"https://github.com/sqlcipher/sqlcipher/issues/179","id":176760425,"number":179,"title":"NULL pointer dereference in sqlite3PcacheRefCount pCache","user":{"login":"chrisballinger","id":518687,"avatar_url":"https://avatars.githubusercontent.com/u/518687?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisballinger","html_url":"https://github.com/chrisballinger","followers_url":"https://api.github.com/users/chrisballinger/followers","following_url":"https://api.github.com/users/chrisballinger/following{/other_user}","gists_url":"https://api.github.com/users/chrisballinger/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisballinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisballinger/subscriptions","organizations_url":"https://api.github.com/users/chrisballinger/orgs","repos_url":"https://api.github.com/users/chrisballinger/repos","events_url":"https://api.github.com/users/chrisballinger/events{/privacy}","received_events_url":"https://api.github.com/users/chrisballinger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-13T21:54:24Z","updated_at":"2016-09-13T22:25:19Z","closed_at":"2016-09-13T22:25:19Z","body":"### Expected Behavior\r\n\r\nNormal operation.\r\n\r\n### Actual Behavior\r\n\r\nCrash.\r\n\r\n### Steps to Reproduce\r\n\r\nSQLCipher is integrated using CocoaPods and is being invoked by the [libsqlfs](https://github.com/guardianproject/libsqlfs/blob/master/sqlfs.c) library. [YapDatabase](https://github.com/yapstudios/YapDatabase) also uses SQLCipher within the same application and doesn't cause a crash. Yap issues some [pragma commands](https://github.com/yapstudios/YapDatabase/blob/e05584ad54b827844866e840cb4aa0ffbe14a6f3/YapDatabase/YapDatabase.m#L816) to change the cipher page size but on a separate unrelated database.\r\n\r\nEverything worked fine when integrated with CocoaPods 0.39 and Xcode 7. We updated to CocoaPods 1.0.1 and Xcode 8 and started seeing this crash and can't seem to figure out why it started failing when the code itself is unchanged. Possibly a compiler bug?\r\n\r\n<img width=\"279\" alt=\"screen shot 2016-09-13 at 2 45 22 pm\" src=\"https://cloud.githubusercontent.com/assets/518687/18492573/dc0ad53a-79c0-11e6-95c9-8f325969842c.png\">\r\n\r\n\r\n`pCache` is NULL:\r\n\r\n```c\r\n/* \r\n** Return the total number of references to all pages held by the cache.\r\n**\r\n** This is not the total number of pages referenced, but the sum of the\r\n** reference count for all pages.\r\n*/\r\nSQLITE_PRIVATE int sqlite3PcacheRefCount(PCache *pCache){\r\n  return pCache->nRefSum;\r\n}\r\n```\r\nSQLCipher version: 3.4.0"},"comment":{"url":"https://api.github.com/repos/sqlcipher/sqlcipher/issues/comments/246845384","html_url":"https://github.com/sqlcipher/sqlcipher/issues/179#issuecomment-246845384","issue_url":"https://api.github.com/repos/sqlcipher/sqlcipher/issues/179","id":246845384,"user":{"login":"chrisballinger","id":518687,"avatar_url":"https://avatars.githubusercontent.com/u/518687?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisballinger","html_url":"https://github.com/chrisballinger","followers_url":"https://api.github.com/users/chrisballinger/followers","following_url":"https://api.github.com/users/chrisballinger/following{/other_user}","gists_url":"https://api.github.com/users/chrisballinger/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisballinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisballinger/subscriptions","organizations_url":"https://api.github.com/users/chrisballinger/orgs","repos_url":"https://api.github.com/users/chrisballinger/repos","events_url":"https://api.github.com/users/chrisballinger/events{/privacy}","received_events_url":"https://api.github.com/users/chrisballinger/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T22:25:19Z","updated_at":"2016-09-13T22:25:19Z","body":"Durrrrr figured it out. I was pulling in both the `libsqlfs` and `libsqlfs/SQLCipher` pods which linked against both Apple and SQLCipher."}}
{"actor":{"display_login":"chrisballinger"}}