{"action":"created","issue":{"url":"https://api.github.com/repos/citusdata/citus/issues/1338","repository_url":"https://api.github.com/repos/citusdata/citus","labels_url":"https://api.github.com/repos/citusdata/citus/issues/1338/labels{/name}","comments_url":"https://api.github.com/repos/citusdata/citus/issues/1338/comments","events_url":"https://api.github.com/repos/citusdata/citus/issues/1338/events","html_url":"https://github.com/citusdata/citus/issues/1338","id":222559261,"number":1338,"title":"Crash in CitusCopyFrom","user":{"login":"lfittl","id":7227,"avatar_url":"https://avatars1.githubusercontent.com/u/7227?v=3","gravatar_id":"","url":"https://api.github.com/users/lfittl","html_url":"https://github.com/lfittl","followers_url":"https://api.github.com/users/lfittl/followers","following_url":"https://api.github.com/users/lfittl/following{/other_user}","gists_url":"https://api.github.com/users/lfittl/gists{/gist_id}","starred_url":"https://api.github.com/users/lfittl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfittl/subscriptions","organizations_url":"https://api.github.com/users/lfittl/orgs","repos_url":"https://api.github.com/users/lfittl/repos","events_url":"https://api.github.com/users/lfittl/events{/privacy}","received_events_url":"https://api.github.com/users/lfittl/received_events","type":"User","site_admin":false},"labels":[{"id":320055696,"url":"https://api.github.com/repos/citusdata/citus/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-04-18T22:04:17Z","updated_at":"2017-04-24T05:59:11Z","closed_at":null,"body":"Debugged this with @anarazel:\r\n\r\n```\r\n(gdb) bt\r\n#0  FunctionCall1Coll (flinfo=0x7f0837c65fb8, collation=0, arg1=41301184) at fmgr.c:1297\r\n#1  0x00007f082c821202 in FindShardInterval (partitionColumnValue=<optimized out>, shardIntervalCache=0x7f0837c5cbe0, shardCount=32, partitionMethod=104 'h', compareFunction=<optimized out>, hashFunction=<optimized out>, useBinarySearch=0 '\\000')\r\n    at utils/shardinterval_utils.c:248\r\n#2  0x00007f082c7e0b0a in CopyToExistingShards (completionTag=0x7fff3ae56530 \"\", copyStatement=0x27130f8) at commands/multi_copy.c:465\r\n#3  CitusCopyFrom (copyStatement=0x27130f8, completionTag=0x7fff3ae56530 \"\") at commands/multi_copy.c:182\r\n#4  0x00007f082c7ed070 in ProcessCopyStmt (commandMustRunAsOwner=<optimized out>, completionTag=0x7fff3ae56530 \"\", copyStatement=0x27130f8) at executor/multi_utility.c:588\r\n#5  multi_ProcessUtility (parsetree=0x27130f8, \r\n    queryString=0x26e6e70 \"COPY \"..., \r\n    context=PROCESS_UTILITY_TOPLEVEL, params=0x0, dest=0x2713458, completionTag=0x7fff3ae56530 \"\") at executor/multi_utility.c:230\r\n#6  0x00007f082c134fae in pgss_ProcessUtility (parsetree=0x27130f8, \r\n    queryString=0x26e6e70 \"COPY \"...,\r\n    context=PROCESS_UTILITY_TOPLEVEL, params=0x0, dest=0x2713458, completionTag=0x7fff3ae56530 \"\") at pg_stat_statements.c:982\r\n#7  0x00000000006e0afc in PortalRunUtility (portal=0x2643c70, utilityStmt=0x27130f8, isTopLevel=1 '\\001', setHoldSnapshot=<optimized out>, dest=0x2713458, completionTag=0x7fff3ae56530 \"\") at pquery.c:1193\r\n#8  0x00000000006e19fb in PortalRunMulti (portal=0x2643c70, isTopLevel=1 '\\001', setHoldSnapshot=0 '\\000', dest=0x2713458, altdest=0x2713458, completionTag=0x7fff3ae56530 \"\") at pquery.c:1349\r\n#9  0x00000000006e2164 in PortalRun (portal=0x2643c70, count=9223372036854775807, isTopLevel=1 '\\001', dest=0x2713458, altdest=0x2713458, completionTag=0x7fff3ae56530 \"\") at pquery.c:815\r\n#10 0x00000000006de6f1 in exec_simple_query (\r\n    query_string=0x26e6e70 \"COPY \"...)\r\n    at postgres.c:1094\r\n#11 0x00000000006dffc8 in PostgresMain (argc=<optimized out>, argv=<optimized out>, dbname=0x26858a8 \"citus\", username=<optimized out>) at postgres.c:4076\r\n#12 0x00000000006809c5 in BackendRun (port=0x2681190) at postmaster.c:4271\r\n#13 BackendStartup (port=0x2681190) at postmaster.c:3945\r\n#14 ServerLoop () at postmaster.c:1701\r\n#15 PostmasterMain (argc=<optimized out>, argv=<optimized out>) at postmaster.c:1309\r\n#16 0x0000000000608b48 in main (argc=3, argv=0x26246b0) at main.c:228\r\n\r\n...\r\n(gdb)\r\n#2  0x00007f082c7e0b0a in CopyToExistingShards (completionTag=0x7fff3ae56530 \"\", copyStatement=0x27130f8) at commands/multi_copy.c:465\r\n465\tin commands/multi_copy.c\r\n(gdb) p *cacheEntry->hashFunction \r\n$10 = {fn_addr = 0x4949d0 <hashtext>, fn_oid = 400, fn_nargs = 1, fn_strict = 1 '\\001', fn_retset = 0 '\\000', fn_stats = 2 '\\002', fn_extra = 0x0, fn_mcxt = 0x269c7c0, fn_expr = 0x0}\r\n(gdb) p cacheEntry \r\n$11 = (DistTableCacheEntry *) 0x271a038\r\n```\r\n\r\nQuoting @anarazel \"Cache entry has been rebuilt and thats why the pointer to the hash function is pointing to freed memory\""},"comment":{"url":"https://api.github.com/repos/citusdata/citus/issues/comments/296531271","html_url":"https://github.com/citusdata/citus/issues/1338#issuecomment-296531271","issue_url":"https://api.github.com/repos/citusdata/citus/issues/1338","id":296531271,"user":{"login":"onderkalaci","id":7829470,"avatar_url":"https://avatars1.githubusercontent.com/u/7829470?v=3","gravatar_id":"","url":"https://api.github.com/users/onderkalaci","html_url":"https://github.com/onderkalaci","followers_url":"https://api.github.com/users/onderkalaci/followers","following_url":"https://api.github.com/users/onderkalaci/following{/other_user}","gists_url":"https://api.github.com/users/onderkalaci/gists{/gist_id}","starred_url":"https://api.github.com/users/onderkalaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onderkalaci/subscriptions","organizations_url":"https://api.github.com/users/onderkalaci/orgs","repos_url":"https://api.github.com/users/onderkalaci/repos","events_url":"https://api.github.com/users/onderkalaci/events{/privacy}","received_events_url":"https://api.github.com/users/onderkalaci/received_events","type":"User","site_admin":false},"created_at":"2017-04-24T05:59:11Z","updated_at":"2017-04-24T05:59:11Z","body":"> Quoting @anarazel \"Cache entry has been rebuilt and thats why the pointer to the hash function is pointing to freed memory\"\r\n\r\nIs the problem that this happens while copy continues?"}}
{"actor":{"display_login":"onderkalaci"}}