{"action":"closed","issue":{"url":"https://api.github.com/repos/drmeister/clasp/issues/158","labels_url":"https://api.github.com/repos/drmeister/clasp/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/drmeister/clasp/issues/158/comments","events_url":"https://api.github.com/repos/drmeister/clasp/issues/158/events","html_url":"https://github.com/drmeister/clasp/issues/158","id":115649219,"number":158,"title":"Cannot cast tagged_pointer in constructor When Loading a Clbind Library","user":{"login":"Shinmera","id":4833204,"avatar_url":"https://avatars.githubusercontent.com/u/4833204?v=3","gravatar_id":"","url":"https://api.github.com/users/Shinmera","html_url":"https://github.com/Shinmera","followers_url":"https://api.github.com/users/Shinmera/followers","following_url":"https://api.github.com/users/Shinmera/following{/other_user}","gists_url":"https://api.github.com/users/Shinmera/gists{/gist_id}","starred_url":"https://api.github.com/users/Shinmera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shinmera/subscriptions","organizations_url":"https://api.github.com/users/Shinmera/orgs","repos_url":"https://api.github.com/users/Shinmera/repos","events_url":"https://api.github.com/users/Shinmera/events{/privacy}","received_events_url":"https://api.github.com/users/Shinmera/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/drmeister/clasp/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/drmeister/clasp/labels/clbind","name":"clbind","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/drmeister/clasp/milestones/2","html_url":"https://github.com/drmeister/clasp/milestones/0.4.0","labels_url":"https://api.github.com/repos/drmeister/clasp/milestones/2/labels","id":1320684,"number":2,"title":"0.4.0","description":"Major targets for this release:\r\n\r\n* Tagged pointers\r\n* Function inlining\r\n* Cleavir based compiler\r\n* New calling convention\r\n* Speed improvements\r\n* Clang style C++ code base","creator":{"login":"Shinmera","id":4833204,"avatar_url":"https://avatars.githubusercontent.com/u/4833204?v=3","gravatar_id":"","url":"https://api.github.com/users/Shinmera","html_url":"https://github.com/Shinmera","followers_url":"https://api.github.com/users/Shinmera/followers","following_url":"https://api.github.com/users/Shinmera/following{/other_user}","gists_url":"https://api.github.com/users/Shinmera/gists{/gist_id}","starred_url":"https://api.github.com/users/Shinmera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shinmera/subscriptions","organizations_url":"https://api.github.com/users/Shinmera/orgs","repos_url":"https://api.github.com/users/Shinmera/repos","events_url":"https://api.github.com/users/Shinmera/events{/privacy}","received_events_url":"https://api.github.com/users/Shinmera/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":12,"state":"open","created_at":"2015-09-23T16:33:30Z","updated_at":"2015-11-10T20:34:37Z","due_on":"2015-10-10T22:00:00Z","closed_at":null},"comments":6,"created_at":"2015-11-07T09:08:52Z","updated_at":"2015-11-10T20:34:37Z","closed_at":"2015-11-10T20:34:37Z","body":"Source files to create the test:\r\nMakefile:\r\n```\r\nexport CLANG ?= clang++\r\nexport CLASP_CLBIND_LIB ?= $(CLASP_HOME)/build/clasp/Contents/execs/boehm/release/lib/libclasp-clbind.so\r\nexport CLASP_INCLUDE ?= $(CLASP_HOME)/include\r\nexport OPTIONS += -std=c++11\r\nexport OPTIONS += -v\r\n#export OPTIONS += --shared\r\nexport OPTIONS += -fPIC\r\nexport OPTIONS += -D_TARGET_OS_LINUX\r\nexport OPTIONS += -DX86\r\nexport OPTIONS += -DNDEBUG\r\nexport OPTIONS += -DUSE_BOEHM\r\nexport OPTIONS += -DUSE_ALLOCA_FOR_FRAME\r\nexport OPTIONS += -D_ADDRESS_MODEL_64\r\nexport OPTIONS += -Wno-deprecated-register\r\nexport OPTIONS += -I $(CLASP_INCLUDE)\r\nexport OPTIONS += -lboost_system\r\nexport OPTIONS += -Wl,--start-group\r\nexport OPTIONS += $(CLASP_CLBIND_LIB)\r\nexport OPTIONS += -Wl,--end-group\r\n\r\nmembertest: membertest.cc\r\n#\t$(CLANG) $(OPTIONS) -o membertest.bundle membertest.cc\r\n\t$(CLANG) $(OPTIONS) -c membertest.cc\r\n\t$(CLANG) -fPIC -DNDEBUG -shared -Wl,-soname,membertest.bundle -o membertest.bundle membertest.o\r\n```\r\nmembertest.cc\r\n```\r\n#include <string>\r\n#include \"clasp/clasp.h\"\r\n#define EXPORT __attribute__((visibility(\"default\")))\r\n\r\nclass Message{\r\npublic:\r\n  Message(std::string message);\r\n  \r\n  std::string message;\r\n};\r\n\r\nMessage::Message(std::string message){\r\n  this->message = message;\r\n}\r\n\r\nextern \"C\" {\r\nEXPORT\r\nvoid CLASP_MAIN(){\r\n  using namespace clbind;\r\n  package(\"membertest\") [\r\n                         class_<Message>(\"message\", no_default_constructor)\r\n                         .def_constructor(\"make-message\",constructor<std::string>())\r\n                         .def_readonly(\"message\", &Message::message)\r\n                         ];\r\n}\r\n}\r\n```\r\nReproducing:\r\n```\r\ncd clasp-home\r\nmkdir examples/membertest\r\ncd examples/membertest\r\nemacs Makefile membertest.cc\r\nCLASP_HOME=../.. make membertest\r\n../../build/clasp/bin/clasp_boehm_o\r\n(load \"membertest.bundle\")\r\n(|membertest|:MAKE-MESSAGE \"test\")\r\n(|membertest|:MESSAGE *)\r\n```\r\n\r\nOn f20dd7b964a58a70d2b8468b5c426b0a50aea9f8 things work out just as expected. The class is instantiated and returns nicely and I can access the member just fine. All wonderful. However, on later revisions like 7fde5b78e98bf1af8e74f3884815a81db9eeec7e things don't work out so nice. Trying to load the bundle results in\r\n```\r\nCannot cast tagged_pointer in constructor\r\n../../src/core/foundation.cc:235 dbg_hook(...) was called\r\n\r\n\r\nCannot cast tagged_pointer in constructor\r\n../../src/core/foundation.cc:235 dbg_hook(...) was called\r\n```\r\nCommenting out both definitions, recompiling, and then loading it works, so the failure point must be somewhere in the definition mechanism. I haven't bisected the problem quite yet, but will do so once I have the time to and if necessary."}}