{"action":"created","issue":{"url":"https://api.github.com/repos/jdf/processing.py/issues/197","repository_url":"https://api.github.com/repos/jdf/processing.py","labels_url":"https://api.github.com/repos/jdf/processing.py/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/jdf/processing.py/issues/197/comments","events_url":"https://api.github.com/repos/jdf/processing.py/issues/197/events","html_url":"https://github.com/jdf/processing.py/issues/197","id":144696685,"number":197,"title":"Display window (PAppletJythonDriver) crashes 1 in 5 times on average in Windows 7","user":{"login":"indranilsinharoy","id":1771105,"avatar_url":"https://avatars.githubusercontent.com/u/1771105?v=3","gravatar_id":"","url":"https://api.github.com/users/indranilsinharoy","html_url":"https://github.com/indranilsinharoy","followers_url":"https://api.github.com/users/indranilsinharoy/followers","following_url":"https://api.github.com/users/indranilsinharoy/following{/other_user}","gists_url":"https://api.github.com/users/indranilsinharoy/gists{/gist_id}","starred_url":"https://api.github.com/users/indranilsinharoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indranilsinharoy/subscriptions","organizations_url":"https://api.github.com/users/indranilsinharoy/orgs","repos_url":"https://api.github.com/users/indranilsinharoy/repos","events_url":"https://api.github.com/users/indranilsinharoy/events{/privacy}","received_events_url":"https://api.github.com/users/indranilsinharoy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"codeanticode","id":62246,"avatar_url":"https://avatars.githubusercontent.com/u/62246?v=3","gravatar_id":"","url":"https://api.github.com/users/codeanticode","html_url":"https://github.com/codeanticode","followers_url":"https://api.github.com/users/codeanticode/followers","following_url":"https://api.github.com/users/codeanticode/following{/other_user}","gists_url":"https://api.github.com/users/codeanticode/gists{/gist_id}","starred_url":"https://api.github.com/users/codeanticode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeanticode/subscriptions","organizations_url":"https://api.github.com/users/codeanticode/orgs","repos_url":"https://api.github.com/users/codeanticode/repos","events_url":"https://api.github.com/users/codeanticode/events{/privacy}","received_events_url":"https://api.github.com/users/codeanticode/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2016-03-30T19:30:23Z","updated_at":"2016-03-31T10:06:23Z","closed_at":null,"body":"Hi, \r\nI started using processing.py (and processing itself) a few days back. Firstly, thanks for creating the Python mode. It is great, and I think that it can be a superb tool for teaching programming to toddlers. \r\n\r\nEverything has been working wonderfully until I came across this strange crash. It seems to happen only in the Python mode. I have tested the equivalent Java code, which seems to run fine. \r\n\r\nHere is a minimum replicable code snippet in Python. When I run this code, the display window (PAppletJythonDriver) crashes 1 out of 5 times on average. When it crashes, the window comes up very briefly and then closes, while the code continues to execute (as I can still use the \"stop\" button to stop the execution).\r\n\r\n```python\r\ndef setup():\r\n    size(640, 480, P3D)\r\n        \r\ndef draw():\r\n    background(0.5)    \r\n    translate(width/2.0, height/2.0, 0)\r\n    box(20)\r\n    draw_axes(l=100)\r\n    \r\ndef draw_axes(x=0, y=0, z=0, l=20):\r\n    axes = createShape(GROUP)\r\n    # x axis\r\n    xaxis = createShape()\r\n    xaxis.setStroke(color(255, 0, 0))\r\n    xaxis.beginShape(LINES)\r\n    xaxis.vertex(0, 0, 0)\r\n    xaxis.vertex(l, 0, 0)\r\n    xaxis.endShape()\r\n    \r\n    axes.addChild(xaxis)    \r\n    shape(axes)\r\n``` \r\n\r\nI have tested the following equivalent code in Java, and in my test runs (over 10 times), I did not experience any crash. \r\n\r\n```java\r\nPShape axes, xaxis;\r\n\r\nvoid setup() {\r\n  size(640, 480, P3D);\r\n}\r\n\r\nvoid draw(){\r\n  background(0.5);\r\n  translate(width/2, height/2, 0);\r\n  box(20);\r\n  draw_axes(100);\r\n}\r\n\r\nvoid draw_axes(float l){\r\n  axes = createShape(GROUP);\r\n  // x axis\r\n  xaxis = createShape();\r\n  xaxis.setStroke(color(255, 0, 0));\r\n  xaxis.beginShape(LINES);\r\n  xaxis.vertex(0, 0, 0);\r\n  xaxis.vertex(l, 0, 0);\r\n  xaxis.endShape();\r\n  \r\n  axes.addChild(xaxis);\r\n  shape(axes);\r\n}\r\n\r\n```\r\n\r\nUpdate: \r\nEnvironment is Windows 7, 64 bit. \r\nProcessing 3 with Python Module build 3005.\r\n\r\nThanks very much.\r\nIndranil."},"comment":{"url":"https://api.github.com/repos/jdf/processing.py/issues/comments/203862306","html_url":"https://github.com/jdf/processing.py/issues/197#issuecomment-203862306","issue_url":"https://api.github.com/repos/jdf/processing.py/issues/197","id":203862306,"user":{"login":"jdf","id":55948,"avatar_url":"https://avatars.githubusercontent.com/u/55948?v=3","gravatar_id":"","url":"https://api.github.com/users/jdf","html_url":"https://github.com/jdf","followers_url":"https://api.github.com/users/jdf/followers","following_url":"https://api.github.com/users/jdf/following{/other_user}","gists_url":"https://api.github.com/users/jdf/gists{/gist_id}","starred_url":"https://api.github.com/users/jdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdf/subscriptions","organizations_url":"https://api.github.com/users/jdf/orgs","repos_url":"https://api.github.com/users/jdf/repos","events_url":"https://api.github.com/users/jdf/events{/privacy}","received_events_url":"https://api.github.com/users/jdf/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T10:06:23Z","updated_at":"2016-03-31T10:06:23Z","body":"Thank you.. It may be relevant that python mode's sketch runner is a\nlong=lived process, and does not exit after running a sketch. The sketch\nhere does not crash the first time it's run, but always crashes the second\ntime.\n\nOn Wednesday, March 30, 2016, codeanticode <notifications@github.com> wrote:\n\n> OK, I will start by running some tests of this code on a Windows 10\n> machine.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/jdf/processing.py/issues/197#issuecomment-203736173>\n>\n\n\n-- \nJonathan Feinberg  jdf@pobox.com  http://MrFeinberg.com/\n"}}