{"action":"created","issue":{"url":"https://api.github.com/repos/pybind/pybind11/issues/461","repository_url":"https://api.github.com/repos/pybind/pybind11","labels_url":"https://api.github.com/repos/pybind/pybind11/issues/461/labels{/name}","comments_url":"https://api.github.com/repos/pybind/pybind11/issues/461/comments","events_url":"https://api.github.com/repos/pybind/pybind11/issues/461/events","html_url":"https://github.com/pybind/pybind11/issues/461","id":184659842,"number":461,"title":"Crashing (too many methods?)","user":{"login":"ibell","id":1859947,"avatar_url":"https://avatars.githubusercontent.com/u/1859947?v=3","gravatar_id":"","url":"https://api.github.com/users/ibell","html_url":"https://github.com/ibell","followers_url":"https://api.github.com/users/ibell/followers","following_url":"https://api.github.com/users/ibell/following{/other_user}","gists_url":"https://api.github.com/users/ibell/gists{/gist_id}","starred_url":"https://api.github.com/users/ibell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibell/subscriptions","organizations_url":"https://api.github.com/users/ibell/orgs","repos_url":"https://api.github.com/users/ibell/repos","events_url":"https://api.github.com/users/ibell/events{/privacy}","received_events_url":"https://api.github.com/users/ibell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-22T23:00:02Z","updated_at":"2016-10-22T23:20:58Z","closed_at":null,"body":"I hope there is some way that I can explain what I am doing, and you can tell me if I am doing something crazy, or if this is a serious bug in ``pybind11``.  \r\n\r\nI have a factory function that generates instances of classes derived from an ABC, and then lots (150) of methods bounds to the ABC (AbstractState) that is returned.  Nearly all these functions are boring POD-type functions, some take enumerated values, etc..  But it seems there is a limit to the number of functions I can have.  If I use all 150 functions, I get weird, random seg faults all over the place, but the module compiles properly.  If I only enable something like 100 of the methods, the code runs properly.\r\n\r\nFWIW, I have no intention to extend the AbstractState in python-land, so I don't think all the trampoline machinery is required, right?\r\n\r\n``` C++\r\n\r\n#include <pybind11/pybind11.h>\r\n#include <pybind11/stl.h>\r\nnamespace py = pybind11;\r\n\r\nCoolProp::AbstractState * factory(const std::string &backend, const std::string &fluid_names) {\r\n    return CoolProp::AbstractState::factory(backend, fluid_names);\r\n}\r\n\r\nvoid init_CoolProp(py::module &m){\r\n    using namespace CoolProp;\r\n\r\n    py::class_<AbstractState>(m, \"AbstractState\")\r\n        .def(\"set_T\", &AbstractState::set_T)\r\n        .def(\"backend_name\", &AbstractState::backend_name)\r\n        .def(\"using_mole_fractions\", &AbstractState::using_mole_fractions)\r\n        .def(\"using_mass_fractions\", &AbstractState::using_mass_fractions)\r\n        .def(\"using_volu_fractions\", &AbstractState::using_volu_fractions)\r\n        .def(\"set_mole_fractions\", &AbstractState::set_mole_fractions)\r\n        .def(\"set_mass_fractions\", &AbstractState::set_mass_fractions)\r\n        .def(\"set_volu_fractions\", &AbstractState::set_volu_fractions)\r\n        ......\r\n         ;\r\n    m.def(\"AbstractState\", &factory);\r\n}\r\n\r\n\r\n#if defined(COOLPROP_PYBIND11_MODULE)\r\nPYBIND11_PLUGIN(CoolProp) {\r\n    py::module m(\"CoolProp\", \"CoolProp module\");\r\n\r\n    init_CoolProp(m);\r\n\r\n    return m.ptr();\r\n}\r\n#endif\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pybind/pybind11/issues/comments/255559866","html_url":"https://github.com/pybind/pybind11/issues/461#issuecomment-255559866","issue_url":"https://api.github.com/repos/pybind/pybind11/issues/461","id":255559866,"user":{"login":"ibell","id":1859947,"avatar_url":"https://avatars.githubusercontent.com/u/1859947?v=3","gravatar_id":"","url":"https://api.github.com/users/ibell","html_url":"https://github.com/ibell","followers_url":"https://api.github.com/users/ibell/followers","following_url":"https://api.github.com/users/ibell/following{/other_user}","gists_url":"https://api.github.com/users/ibell/gists{/gist_id}","starred_url":"https://api.github.com/users/ibell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibell/subscriptions","organizations_url":"https://api.github.com/users/ibell/orgs","repos_url":"https://api.github.com/users/ibell/repos","events_url":"https://api.github.com/users/ibell/events{/privacy}","received_events_url":"https://api.github.com/users/ibell/received_events","type":"User","site_admin":false},"created_at":"2016-10-22T23:20:58Z","updated_at":"2016-10-22T23:20:58Z","body":"I guess in general, I feel like if two things have the same alias, maybe pybind11 shouldn't allow that at all?  But you guys are the ones in charge, so I'll let you decide."}}
{"actor":{"display_login":"ibell"}}