Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV in --write-model-readable #717

Closed
vmarkovtsev opened this issue Jan 13, 2017 · 2 comments
Closed

SIGSEGV in --write-model-readable #717

vmarkovtsev opened this issue Jan 13, 2017 · 2 comments

Comments

@vmarkovtsev
Copy link
Contributor

vmarkovtsev commented Jan 13, 2017

Model:

https://drive.google.com/open?id=0B-w8jGUJto0ieDZvekZlWFVBejg

Command:

bigartm --load-model artm.model -p 0 --write-model-readable artm_model.txt

Log:

Loading model from artm.model... OK.
Number of tokens in the model: 3578970
Saving model in readable format to artm_model.txt... Segmentation fault (core dumped)

Environment: Ubuntu 16.04 x86_64

The same SIGSEGV happens with v0.8.1 as well as master. It happens if I try to write the readable model in the end of training, too.

@ofrei
Copy link
Contributor

ofrei commented Jan 13, 2017

@vmarkovtsev Thanks for reporting this! I'll investigate ASAP.

@vmarkovtsev
Copy link
Contributor Author

vmarkovtsev commented Jan 16, 2017

Backtrace

thread #1: tid = 7563, 0x000000000061898f bigartm`HandleExternalTopicModelRequest(topic_model=0x00007fffffffb040, lm="\x10\x80???) + 250 at master_component.cc:47, name = 'bigartm', stop reason = signal SIGSEGV: invalid address (fault address: 0x7ff9d3d48010)
  * frame #0: 0x000000000061898f bigartm`HandleExternalTopicModelRequest(topic_model=0x00007fffffffb040, lm="\x10\x80???) + 250 at master_component.cc:47
    frame #1: 0x000000000061cc59 bigartm`artm::core::MasterComponent::Request(this=0x0000000000d918c0, args=0x00007fffffffafc0, result=0x00007fffffffb040, external="\x10\x80???) + 109 at master_component.cc:544
    frame #2: 0x000000000066a620 bigartm`long ArtmRequestExternal<artm::GetTopicModelArgs, artm::TopicModel>(master_id=1, length=5, args_blob="\n\x03pwt") + 413 at c_interface.cc:540
    frame #3: 0x000000000069009e bigartm`::ArtmRequestTopicModelExternal(master_id=1, length=5, args="\n\x03pwt") + 40 at c_interface.cc:598
    frame #4: 0x0000000000740d9a bigartm`ArtmExecute(master_id=1, args=0x00007fffffffb680, func=(bigartm`::ArtmRequestTopicModelExternal(int, int64_t, const char *) at c_interface.cc:596)) + 95 at cpp_interface.cc:81
    frame #5: 0x00000000007401dd bigartm`ArtmRequest(master_id=1, args=0x00007fffffffb680, func=(bigartm`::ArtmRequestTopicModelExternal(int, int64_t, const char *) at c_interface.cc:596)) + 44 at cpp_interface.cc:103
    frame #6: 0x000000000073f44c bigartm`artm::MasterModel::GetTopicModel(this=0x0000000000d925a0, args=0x00007fffffffb680, matrix=0x00007fffffffb5c0) + 54 at cpp_interface.cc:183
    frame #7: 0x000000000077ef9d bigartm`::execute(options=0x00007fffffffd690, argc=7, argv=0x00007fffffffe638) + 11701 at srcmain.cc:1406
    frame #8: 0x00000000007830a8 bigartm`main(argc=7, argv=0x00007fffffffe638) + 11004 at srcmain.cc:1718
    frame #9: 0x0000000000879a66 bigartm`generic_start_main + 582
    frame #10: 0x0000000000879c5a bigartm`__libc_start_main + 298
* thread #1: tid = 7563, 0x000000000061898f bigartm`HandleExternalTopicModelRequest(topic_model=0x00007fffffffb040, lm="\x10\x80???) + 250 at master_component.cc:47, name = 'bigartm', stop reason = signal SIGSEGV: invalid address (fault address: 0x7ff9d3d48010)
    frame #0: 0x000000000061898f bigartm`HandleExternalTopicModelRequest(topic_model=0x00007fffffffb040, lm="\x10\x80???) + 250 at master_component.cc:47
   44  	  for (int token_index = 0; token_index < topic_model->token_size(); ++token_index) {
   45  	    for (int topic_index = 0; topic_index < topic_model->num_topics(); ++topic_index) {
   46  	      int index = token_index * topic_model->num_topics() + topic_index;
-> 47  	      lm_float[index] = topic_model->token_weights(token_index).value(topic_index);
   48  	    }
   49  	  }
   50  	

Integer overflow:

index = -2147483648
token_index = 2147483
topic_index = 648
topic_model->num_topics() = 1000
2147483 * 1000 + 648 = 2147483648 = 2^31

vmarkovtsev added a commit to vmarkovtsev/bigartm that referenced this issue Jan 16, 2017
vmarkovtsev added a commit to vmarkovtsev/bigartm that referenced this issue Jan 16, 2017
ofrei pushed a commit that referenced this issue Jan 16, 2017
JeanPaulShapo pushed a commit that referenced this issue Feb 13, 2017
JeanPaulShapo pushed a commit to JeanPaulShapo/bigartm that referenced this issue Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants