{"action":"created","issue":{"url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/818","labels_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/818/labels{/name}","comments_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/818/comments","events_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/818/events","html_url":"https://github.com/JohnLangford/vowpal_wabbit/issues/818","id":110682666,"number":818,"title":"LBFGS with the \"--output_feature_regularizer_*\" option causes a segmentation fault","user":{"login":"tzukuoh","id":4700508,"avatar_url":"https://avatars.githubusercontent.com/u/4700508?v=3","gravatar_id":"","url":"https://api.github.com/users/tzukuoh","html_url":"https://github.com/tzukuoh","followers_url":"https://api.github.com/users/tzukuoh/followers","following_url":"https://api.github.com/users/tzukuoh/following{/other_user}","gists_url":"https://api.github.com/users/tzukuoh/gists{/gist_id}","starred_url":"https://api.github.com/users/tzukuoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzukuoh/subscriptions","organizations_url":"https://api.github.com/users/tzukuoh/orgs","repos_url":"https://api.github.com/users/tzukuoh/repos","events_url":"https://api.github.com/users/tzukuoh/events{/privacy}","received_events_url":"https://api.github.com/users/tzukuoh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-09T15:34:48Z","updated_at":"2015-10-12T21:27:44Z","closed_at":null,"body":"Running Test 16 with \"--output_feature_regularizer_text\" (as well as \"--output_feature_regularizer_binary\") causes a segmentation fault:\r\n\r\ntkhuang@msrnyc-03:~/software/vowpal_wabbit/test$ ../vowpalwabbit/vw -k -c -d train-sets/rcv1_small.dat --loss_function=logistic -b 20 --bfgs --mem 7 --passes 20 --termination 0.001 --l2 1.0 --holdout_off --output_feature_regularizer_text r.txt\r\nusing l2 regularization = 1\r\nenabling BFGS based optimization \\*\\*without\\*\\* curvature calculation\r\nNum weight bits = 20\r\nlearning rate = 0.5\r\ninitial_t = 0\r\npower_t = 0.5\r\ndecay_learning_rate = 1\r\nm = 7\r\nAllocated 72M for weights and mem\r\n\\#\\# avg. loss    der. mag.       d. m. cond.      wolfe1         wolfe2          mix fraction    curvature       dir. magnitude  step size \r\ncreating cache_file = train-sets/rcv1_small.dat.cache\r\nReading datafile = train-sets/rcv1_small.dat\r\nnum sources = 1\r\n 1 0.69315      0.00266         0.87764                                                         2.24708         776.93237       0.39057   \r\n 3 0.51357      0.00493         0.23981          0.523903       0.088793                                        40.87817        1.00000   \r\n 4 0.48774      0.00232         0.08215          0.274548       -0.410690                                       2.64529         1.00000   \r\n 5 0.47879      0.00006         0.00617          0.595892       0.183063                                        0.47184         1.00000   \r\n 6 0.47750      0.00000         0.00221          0.703360       0.403715                                        0.68626         1.00000   \r\n 7 0.47680      0.00000         0.00038          0.588395       0.175459                                        0.08911         1.00000   \r\n 8 0.47671      0.00000         0.00002          0.568445       0.136827  \r\nTermination condition reached in pass 8: decrease in loss less than 0.100%.\r\nIf you want to optimize further, decrease termination threshold.\r\n                                0.00444         1.00000   \r\nSegmentation fault\r\n"},"comment":{"url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/comments/147527118","html_url":"https://github.com/JohnLangford/vowpal_wabbit/issues/818#issuecomment-147527118","issue_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/818","id":147527118,"user":{"login":"tzukuoh","id":4700508,"avatar_url":"https://avatars.githubusercontent.com/u/4700508?v=3","gravatar_id":"","url":"https://api.github.com/users/tzukuoh","html_url":"https://github.com/tzukuoh","followers_url":"https://api.github.com/users/tzukuoh/followers","following_url":"https://api.github.com/users/tzukuoh/following{/other_user}","gists_url":"https://api.github.com/users/tzukuoh/gists{/gist_id}","starred_url":"https://api.github.com/users/tzukuoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzukuoh/subscriptions","organizations_url":"https://api.github.com/users/tzukuoh/orgs","repos_url":"https://api.github.com/users/tzukuoh/repos","events_url":"https://api.github.com/users/tzukuoh/events{/privacy}","received_events_url":"https://api.github.com/users/tzukuoh/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T21:27:44Z","updated_at":"2015-10-12T21:27:44Z","body":"I created an 'end_examples' function, which contains the only call to preconditioner_to_regularizer(). (see https://github.com/tzukuoh/vowpal_wabbit/blob/master/vowpalwabbit/bfgs.cc). But still got a seg fault. According to gdb (see log below), the seg fault occurs in save_load_regularizer. Looks like end_examples() has not been called at that point? \r\n\r\n(gdb) run -k -c -d train-sets/rcv1_small.dat --loss_function=logistic -b 20 --bfgs --mem 7 --passes 20 --termination 0.001 --l2 1.0 --holdout_off --output_feature_regularizer_text r.txt\r\nStarting program: /home/NORTHAMERICA/tkhuang/software/vowpal_wabbit/vowpalwabbit/vw -k -c -d train-sets/rcv1_small.dat --loss_function=logistic -b 20 --bfgs --mem 7 --passes 20 --termination 0.001 --l2 1.0 --holdout_off --output_feature_regularizer_text r.txt\r\n[Thread debugging using libthread_db enabled]\r\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\r\nusing l2 regularization = 1\r\nenabling BFGS based optimization **without** curvature calculation\r\nNum weight bits = 20\r\nlearning rate = 0.5\r\ninitial_t = 0\r\npower_t = 0.5\r\ndecay_learning_rate = 1\r\nm = 7\r\nAllocated 72M for weights and mem\r\n## avg. loss    der. mag.       d. m. cond.      wolfe1         wolfe2          mix fraction    curvature       dir. magnitude  step size\r\ncreating cache_file = train-sets/rcv1_small.dat.cache\r\nReading datafile = train-sets/rcv1_small.dat\r\nnum sources = 1 \r\n[New Thread 0x7ffff2026700 (LWP 18533)]          \r\n 1 0.69315      0.00266         0.87764                                                         2.24708         776.93237       0.39057\r\n 3 0.51357      0.00493         0.23981          0.523903       0.088793                                        40.87817        1.00000\r\n 4 0.48774      0.00232         0.08215          0.274548       -0.410690                                       2.64529         1.00000\r\n 5 0.47879      0.00006         0.00617          0.595892       0.183063                                        0.47184         1.00000\r\n 6 0.47750      0.00000         0.00221          0.703360       0.403715                                        0.68626         1.00000\r\n 7 0.47680      0.00000         0.00038          0.588395       0.175459                                        0.08911         1.00000\r\n 8 0.47671      0.00000         0.00002          0.568445       0.136827\r\nTermination condition reached in pass 8: decrease in loss less than 0.100%.\r\nIf you want to optimize further, decrease termination threshold.\r\n                                0.00444         1.00000\r\n\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x00000000004b801e in save_load_regularizer (all=..., b=..., model_file=..., read=false, text=true) at bfgs.cc:880\r\n880               if (*v != 0.)\r\n(gdb) bt\r\n#0  0x00000000004b801e in save_load_regularizer (all=..., b=..., model_file=..., read=false, text=true) at bfgs.cc:880\r\n#1  0x00000000004b865e in save_load (b=..., model_file=..., read=false, text=true) at bfgs.cc:955\r\n#2  0x0000000000427f3a in LEARNER::learner<char>::save_load (this=0x820570, io=..., read=false, text=true) at learner.h:136\r\n#3  0x0000000000425494 in dump_regressor (all=..., reg_name=..., as_text=true) at parse_regressor.cc:340\r\n#4  0x00000000004257bd in finalize_regressor (all=..., reg_name=...) at parse_regressor.cc:365\r\n#5  0x00000000004b7cdc in end_pass (b=...) at bfgs.cc:802\r\n#6  0x0000000000493c42 in LEARNER::learner<char>::end_pass (this=0x820570) at learner.h:159\r\n#7  0x0000000000493874 in LEARNER::generic_driver (all=...) at learner.cc:29\r\n#8  0x0000000000421616 in main (argc=20, argv=0x7fffffffe518) at main.cc:70\r\n"}}