Hi, I just installed via script/plugin from the stable svn tag. (Revision 54) I''m running Rails 1.1.2 and have Ferret 0.9.3 (with C extensions. no compilation problems) I put together a simple model to test it and I''m getting a segfault. The model: class Report < ActiveRecord::Base acts_as_ferret :fields => [:title, :name] end $ script/console Loading development environment.>> a = Report.new :title => "test", :name => "me"=> #<Report:0xb780db98 @attributes={"name"=>"me", "title"=>"test", "auto_update"=>true, "path"=>nil}, @new_record=true>>> a.save./script/../config/../config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:466: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24) [i386-linux] vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:466 reads: self.class.ferret_index << self.to_doc if @ferret_reindex by inserting logger.debug statements I have been able to determine that self.to_doc isn''t the problem so I think it must be segfaulting during the <<. Does someone know if I have set up something improperly, or is this truly a bug? Thanks, John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20060523/a4413dc3/attachment.htm
Hi, John, my guess is that you have problems with the strings you try to index not being compliant with the locale of your system. This might be especially the case if you retrieve the strings you want to index through ajax. Please have a look at: 1. http://www.ruby-forum.com/topic/64430 2. http://projects.jkraemer.net/acts_as_ferret/wiki/TypoWithFerret (at the bottom) 3. http://ferret.davebalmain.com/trac/ticket/55 maybe you could print the strings to the logfile. if they sound a little strange like query=%C3%A5&commit=search you definitly should try different locale settings. Regards Jan On 5/23/06, John Andrews <john.m.andrews at gmail.com> wrote:> > Hi, > I just installed via script/plugin from the stable svn tag. (Revision 54) > I''m running Rails 1.1.2 and have Ferret 0.9.3 (with C extensions. no > compilation problems) > > I put together a simple model to test it and I''m getting a segfault. > The model: > class Report < ActiveRecord::Base > acts_as_ferret :fields => [:title, :name] > end > > $ script/console > Loading development environment. > >> a = Report.new :title => "test", :name => "me" > => #<Report:0xb780db98 @attributes={"name"=>"me", "title"=>"test", > "auto_update"=>true, "path"=>nil}, @new_record=true> > >> a.save > ./script/../config/../config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:466: > [BUG] Segmentation fault > ruby 1.8.4 (2005-12-24) [i386-linux] > > vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:466 reads: > self.class.ferret_index << self.to_doc if @ferret_reindex > by inserting logger.debug statements I have been able to determine that > self.to_doc isn''t the problem so I think it must be segfaulting during the > <<. > > Does someone know if I have set up something improperly, or is this truly > a bug? > Thanks, > John > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20060523/0d116355/attachment.htm
sorry, I just realised that you already included the request in your mail. with ''me'' and ''test'' there should be no locale problems. If these are the strings you are actually using my previous mail won''t be of much help... Have you tried to index something by using ferret without acts_as_ferret? I would encourage you to do so by following the short tutorial at http://ferret.davebalmain.com/api/files/TUTORIAL.html . By doing this you''ve eliminated a ''single point of failure'' and you''ll find out if it is a problem of your installation of ferret. Regards Jan On 5/23/06, Jan Prill <jan.prill at gmail.com> wrote:> > Hi, John, > > my guess is that you have problems with the strings you try to index not > being compliant with the locale of your system. This might be especially the > case if you retrieve the strings you want to index through ajax. > > Please have a look at: > > 1. http://www.ruby-forum.com/topic/64430 > 2. http://projects.jkraemer.net/acts_as_ferret/wiki/TypoWithFerret (at the > bottom) > 3. http://ferret.davebalmain.com/trac/ticket/55 > > maybe you could print the strings to the logfile. if they sound a little > strange like query=%C3%A5&commit=search you definitly should try different > locale settings. > > Regards > Jan > > > > On 5/23/06, John Andrews <john.m.andrews at gmail.com> wrote: > > > Hi, > I just installed via script/plugin from the stable svn tag. (Revision 54) > I''m running Rails 1.1.2 and have Ferret 0.9.3 (with C extensions. no > compilation problems) > > I put together a simple model to test it and I''m getting a segfault. > The model: > class Report < ActiveRecord::Base > acts_as_ferret :fields => [:title, :name] > end > > $ script/console > Loading development environment. > >> a = Report.new :title => "test", :name => "me" > => #<Report:0xb780db98 @attributes={"name"=>"me", "title"=>"test", > "auto_update"=>true, "path"=>nil}, @new_record=true> > >> a.save > ./script/../config/../config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:466: > [BUG] Segmentation fault > ruby 1.8.4 (2005-12-24) [i386-linux] > > vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:466 reads: > self.class.ferret_index << self.to_doc if @ferret_reindex > by inserting logger.debug statements I have been able to determine that > self.to_doc isn''t the problem so I think it must be segfaulting during the > <<. > > Does someone know if I have set up something improperly, or is this truly > a bug? > Thanks, > John > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20060523/9c366e2a/attachment-0001.htm
On 5/23/06, Jan Prill <jan.prill at gmail.com> wrote:> > sorry, I just realised that you already included the request in your mail. with ''me'' and ''test'' there should be no locale problems. If these are the strings you are actually using my previous mail won''t be of much help...That''s right. I have also tried longer strings with no strange characters such as "accounts payable" and had the same result.> Have you tried to index something by using ferret without acts_as_ferret? I would encourage you to do so by following the short tutorial at http://ferret.davebalmain.com/api/files/TUTORIAL.html . By doing this you''ve eliminated a ''single point of failure'' and you''ll find out if it is a problem of your installation of ferret.I thought I had, but it must have been on my OSX machine. On the machine in question (Fedora 5) I performed the steps from the tutorial. Similar result; this time during search instead of insert: irb(main):002:0> require ''rubygems'' => true irb(main):003:0> require ''ferret'' => true irb(main):004:0> include Ferret => Object irb(main):005:0> index = Index::Index.new => #<Ferret::Index::Index:0xb7cd6524> irb(main):006:0> index << "this is a new document to be indexed" => #<Ferret::Index::Index:0xb7cd6524> irb(main):007:0> index << ["and here", "is another", "new document", "to index"]=> #<Ferret::Index::Index:0xb7cd6524> irb(main):008:0> index << {:title => "Programming Ruby", :content => "blah blah blah"} => #<Ferret::Index::Index:0xb7cd6524> irb(main):009:0> index << {:title => "Programming Java", :content => "yada yada yada"} => #<Ferret::Index::Index:0xb7cd6524> irb(main):010:0> index.search "document" (irb):10: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24) [i386-linux] So my problem lies within ferret. Any ideas what I should try from here? Thanks for your help -John
I experience the same problem, although it occurs on line 227, since the indexes are being created for the first time. Strangely enough, it works perfectly fine on my OSX Laptop, but it dies on our Fedora Core Linux server. The following is the error I get. /var/www/project/config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:227: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24) [i386-linux] Aborted John Andrews wrote:> On 5/23/06, Jan Prill <jan.prill at gmail.com> wrote: >> >> sorry, I just realised that you already included the request in your mail. with ''me'' and ''test'' there should be no locale problems. If these are the strings you are actually using my previous mail won''t be of much help... > > That''s right. I have also tried longer strings with no strange > characters such as "accounts payable" and had the same result. > >> Have you tried to index something by using ferret without acts_as_ferret? I would encourage you to do so by following the short tutorial at http://ferret.davebalmain.com/api/files/TUTORIAL.html . By doing this you''ve eliminated a ''single point of failure'' and you''ll find out if it is a problem of your installation of ferret. > > I thought I had, but it must have been on my OSX machine. On the > machine in question (Fedora 5) I performed the steps from the > tutorial. Similar result; this time during search instead of insert: > irb(main):002:0> require ''rubygems'' > => true > irb(main):003:0> require ''ferret'' > => true > irb(main):004:0> include Ferret > => Object > irb(main):005:0> index = Index::Index.new > => #<Ferret::Index::Index:0xb7cd6524> > irb(main):006:0> index << "this is a new document to be indexed" > => #<Ferret::Index::Index:0xb7cd6524> > irb(main):007:0> index << ["and here", "is another", "new document", > "to index"]=> #<Ferret::Index::Index:0xb7cd6524> > irb(main):008:0> index << {:title => "Programming Ruby", :content => > "blah blah blah"} > => #<Ferret::Index::Index:0xb7cd6524> > irb(main):009:0> index << {:title => "Programming Java", :content => > "yada yada yada"} > => #<Ferret::Index::Index:0xb7cd6524> > irb(main):010:0> index.search "document" > (irb):10: [BUG] Segmentation fault > ruby 1.8.4 (2005-12-24) [i386-linux] > > So my problem lies within ferret. Any ideas what I should try from here? > Thanks for your help > -John-- Posted via http://www.ruby-forum.com/.
And the interlinking element seems to be fedora... For both of you there are no problems on osx/freebsd. Installations on ubuntu don''t report these problems and my install on gentoo is fine too. So we need to find out what''s the problem with fedora.. Are people that are on redhat experiencing the same problems? Regards Jan On 5/24/06, Jordan <jordan.w.frank at gmail.com> wrote:> > I experience the same problem, although it occurs on line 227, since the > indexes are being created for the first time. Strangely enough, it works > perfectly fine on my OSX Laptop, but it dies on our Fedora Core Linux > server. The following is the error I get. > > > /var/www/project/config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:227: > [BUG] Segmentation fault > ruby 1.8.4 (2005-12-24) [i386-linux] > > Aborted > > > John Andrews wrote: > > On 5/23/06, Jan Prill <jan.prill at gmail.com> wrote: > >> > >> sorry, I just realised that you already included the request in your > mail. with ''me'' and ''test'' there should be no locale problems. If these are > the strings you are actually using my previous mail won''t be of much help... > > > > That''s right. I have also tried longer strings with no strange > > characters such as "accounts payable" and had the same result. > > > >> Have you tried to index something by using ferret without > acts_as_ferret? I would encourage you to do so by following the short > tutorial at http://ferret.davebalmain.com/api/files/TUTORIAL.html . By > doing this you''ve eliminated a ''single point of failure'' and you''ll find out > if it is a problem of your installation of ferret. > > > > I thought I had, but it must have been on my OSX machine. On the > > machine in question (Fedora 5) I performed the steps from the > > tutorial. Similar result; this time during search instead of insert: > > irb(main):002:0> require ''rubygems'' > > => true > > irb(main):003:0> require ''ferret'' > > => true > > irb(main):004:0> include Ferret > > => Object > > irb(main):005:0> index = Index::Index.new > > => #<Ferret::Index::Index:0xb7cd6524> > > irb(main):006:0> index << "this is a new document to be indexed" > > => #<Ferret::Index::Index:0xb7cd6524> > > irb(main):007:0> index << ["and here", "is another", "new document", > > "to index"]=> #<Ferret::Index::Index:0xb7cd6524> > > irb(main):008:0> index << {:title => "Programming Ruby", :content => > > "blah blah blah"} > > => #<Ferret::Index::Index:0xb7cd6524> > > irb(main):009:0> index << {:title => "Programming Java", :content => > > "yada yada yada"} > > => #<Ferret::Index::Index:0xb7cd6524> > > irb(main):010:0> index.search "document" > > (irb):10: [BUG] Segmentation fault > > ruby 1.8.4 (2005-12-24) [i386-linux] > > > > So my problem lies within ferret. Any ideas what I should try from here? > > Thanks for your help > > -John > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20060524/18428843/attachment.htm
Jan Prill wrote:> And the interlinking element seems to be fedora... For both of you there > are > no problems on osx/freebsd. Installations on ubuntu don''t report these > problems and my install on gentoo is fine too. So we need to find out > what''s > the problem with fedora.. Are people that are on redhat experiencing the > same problems? > > Regards > JanI just tried rebuilding ferret with -Os instead of -O0 as was in the makefile that was generated (i''m sorta new to this whole ruby thing so I don''t know how that gets created). And now it works fine. So after running ruby setup.rb config I went into ext/ modified Makefile, changed -O0 to -Os in the CFLAGS, and ran make, then went back up a directory and ran rake setup.rb and that installed it, and now everything is working just fine. Jordan -- Posted via http://www.ruby-forum.com/.
@Jordan: great, thanks for pointing this out! @John: does this the trick for you too? Jan On 5/24/06, Jordan <jordan.w.frank at gmail.com> wrote:> > Jan Prill wrote: > > And the interlinking element seems to be fedora... For both of you there > > are > > no problems on osx/freebsd. Installations on ubuntu don''t report these > > problems and my install on gentoo is fine too. So we need to find out > > what''s > > the problem with fedora.. Are people that are on redhat experiencing the > > same problems? > > > > Regards > > Jan > > I just tried rebuilding ferret with -Os instead of -O0 as was in the > makefile that was generated (i''m sorta new to this whole ruby thing so I > don''t know how that gets created). And now it works fine. > > So after running > ruby setup.rb config > I went into ext/ modified Makefile, changed -O0 to -Os in the CFLAGS, > and ran make, then went back up a directory and ran > rake setup.rb > and that installed it, and now everything is working just fine. > > Jordan > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20060524/b54e8b84/attachment.htm
I followed Jordan''s steps and the tests all pass now. Thanks Jordan! Thanks Jan! On 5/24/06, Jan Prill <jan.prill at gmail.com> wrote:> @Jordan: great, thanks for pointing this out! > > @John: does this the trick for you too? > > Jan > > > On 5/24/06, Jordan < jordan.w.frank at gmail.com> wrote: > > Jan Prill wrote: > > > And the interlinking element seems to be fedora... For both of you there > > > are > > > no problems on osx/freebsd. Installations on ubuntu don''t report these > > > problems and my install on gentoo is fine too. So we need to find out > > > what''s > > > the problem with fedora.. Are people that are on redhat experiencing the > > > same problems? > > > > > > Regards > > > Jan > > > > I just tried rebuilding ferret with -Os instead of -O0 as was in the > > makefile that was generated (i''m sorta new to this whole ruby thing so I > > don''t know how that gets created). And now it works fine. > > > > So after running > > ruby setup.rb config > > I went into ext/ modified Makefile, changed -O0 to -Os in the CFLAGS, > > and ran make, then went back up a directory and ran > > rake setup.rb > > and that installed it, and now everything is working just fine. > > > > Jordan > > > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Ferret-talk mailing list > > Ferret-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ferret-talk > > > > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > >
John Andrews wrote:> I followed Jordan''s steps and the tests all pass now. Thanks Jordan! > Thanks Jan!i get this error as well, with the trunk of acts_as_ferret, and whatever ferret was installed via gems (0.9.3 i think). watching that install, it built the C extensions, and the makefile had the systemwide defaults -O2 -pipe. checked out the trunk of ferret, and it refuses to build the C extensions due to missing header errors (headers from its own files no less) but at least thats solves the problem, since the segfault is clearly coming from the C code somewhere. obviously that doenst help narrow it down much. thanks for the tips anyways .. -- Posted via http://www.ruby-forum.com/.
the C extension is littered with these warnings: warning: cast to pointer from integer of different size which can be harmless, or not, but ive definitely seen these warnings gradually disappear from other stuff after running gentoo-amd64 for a while.. gdb just does this: Program received signal SIGSEGV, Segmentation fault. Cannot remove breakpoints because program is no longer writable. It might be running in another process. Further execution is probably impossible. 0x00002b670aad0337 in ?? () )too lazy to compile ruby with -g to see if its more informative..( cheers -- Posted via http://www.ruby-forum.com/.
On 6/3/06, carmen <carmen at whats-your.name> wrote:> John Andrews wrote: > > I followed Jordan''s steps and the tests all pass now. Thanks Jordan! > > Thanks Jan! > > i get this error as well, with the trunk of acts_as_ferret, and whatever > ferret was installed via gems (0.9.3 i think). watching that install, it > built the C extensions, and the makefile had the systemwide defaults -O2 > -pipe. checked out the trunk of ferret, and it refuses to build the C > extensions due to missing header errors (headers from its own files no > less) but at least thats solves the problem, since the segfault is > clearly coming from the C code somewhere.You need to run `rake ext` to copy the missing headers to the right place. This won''t help you with your segfault though.
On 6/3/06, carmen <carmen at whats-your.name> wrote:> the C extension is littered with these warnings: > > warning: cast to pointer from integer of different sizeThese will be fixed in a future version. Hopefully the next version.
David Balmain wrote:> On 6/3/06, carmen <carmen at whats-your.name> wrote: >> the C extension is littered with these warnings: >> >> warning: cast to pointer from integer of different size > > These will be fixed in a future version. Hopefully the next version.I also had the same problem. Fixed with -0s aj -- Posted via http://www.ruby-forum.com/.