Hello, On a linux system with: ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux] FXRuby-1.6.12 libfox 1.6.25-1 I tried to use the FXTable::extractText like this maxrow = MAX_ROW - 1 maxcol = MAX_COL - 1 printout = @table.extractText(0 , maxrow , 0 , maxcol , cs="\t", rs="\n") # Write the file File.open(saveDialog.filename, "w").write(printout) then I got this output: __________________________________ discretizer.rb:3408: [BUG] Segmentation fault ruby 1.8.6 (2007-06-07) [i486-linux] _________________________________ if I change maxrow = MAX_ROW - 100 maxcol = MAX_COL - 100 Then I get: ___________________________________________ *** glibc detected *** ruby: free(): invalid next size (normal): 0x087d3fa8 *** ======= Backtrace: ========/lib/tls/i686/cmov/libc.so.6[0xb7d6bd65] /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7d6f800] /usr/lib/libFOX-1.6.so.0(_ZN2FX6fxfreeEPPv+0x28)[0xb7203978] [0x87d3fa8] ======= Memory map: =======08048000-08049000 r-xp 00000000 08:08 1417717 /usr/bin/ruby1.8 08049000-0804a000 rw-p 00000000 08:08 1417717 /usr/bin/ruby1.8 0804a000-08849000 rw-p 0804a000 00:00 0 [heap] b08f9000-b0902000 r-xp 00000000 08:08 463092 /lib/tls/i686/cmov/libnss_files-2.6.1.so b0902000-b0904000 rw-p 00008000 08:08 463092 /lib/tls/i686/cmov/libnss_files-2.6.1.so b0904000-b090c000 r-xp 00000000 08:08 463096 /lib/tls/i686/cmov/libnss_nis-2.6.1.so b090c000-b090e000 rw-p 00007000 08:08 463096 /lib/tls/i686/cmov/libnss_nis-2.6.1.so b090e000-b0915000 r-xp 00000000 08:08 463088 /lib/tls/i686/cmov/libnss_compat-2.6.1.so b0915000-b0917000 rw-p 00006000 08:08 463088 /lib/tls/i686/cmov/libnss_compat-2.6.1.so b0923000-b0924000 rw-p b0923000 00:00 0 b0924000-b1324000 rwxp b0924000 00:00 0 b1324000-b160e000 rw-p b1324000 00:00 0 b160e000-b360e000 rw-s e8000000 00:0e 18056 /dev/dri/card0 b360e000-b400e000 rw-s e5000000 00:0e 18056 /dev/dri/card0 b400e000-b4a0e000 rw-s e4000000 00:0e 18056 /dev/dri/card0 b4a0e000-b540e000 rw-s 2c008000 00:0e 18056 /dev/dri/card0 b540e000-b5410000 rw-s f8c6f000 00:0e 18056 /dev/dri/card0 b5410000-b5e10000 rw-s e0040000 00:0e 18056 /dev/dri/card0 b5e10000-b603f000 r-xp 00000000 08:08 1414874 /usr/lib/dri/i915_dri.so b603f000-b604e000 rw-p 0022f000 08:08 1414874 /usr/lib/dri/i915_dri.so b604e000-b6059000 rw-p b604e000 00:00 0 b6059000-b60e4000 r--p 00000000 08:08 1644585 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf b60e4000-b6142000 rw-p b60e4000 00:00 0 b6142000-b6148000 r--s 00000000 08:08 2035659 /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-x86.cache-2 b6148000-b614b000 r--s 00000000 08:08 2035673 /var/cache/fontconfig/e383d7ea5fbe662a33d9b44caf393297-x86.cache-2 b614b000-b614f000 r--s 00000000 08:08 2035656 /var/cache/fontconfig/921a30a17f0be15c70ac14043cb7a739-x86.cache-2 b614f000-b6150000 r--s 00000000 08:08 2035666 /var/cache/fontconfig/c69f04ab05004e31a6d5e715764f16d8-x86.cache-2 b6150000-b6151000 r--s 00000000 08:08 2035646 /var/cache/fontconfig/4c73fe0c47614734b17d736dbde7580a-x86.cache-2 b6151000-b6154000 r--s 00000000 08:08 2035661 /var/cache/fontconfig/a755afe4a08bf5b97852ceb7400b47bc-x86.cache-2 b6154000-b6155000 r--s 00000000 08:08 2035652 /var/cache/fontconfig/75a2cd575a62c63e802c11411fb87c37-x86.cache-2 b6155000-b6158000 r--s 00000000 08:08 2035650 /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-x86.cache-2 b6158000-b615a000 r--s 00000000 08:08 2035670 /var/cache/fontconfig/de156ccd2eddbdc19d37a45b8b2aac9c-x86.cache-2 b615a000-b6162000 r--s 00000000 08:08 2035674 /var/cache/fontconfig/e3de0de479f42330eadf588a55fb5bf4-x86.cache-2 b6162000-b6168000 r--s 00000000 08:08 2035638 /var/cache/fontconfig/0f34bcd4b6ee430af32735b75db7f02b-x86.cache-2 b6168000-b6169000 r--s 00000000 08:08 2035644 /var/cache/fontconfig/4794a0821666d79190d59a36cb4f44b5-x86.cache-2 b6169000-b616b000 r--s 00000000 08:08 2035671 /var/cache/fontconfig/de9486f0b47a4d768a594cb4198cb1c6-x86.cache-2 b616b000-b6171000 r--s 00000000 08:08 2035668 /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-x86.cache-2 b6171000-b6175000 r--s 00000000 08:08 2035636 /var/cache/fontconfig/089dead882dea3570ffc31a9898cfb69-x86.cache-2 b6175000-b6177000 r--s 00000000 08:08 2037717 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 b6177000-b6178000 r--s 00000000 08:08 2035678 /var/cache/fontconfig/fcff1cd55d48a2c86a175e9943c3506d-x86.cache-2 b6178000-b6179000 r--s 00000000 08:08 2035675 /var/cache/fontconfig/e9e44584608a73233979f764b5f9dd81-x86.cache-2 b6179000-b617a000 r--s 00000000 08:08 2035665 /var/cache/fontconfig/b8613a33de00eecd32d Command terminated __________________________________________________ This seems to be a fast method but my application crashes :-( Regards Bjorn Bergqvist www.discretizer.org
On Oct 23, 2007, at 3:03 PM, Bj?rn Bergqvist wrote:> I tried to use the FXTable::extractText like this > > maxrow = MAX_ROW - 1 > maxcol = MAX_COL - 1 > printout = @table.extractText(0 , maxrow , 0 , maxcol , > cs="\t", rs="\n") > # Write the file > File.open(saveDialog.filename, "w").write(printout) > > then I got this output:<snip> Well, I don''t know what the values of MAX_ROW and MAX_COL are (as compared to the table size), so I don''t know if that''s part of the problem or not. But I just make a quick modification to the standard table.rb example program to include a call to extractText(): extract = FXMenuCommand.new(filemenu, "Extract text") extract.connect(SEL_COMMAND) do result = @table.extractText(0, @table.numRows - 1, 0, @table.numColumns - 1) puts result end and this works as expected. Note that I used the default values for the last two arguments, but that shouldn''t make a difference. If you''re still having problems, please file a bug report and attach a short example program that demonstrates the problem. Thanks, Lyle
Hello, I did the modification and then I get: *** glibc detected *** ruby: double free or corruption (!prev): 0x08260bb0 *** Will file a bug report as soon as I find some time. any value higher than: result = @table.extractText(0, 11, 0, 6) will result in a crash like: *** glibc detected *** ruby: malloc(): memory corruption: 0x08169000 *** on my system. Maybe a gcc problem? Regards Bjorn Bergqvist http://www.discretizer.org 2007/10/24, Lyle Johnson <lyle.johnson at gmail.com>:> > On Oct 23, 2007, at 3:03 PM, Bj?rn Bergqvist wrote: > > > I tried to use the FXTable::extractText like this > > > > maxrow = MAX_ROW - 1 > > maxcol = MAX_COL - 1 > > printout = @table.extractText(0 , maxrow , 0 , maxcol , > > cs="\t", rs="\n") > > # Write the file > > File.open(saveDialog.filename, "w").write(printout) > > > > then I got this output: > > <snip> > > Well, I don''t know what the values of MAX_ROW and MAX_COL are (as > compared to the table size), so I don''t know if that''s part of the > problem or not. But I just make a quick modification to the standard > table.rb example program to include a call to extractText(): > > extract = FXMenuCommand.new(filemenu, "Extract text") > extract.connect(SEL_COMMAND) do > result = @table.extractText(0, @table.numRows - 1, 0, > @table.numColumns - 1) > puts result > end > > and this works as expected. Note that I used the default values for > the last two arguments, but that shouldn''t make a difference. If > you''re still having problems, please file a bug report and attach a > short example program that demonstrates the problem. > > Thanks, > > Lyle > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users >-------------- next part -------------- A non-text attachment was scrubbed... Name: table.rb Type: application/x-ruby Size: 6992 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20071024/74e54baf/attachment-0001.bin
On Oct 24, 2007, at 10:25 AM, Bj?rn Bergqvist wrote:> I did the modification and then I get: > *** glibc detected *** ruby: double free or corruption (!prev): > 0x08260bb0 *** > > Will file a bug report as soon as I find some time. > > any value higher than: result = @table.extractText(0, 11, 0, 6) > will result in a crash like: > *** glibc detected *** ruby: malloc(): memory corruption: > 0x08169000 *** > on my system. Maybe a gcc problem?Very strange indeed. There are a few differences in our environments: I''m running Mac OS X, with Ruby 1.8.6 patchlevel 0 (not p36). And my FXRuby is built against FOX 1.6.28, not FOX 1.6.25. I will try to check this out under Linux and see if I can reproduce it; if I can''t, I''m not sure what I can do about it.