{"action":"opened","issue":{"url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/16","labels_url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/16/comments","events_url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/16/events","html_url":"https://github.com/mcmtroffaes/pycddlib/issues/16","id":127845864,"number":16,"title":"Setting a Polygon's rep_type causes a segfault crash","user":{"login":"haudren","id":4352562,"avatar_url":"https://avatars.githubusercontent.com/u/4352562?v=3","gravatar_id":"","url":"https://api.github.com/users/haudren","html_url":"https://github.com/haudren","followers_url":"https://api.github.com/users/haudren/followers","following_url":"https://api.github.com/users/haudren/following{/other_user}","gists_url":"https://api.github.com/users/haudren/gists{/gist_id}","starred_url":"https://api.github.com/users/haudren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haudren/subscriptions","organizations_url":"https://api.github.com/users/haudren/orgs","repos_url":"https://api.github.com/users/haudren/repos","events_url":"https://api.github.com/users/haudren/events{/privacy}","received_events_url":"https://api.github.com/users/haudren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-21T05:07:29Z","updated_at":"2016-01-21T05:07:29Z","closed_at":null,"body":"Hello,\r\n\r\nI was tinkering with pycddlib to check whether `dd_DDInputAppend` does or does not work. After analysis of the source code, it does *not*, quote:\r\n> /* This is imcomplete.  It simply solves the problem from scratch.  */\r\n\r\nBut the interesting thing is that it changes the polyhedron's representation type on line 323 of cddlib.c:\r\n> (*poly)->representation=dd_Inequality;\r\n\r\nI have no idea why this is done. However, trying to do the same in Python:\r\nhttps://gist.github.com/haudren/74f59121e902e2026847\r\n\r\nResults in:\r\n> [1]    5776 segmentation fault  python test_extend_poly.py\r\n\r\nGdb backtrace (quick and dirty):\r\n```gdb\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n__pyx_setprop_3cdd_10Polyhedron_rep_type (o=0x7ffff3327dc8, v=<optimized out>, x=<optimized out>)\r\n    at cdd.c:11259\r\n11259\t    return __pyx_pw_3cdd_10Polyhedron_8rep_type_3__set__(o, v);\r\n(gdb) bt\r\n#0  __pyx_setprop_3cdd_10Polyhedron_rep_type (o=0x7ffff3327dc8, v=<optimized out>, x=<optimized out>)\r\n    at cdd.c:11259\r\n#1  0x00000000004ad23a in _PyObject_GenericSetAttrWithDict ()\r\n#2  0x00000000004ad9dd in PyObject_SetAttr ()\r\n#3  0x000000000049a356 in PyEval_EvalFrameEx ()\r\n#4  0x00000000004a1634 in ?? ()\r\n#5  0x000000000044e4a5 in PyRun_FileExFlags ()\r\n#6  0x000000000044ec9f in PyRun_SimpleFileExFlags ()\r\n#7  0x000000000044f904 in Py_Main ()\r\n#8  0x00007ffff7818ec5 in __libc_start_main (main=0x44f9c2 <main>, argc=2, argv=0x7fffffffe448, \r\n    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe438)\r\n    at libc-start.c:287\r\n#9  0x0000000000578c4e in _start ()\r\n```\r\n\r\nI am not sure that anyone should *ever* have to change a polyhedron's representation, so I am not sure this is really useful. I quickly checked cdd's documentation but could not find any trace of when/why one should set a polyhedron's RepType."}}