{"action":"created","issue":{"url":"https://api.github.com/repos/epics-base/pvAccessCPP/issues/30","repository_url":"https://api.github.com/repos/epics-base/pvAccessCPP","labels_url":"https://api.github.com/repos/epics-base/pvAccessCPP/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/epics-base/pvAccessCPP/issues/30/comments","events_url":"https://api.github.com/repos/epics-base/pvAccessCPP/issues/30/events","html_url":"https://github.com/epics-base/pvAccessCPP/issues/30","id":138158212,"number":30,"title":"Server-side seg fault with pvaSrv when monitor client exits","user":{"login":"dhickin","id":6115551,"avatar_url":"https://avatars.githubusercontent.com/u/6115551?v=3","gravatar_id":"","url":"https://api.github.com/users/dhickin","html_url":"https://github.com/dhickin","followers_url":"https://api.github.com/users/dhickin/followers","following_url":"https://api.github.com/users/dhickin/following{/other_user}","gists_url":"https://api.github.com/users/dhickin/gists{/gist_id}","starred_url":"https://api.github.com/users/dhickin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhickin/subscriptions","organizations_url":"https://api.github.com/users/dhickin/orgs","repos_url":"https://api.github.com/users/dhickin/repos","events_url":"https://api.github.com/users/dhickin/events{/privacy}","received_events_url":"https://api.github.com/users/dhickin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/epics-base/pvAccessCPP/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"msekoranja","id":3854164,"avatar_url":"https://avatars.githubusercontent.com/u/3854164?v=3","gravatar_id":"","url":"https://api.github.com/users/msekoranja","html_url":"https://github.com/msekoranja","followers_url":"https://api.github.com/users/msekoranja/followers","following_url":"https://api.github.com/users/msekoranja/following{/other_user}","gists_url":"https://api.github.com/users/msekoranja/gists{/gist_id}","starred_url":"https://api.github.com/users/msekoranja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msekoranja/subscriptions","organizations_url":"https://api.github.com/users/msekoranja/orgs","repos_url":"https://api.github.com/users/msekoranja/repos","events_url":"https://api.github.com/users/msekoranja/events{/privacy}","received_events_url":"https://api.github.com/users/msekoranja/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-03-03T11:58:28Z","updated_at":"2016-03-15T18:15:14Z","closed_at":null,"body":"<p>If you start an IOC running pvaSrv and monitor a PV using pvget -m then when the client exits there is a server-side seg fault.</p>\r\n\r\n<p>Specifically I've seen this with pvaSrv/testTop and exampleCPP/database</p>\r\n\r\n<p>e.g. for testTop</p>\r\n\r\n<p>Server-side:</p>\r\n[pvaSrv]$ ../../bin/linux-x86_64/testDbPv st.cmd\r\n\r\n<p>Client-side:</p>\r\nany pvget -m, e.g\r\n\r\n$ pvget -m double01\r\n\r\n<p>then ^C</p>\r\n\r\n<p>I've only seen this after the merge of PR  #27 (merge of major gateway support changes to master branch).</p>\r\n\r\n<p>Rolling back to an earlier pvAccess (I used f0b88e349b0193e3621b76ba17321b9ff09a7ba3 Merge pull request #22 from mdavidsaver/pvsubdir) I don't see the problem.</p>\r\n\r\n<p>Seen for every type of record in these examples and with every request I've tried.<br/>\r\nGets and puts unaffected. RPC unaffected.<br/>\r\nDoes not affect caProvider (i.e. if you monitor ca:///<pv-name>).<br/>\r\npvDatabase PVs unaffected<br/>\r\nSeen with 3.14.12.3 and 3.15.2/3<br/>\r\nSeen on both my RHEL system at DLS and on my mint PC at home.<br/>\r\nDoes not matter if monitors are on same or different machines.</p><br/>\r\n\r\n<p>\r\nRHEL 6 OS:<br/>\r\nOS:<br/>\r\n$ lsb_release -a<br/>\r\nLSB Version:\t:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch<br/>\r\nDistributor ID:\tRedHatEnterpriseWorkstation\r\nDescription:\tRed Hat Enterprise Linux Workstation release 6.7 (Santiago)<br/>\r\nRelease:\t6.7<br/>\r\nCodename:\tSantiago<br/>\r\n</p>\r\n\r\ngdb/valgrind info to follow.\r\n"},"comment":{"url":"https://api.github.com/repos/epics-base/pvAccessCPP/issues/comments/196956670","html_url":"https://github.com/epics-base/pvAccessCPP/issues/30#issuecomment-196956670","issue_url":"https://api.github.com/repos/epics-base/pvAccessCPP/issues/30","id":196956670,"user":{"login":"mrkraimer","id":6115542,"avatar_url":"https://avatars.githubusercontent.com/u/6115542?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkraimer","html_url":"https://github.com/mrkraimer","followers_url":"https://api.github.com/users/mrkraimer/followers","following_url":"https://api.github.com/users/mrkraimer/following{/other_user}","gists_url":"https://api.github.com/users/mrkraimer/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkraimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkraimer/subscriptions","organizations_url":"https://api.github.com/users/mrkraimer/orgs","repos_url":"https://api.github.com/users/mrkraimer/repos","events_url":"https://api.github.com/users/mrkraimer/events{/privacy}","received_events_url":"https://api.github.com/users/mrkraimer/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T18:15:14Z","updated_at":"2016-03-15T18:15:14Z","body":"On 03/15/2016 01:26 PM, mdavidsaver wrote:\n>\n>     gdb/valgrind info to follow.\n>\n> What were the results w/ valgrind for linux-x86 (non -debug)?\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly or view it on GitHub \n> <https://github.com/epics-base/pvAccessCPP/issues/30#issuecomment-196935585>\n>\n\nI can make it happen with the following.\n\nmrk> pwd\n/home/epicsv4/master/exampleCPP/database/iocBoot/exampleDatabase\nmrk> valgrind --log-file=crash --leak-check=full \n../../bin/linux-x86_64/exampleDatabase st.cmd\n\nAnd in another window:\n\nmrk> pwd\n/home/epicsv4/master/exampleCPP/exampleClient\nmrk> bin/linux-x86_64/examplePvaClientMultiDouble\n\n\nI had to run the example many times but finally exampleDatabase crashes.\n\nThe file crash has the followimg:\n\n==16277== Memcheck, a memory error detector\n==16277== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.\n==16277== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info\n==16277== Command: ../../bin/linux-x86_64/exampleDatabase st.cmd\n==16277== Parent PID: 15008\n==16277==\n==16277== Thread 37 TCP-rx:\n==16277== Jump to the invalid address stated on the next line\n==16277==    at 0x100000005ED1513: ???\n==16277==    by 0x14D98DFF: ???\n==16277==  Address 0x100000005ed1513 is not stack'd, malloc'd or \n(recently) free'd\n==16277==\n==16277==\n==16277== Process terminating with default action of signal 11 (SIGSEGV)\n==16277==  Bad permissions for mapped region at address 0x100000005ED1513\n==16277==    at 0x100000005ED1513: ???\n==16277==    by 0x14D98DFF: ???\n==16277==\n==16277== HEAP SUMMARY:\n==16277==     in use at exit: 2,928,378 bytes in 15,927 blocks\n==16277==   total heap usage: 32,146 allocs, 16,219 frees, 6,927,037 \nbytes allocated\n==16277==\n==16277== Thread 1:\n==16277== 28 bytes in 1 blocks are definitely lost in loss record 498 of \n3,278\n==16277==    at 0x4C28C50: malloc (in \n/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)\n==16277==    by 0x5ED111E: mallocMustSucceed (cantProceed.c:44)\n==16277==    by 0x5ED9C02: epicsEnvSet (osdEnv.c:43)\n==16277==    by 0x5ECC80F: iocshLoad (iocsh.cpp:894)\n==16277==    by 0x4042F1: main (exampleDatabaseMain.cpp:24)\n\nLots of similar output and then:\n\n==16277== LEAK SUMMARY:\n==16277==    definitely lost: 627 bytes in 8 blocks\n==16277==    indirectly lost: 2,767 bytes in 53 blocks\n==16277==      possibly lost: 29,240 bytes in 58 blocks\n==16277==    still reachable: 2,895,744 bytes in 15,808 blocks\n==16277==                       of which reachable via heuristic:\n==16277==                         newarray           : 192 bytes in 2 blocks\n==16277==         suppressed: 0 bytes in 0 blocks\n==16277== Reachable blocks (those to which a pointer was found) are not \nshown.\n==16277== To see them, rerun with: --leak-check=full --show-leak-kinds=all\n\nI will guess that the most important info is:\n\n==16277== Thread 37 TCP-rx:\n==16277== Jump to the invalid address stated on the next line\n==16277==    at 0x100000005ED1513: ???\n==16277==    by 0x14D98DFF: ???\n==16277==  Address 0x100000005ed1513 is not stack'd, malloc'd or \n(recently) free'd\n\n\n"}}