{"action":"created","issue":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/22565","repository_url":"https://api.github.com/repos/pytorch/pytorch","labels_url":"https://api.github.com/repos/pytorch/pytorch/issues/22565/labels{/name}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/22565/comments","events_url":"https://api.github.com/repos/pytorch/pytorch/issues/22565/events","html_url":"https://github.com/pytorch/pytorch/issues/22565","id":464851317,"node_id":"MDU6SXNzdWU0NjQ4NTEzMTc=","number":22565,"title":"*** stack smashing detected *** after adding libtorch in CMake","user":{"login":"trakaros","id":17813015,"node_id":"MDQ6VXNlcjE3ODEzMDE1","avatar_url":"https://avatars1.githubusercontent.com/u/17813015?v=4","gravatar_id":"","url":"https://api.github.com/users/trakaros","html_url":"https://github.com/trakaros","followers_url":"https://api.github.com/users/trakaros/followers","following_url":"https://api.github.com/users/trakaros/following{/other_user}","gists_url":"https://api.github.com/users/trakaros/gists{/gist_id}","starred_url":"https://api.github.com/users/trakaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trakaros/subscriptions","organizations_url":"https://api.github.com/users/trakaros/orgs","repos_url":"https://api.github.com/users/trakaros/repos","events_url":"https://api.github.com/users/trakaros/events{/privacy}","received_events_url":"https://api.github.com/users/trakaros/received_events","type":"User","site_admin":false},"labels":[{"id":443484135,"node_id":"MDU6TGFiZWw0NDM0ODQxMzU=","url":"https://api.github.com/repos/pytorch/pytorch/labels/high%20priority","name":"high priority","color":"F22613","default":false,"description":null},{"id":778855555,"node_id":"MDU6TGFiZWw3Nzg4NTU1NTU=","url":"https://api.github.com/repos/pytorch/pytorch/labels/module:%20build","name":"module: build","color":"f7e101","default":false,"description":"Build system issues"},{"id":553773019,"node_id":"MDU6TGFiZWw1NTM3NzMwMTk=","url":"https://api.github.com/repos/pytorch/pytorch/labels/needs%20reproduction","name":"needs reproduction","color":"cc9fe0","default":false,"description":"Someone else needs to try reproducing the issue given the instructions. No action needed from user"},{"id":679955625,"node_id":"MDU6TGFiZWw2Nzk5NTU2MjU=","url":"https://api.github.com/repos/pytorch/pytorch/labels/topic:%20crash","name":"topic: crash","color":"0e8a16","default":false,"description":"Problem manifests as a hard crash, as opposed to a RuntimeError"},{"id":1301347167,"node_id":"MDU6TGFiZWwxMzAxMzQ3MTY3","url":"https://api.github.com/repos/pytorch/pytorch/labels/triaged","name":"triaged","color":"006b75","default":false,"description":"This issue has been looked at a team member, and triaged and prioritized into an appropriate module"}],"state":"open","locked":false,"assignee":{"login":"nairbv","id":582713,"node_id":"MDQ6VXNlcjU4MjcxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/582713?v=4","gravatar_id":"","url":"https://api.github.com/users/nairbv","html_url":"https://github.com/nairbv","followers_url":"https://api.github.com/users/nairbv/followers","following_url":"https://api.github.com/users/nairbv/following{/other_user}","gists_url":"https://api.github.com/users/nairbv/gists{/gist_id}","starred_url":"https://api.github.com/users/nairbv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nairbv/subscriptions","organizations_url":"https://api.github.com/users/nairbv/orgs","repos_url":"https://api.github.com/users/nairbv/repos","events_url":"https://api.github.com/users/nairbv/events{/privacy}","received_events_url":"https://api.github.com/users/nairbv/received_events","type":"User","site_admin":false},"assignees":[{"login":"nairbv","id":582713,"node_id":"MDQ6VXNlcjU4MjcxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/582713?v=4","gravatar_id":"","url":"https://api.github.com/users/nairbv","html_url":"https://github.com/nairbv","followers_url":"https://api.github.com/users/nairbv/followers","following_url":"https://api.github.com/users/nairbv/following{/other_user}","gists_url":"https://api.github.com/users/nairbv/gists{/gist_id}","starred_url":"https://api.github.com/users/nairbv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nairbv/subscriptions","organizations_url":"https://api.github.com/users/nairbv/orgs","repos_url":"https://api.github.com/users/nairbv/repos","events_url":"https://api.github.com/users/nairbv/events{/privacy}","received_events_url":"https://api.github.com/users/nairbv/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2019-07-06T12:47:56Z","updated_at":"2019-12-03T16:22:31Z","closed_at":null,"author_association":"NONE","body":"## 🐛 *** stack smashing detected *** after loading \"model.pt\"\r\n\r\n## To Reproduce\r\n\r\nSteps to reproduce the behavior:\r\n\r\n* I can successfully load the model file(model.pt).\r\n* However,when the code reaches the command \"image_window win;\", a \"stack smashing detected\" error is thrown.\r\n* I have also checked the size of the model file.It is 350KB.Is it too big and it causes overflow in stack? \r\n* The strange things is that the same code without any libtorch involvement is working fine.The problem was created when I inserted the libtorch code.\r\n* My code is the following:\r\n\r\n```\r\nint main()\r\n{\r\n    try\r\n    {\r\n    \ttorch::jit::script::Module module = torch::jit::load(\"../model.pt\");\r\n        torch::NoGradGuard no_grad;\r\n        cv::VideoCapture cap(0);\r\n        if (!cap.isOpened())\r\n        {\r\n            cerr << \"Unable to connect to camera\" << endl;\r\n            return 1;\r\n        }\r\n        image_window win;\r\n        //Here is the error.After the \" image_window win;\" command, \r\n        //the *** stack smashing detected *** error is thrown.\r\n        ...(rest of code..)...        \r\n```\r\n* I compiled the code with the following CMakelists.txt:\r\n```\r\ncmake_minimum_required(VERSION 2.8.12)\r\nproject(examples)\r\nadd_executable(webcam_face_pose_ex Regressor.cpp webcam_face_pose_ex.cpp Graphics.cpp)\r\nset(CMAKE_PREFIX_PATH \"libtorch/share/cmake/Torch\")\r\nadd_subdirectory(../dlib-19.13/dlib/ dlib_build)\r\n\r\nfind_package(OpenCV QUIET)\r\nfind_package(HDF5 REQUIRED COMPONENTS C CXX)\r\nfind_package(SDL2 REQUIRED)\r\nfind_package(Torch REQUIRED)\r\n\r\ninclude_directories(${DLIB_INCLUDE_DIRECTORY})\r\ninclude_directories(${OpenCV_INCLUDE_DIRS})\r\ninclude_directories(${HDF5_INCLUDE_DIRS})\r\ninclude_directories(${SDL2_INCLUDE_DIRS})\r\n\r\ntarget_link_libraries(webcam_face_pose_ex ${DLIB_LIBRARIES} dlib dlib::dlib)\r\ntarget_link_libraries(webcam_face_pose_ex ${OpenCV_LIBS} dlib::dlib)\r\ntarget_link_libraries(webcam_face_pose_ex ${HDF5_CXX_LIBRARIES} ${HDF5_LIBRARIES} dlib::dlib )\r\ntarget_link_libraries(webcam_face_pose_ex ${SDL2_LIBRARIES} dlib::dlib)\r\ntarget_link_libraries(webcam_face_pose_ex ${TORCH_LIBRARIES} dlib::dlib)\r\n\r\nset_property(TARGET webcam_face_pose_ex PROPERTY CXX_STANDARD 11)\r\n\r\n\r\n```\r\n* I also tried to dynamically allocate the \"torch::jit::script::Module module \"\r\nobject in order to avoid overflow issues, using the command:\r\n```\r\ntorch::jit::script::Module module = new torch::jit::load(\"../model.pt\");\r\n```\r\n* However, it failed with error: \"error: expected type-specifier\"\r\n\r\n\r\n\r\n## Environment\r\n* PyTorch version: 1.1.0\r\n* Is debug build: No\r\n* CUDA used to build PyTorch: 9.0.176\r\n\r\n* OS: Ubuntu 16.04.6 LTS\r\n* GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609\r\n* CMake version: version 3.5.1\r\n\r\n* Python version: 3.6\r\n* Is CUDA available: No\r\n* CUDA runtime version: 7.5.17\r\n* GPU models and configuration: Could not collect\r\n* Nvidia driver version: Could not collect\r\n* cuDNN version: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7\r\n\r\n\r\n* [pip3] numpy==1.15.4\r\n* [pip3] numpydoc==0.8.0\r\n* [pip3] torch==1.1.0\r\n* [pip3] torchsummary==1.5.1\r\n* [pip3] torchvision==0.3.0\r\n* [conda] blas                      1.0                         mkl  \r\n* [conda] mkl                       2019.1                      144  \r\n* [conda] mkl-service               1.1.2            py36he904b0f_5  \r\n* [conda] mkl_fft                   1.0.10           py36ha843d7b_0  \r\n* [conda] mkl_random                1.0.2            py36hd81dba3_0  \r\n* [conda] torch                     1.1.0                     <pip>\r\n* [conda] torchsummary              1.5.1                     <pip>\r\n* [conda] torchvision               0.3.0                     <pip>\r\n"},"comment":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/comments/561243664","html_url":"https://github.com/pytorch/pytorch/issues/22565#issuecomment-561243664","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/22565","id":561243664,"node_id":"MDEyOklzc3VlQ29tbWVudDU2MTI0MzY2NA==","user":{"login":"nairbv","id":582713,"node_id":"MDQ6VXNlcjU4MjcxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/582713?v=4","gravatar_id":"","url":"https://api.github.com/users/nairbv","html_url":"https://github.com/nairbv","followers_url":"https://api.github.com/users/nairbv/followers","following_url":"https://api.github.com/users/nairbv/following{/other_user}","gists_url":"https://api.github.com/users/nairbv/gists{/gist_id}","starred_url":"https://api.github.com/users/nairbv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nairbv/subscriptions","organizations_url":"https://api.github.com/users/nairbv/orgs","repos_url":"https://api.github.com/users/nairbv/repos","events_url":"https://api.github.com/users/nairbv/events{/privacy}","received_events_url":"https://api.github.com/users/nairbv/received_events","type":"User","site_admin":false},"created_at":"2019-12-03T16:22:31Z","updated_at":"2019-12-03T16:22:31Z","author_association":"CONTRIBUTOR","body":"@trakaros Are you still suspecting the issue is with dlib? If we don't have something actionable to fix here then I'll close this ticket.\r\n"}}
{"actor":{"display_login":"nairbv"}}