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

Small fix: uninitialized skip argument resulted in segfaults #31

Merged
merged 1 commit into from
Jun 18, 2012

Conversation

Smerity
Copy link
Contributor

@Smerity Smerity commented Jun 18, 2012

The skip argument that modifies ngram was not initialized in global_data.cc and resulted in segfaults.
Trivial fix is to set a default of zero in global_data.

Starting program: /home/smerity/Coding/Reference/vowpal_wabbit/vowpalwabbit/vw wsj_caps_00 --loss_function logistic -c --passes 20 -f caps.model --l2 0.0001 --bfgs --conjugate_gradient --ngram 3
[Thread debugging using libthread_db enabled]
...
You have chosen to generate 3-grams
...
[New Thread 0x7ffff46b3700 (LWP 12214)]
[Switching to Thread 0x7ffff46b3700 (LWP 12214)]

Breakpoint 1, addgrams (all=..., ngram=1, skip_gram=140737353958624, atomics=..., audits=..., initial_length=21, gram_mask=..., 
    skips=0) at parser.cc:515
515   if (ngram == 0 && gram_mask.last() < initial_length)
(gdb) 

JohnLangford added a commit that referenced this pull request Jun 18, 2012
Small fix: uninitialized skip argument resulted in segfaults
@JohnLangford JohnLangford merged commit 5e3f3be into VowpalWabbit:master Jun 18, 2012
@JohnLangford
Copy link
Member

Thanks, added.

-John

On 06/17/2012 10:46 PM, Stephen Merity wrote:

The skip argument that modifies ngram was not initialized in global_data.cc and resulted in segfaults.
Trivial fix is to set a default of zero in global_data.

Starting program: /home/smerity/Coding/Reference/vowpal_wabbit/vowpalwabbit/vw wsj_caps_00 --loss_function logistic -c --passes 20 -f caps.model --l2 0.0001 --bfgs --conjugate_gradient --ngram 3
[Thread debugging using libthread_db enabled]
...
You have chosen to generate 3-grams
...
[New Thread 0x7ffff46b3700 (LWP 12214)]
[Switching to Thread 0x7ffff46b3700 (LWP 12214)]

Breakpoint 1, addgrams (all=..., ngram=1, skip_gram=140737353958624, atomics=..., audits=..., initial_length=21, gram_mask=...,
     skips=0) at parser.cc:515
515     if (ngram == 0&&  gram_mask.last()<  initial_length)
(gdb)

You can merge this Pull Request by running:

git pull https://github.com/Smerity/vowpal_wabbit master

Or you can view, comment on it, or merge it online at:

#31

-- Commit Summary --

  • Small fix: uninitialized skip argument resulted in segfaults

-- File Changes --

M vowpalwabbit/global_data.cc (3)

-- Patch Links --

https://github.com/JohnLangford/vowpal_wabbit/pull/31.patch
https://github.com/JohnLangford/vowpal_wabbit/pull/31.diff


Reply to this email directly or view it on GitHub:
#31

JohnLangford pushed a commit that referenced this pull request Nov 15, 2014
JohnLangford pushed a commit that referenced this pull request Nov 15, 2014
lokitoth pushed a commit to lokitoth/vowpal_wabbit that referenced this pull request Dec 20, 2019
* fix memory leak in Rank

* merge fix into existing loop

* clean up examples first before pushing back to pool
jackgerrits referenced this pull request in jackgerrits/vowpal_wabbit Aug 4, 2020
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

Successfully merging this pull request may close these issues.

2 participants