Orange Forum • View topic - Crash creating orange.Example (svn revision 7023)

Crash creating orange.Example (svn revision 7023)

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

Crash creating orange.Example (svn revision 7023)

Postby neuroman » Mon Jan 12, 2009 1:06

In [23]: lex
Out[23]:
[[False, 'New York', Decimal("0"), False],
[False, 'New York', Decimal("0"), False],
[False, 'New York', Decimal("0"), False],
...
In [25]: dd = orange.DomainDepot()
In [26]: names = ['mS#UID', 'D#isorg', 'D#city', 'C#employeesft', 'cD#isinactive']
In [27]: domain, metaIDs, isNew = dd.prepareDomain(names)
In [28]: e = orange.Example(domain, lex[0])
*** buffer overflow detected ***: /usr/bin/python terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7f331409b887]
/lib/libc.so.6[0x7f3314099750]
/lib/libc.so.6[0x7f3314098d8b]
/lib/libc.so.6(__snprintf_chk+0x7b)[0x7f3314098c5b]
/usr/lib/python2.5/site-packages/orange/orange.so(_ZNK7TOrange10raiseErrorEPKcz+0xc8)[0x7f330d242f18]
/usr/lib/python2.5/site-packages/orange/orange.so(_ZN14TFloatVariable7str2valERKSsR6TValue+0x59)[0x7f330d2d4049]
/usr/lib/python2.5/site-packages/orange/orange.so(_Z25convertFromPythonExistingP7_objectR8TExample+0x444)[0x7f330cf44914]
/usr/lib/python2.5/site-packages/orange/orange.so(_Z11Example_newP11_typeobjectP7_objectS2_+0x4af)[0x7f330cf49d1f]
/usr/bin/python[0x46dd83]
/usr/bin/python(PyObject_Call+0x13)[0x418c33]
/usr/bin/python(PyEval_EvalFrameEx+0x3d12)[0x48f582]
/usr/bin/python(PyEval_EvalCodeEx+0x6ad)[0x4927cd]
/usr/bin/python(PyEval_EvalFrameEx+0x4cf8)[0x490568]
/usr/bin/python(PyEval_EvalCodeEx+0x6ad)[0x4927cd]
/usr/bin/python(PyEval_EvalFrameEx+0x5483)[0x490cf3]
/usr/bin/python(PyEval_EvalCodeEx+0x6ad)[0x4927cd]
/usr/bin/python(PyEval_EvalFrameEx+0x5483)[0x490cf3]
/usr/bin/python(PyEval_EvalFrameEx+0x6872)[0x4920e2]
/usr/bin/python(PyEval_EvalCodeEx+0x6ad)[0x4927cd]
/usr/bin/python(PyEval_EvalFrameEx+0x5483)[0x490cf3]
/usr/bin/python(PyEval_EvalCodeEx+0x6ad)[0x4927cd]
/usr/bin/python(PyEval_EvalFrameEx+0x5483)[0x490cf3]
/usr/bin/python(PyEval_EvalCodeEx+0x6ad)[0x4927cd]
/usr/bin/python(PyEval_EvalFrameEx+0x5483)[0x490cf3]
/usr/bin/python(PyEval_EvalCodeEx+0x6ad)[0x4927cd]
/usr/bin/python(PyEval_EvalCode+0x32)[0x4929c2]
/usr/bin/python(PyRun_FileExFlags+0x108)[0x4b2678]
/usr/bin/python(PyRun_SimpleFileExFlags+0x1ab)[0x4b291b]
/usr/bin/python(Py_Main+0xaea)[0x41488a]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f3313fba466]
/usr/bin/python[0x413ca9]
======= Memory map: ========
00400000-00525000 r-xp 00000000 fe:00 3401221 /usr/bin/python2.5
00724000-00725000 r--p 00124000 fe:00 3401221 /usr/bin/python2.5
00725000-00757000 rw-p 00125000 fe:00 3401221 /usr/bin/python2.5
00757000-0075f000 rw-p 00757000 00:00 0
01443000-01bf4000 rw-p 01443000 00:00 0 [heap]
7f330ccde000-7f330d431000 r-xp 00000000 fe:00 3484841 /usr/lib/python2.5/site-packages/orange/orange.so
7f330d431000-7f330d631000 ---p 00753000 fe:00 3484841 /usr/lib/python2.5/site-packages/orange/orange.so
7f330d631000-7f330d649000 r--p 00753000 fe:00 3484841 /usr/lib/python2.5/site-packages/orange/orange.so
7f330d649000-7f330d6a1000 rw-p 0076b000 fe:00 3484841 /usr/lib/python2.5/site-packages/orange/orange.so
7f330d6a1000-7f330d6ce000 rw-p 7f330d6a1000 00:00 0
7f330d6ce000-7f330d6d0000 r-xp 00000000 fe:00 3400636 /usr/lib/gconv/CP1252.so
7f330d6d0000-7f330d8cf000 ---p 00002000 fe:00 3400636 /usr/lib/gconv/CP1252.so
7f330d8cf000-7f330d8d0000 r--p 00001000 fe:00 3400636 /usr/lib/gconv/CP1252.so
7f330d8d0000-7f330d8d1000 rw-p 00002000 fe:00 3400636 /usr/lib/gconv/CP1252.so
7f330d8d1000-7f330d8e3000 r-xp 00000000 fe:00 565285 /lib/libresolv-2.8.90.so
7f330d8e3000-7f330dae2000 ---p 00012000 fe:00 565285 /lib/libresolv-2.8.90.so
7f330dae2000-7f330dae3000 r--p 00011000 fe:00 565285 /lib/libresolv-2.8.90.so
7f330dae3000-7f330dae4000 rw-p 00012000 fe:00 565285 /lib/libresolv-2.8.90.so
7f330dae4000-7f330dae6000 rw-p 7f330dae4000 00:00 0
7f330dae6000-7f330daea000 r-xp 00000000 fe:00 565278 /lib/libnss_dns-2.8.90.so
7f330daea000-7f330dcea000 ---p 00004000 fe:00 565278 /lib/libnss_dns-2.8.90.so
7f330dcea000-7f330dceb000 r--p 00004000 fe:00 565278 /lib/libnss_dns-2.8.90.so
7f330dceb000-7f330dcec000 rw-p 00005000 fe:00 565278 /lib/libnss_dns-2.8.90.so
7f330dcec000-7f330dcee000 r-xp 00000000 fe:00 566327 /lib/libnss_mdns4_minimal.so.2
7f330dcee000-7f330deed000 ---p 00002000 fe:00 566327 /lib/libnss_mdns4_minimal.so.2
7f330deed000-7f330deee000 rw-p 00001000 fe:00 566327 /lib/libnss_mdns4_minimal.so.2
7f330deee000-7f330def6000 r-xp 00000000 fe:00 565286 /lib/librt-2.8.90.so
7f330def6000-7f330e0f5000 ---p 00008000 fe:00 565286 /lib/librt-2.8.90.so
7f330e0f5000-7f330e0f6000 r--p 00007000 fe:00 565286 /lib/librt-2.8.90.so
7f330e0f6000-7f330e0f7000 rw-p 00008000 fe:00 565286 /lib/librt-2.8.90.so
7f330e0f7000-7f330e103000 r-xp 00000000 fe:00 1556830 /usr/lib/libodbcinst.so.1.0.0
7f330e103000-7f330e302000 ---p 0000c000 fe:00 1556830 /usr/lib/libodbcinst.so.1.0.0
7f330e302000-7f330e303000 r--p 0000b000 fe:00 1556830 /usr/lib/libodbcinst.so.1.0.0
7f330e303000-7f330e304000 rw-p 0000c000 fe:00 1556830 /usr/lib/libodbcinst.so.1.0.0
7f330e304000-7f330e359000 r-xp 00000000 fe:00 3457267 /usr/lib/odbc/libtdsodbc.so
7f330e359000-7f330e559000 ---p 00055000 fe:00 3457267 /usr/lib/odbc/libtdsodbc.so
7f330e559000-7f330e55c000 r--p 00055000 fe:00 3457267 /usr/lib/odbc/libtdsodbc.so
7f330e55c000-7f330e55d000 rw-p 00058000 fe:00 3457267 /usr/lib/odbc/libtdsodbc.so
7f330e55d000-7f330e55f000 r-xp 00000000 fe:00 3402134 /usr/lib/gconv/ISO8859-1.so
7f330e55f000-7f330e75e000 ---p 00002000 fe:00 3402134 /usr/lib/gconv/ISO8859-1.so
7f330e75e000-7f330e75f000 r--p 00001000 fe:00 3402134 /usr/lib/gconv/ISO8859-1.so
7f330e75f000-7f330e760000 rw-p 00002000 fe:00 3402134 /usr/lib/gconv/ISO8859-1.so
7f330e760000-7f330e76b000 r-xp 00000000 fe:00 565279 /lib/libnss_files-2.8.90.so
7f330e76b000-7f330e96a000 ---p 0000b000 fe:00 565279 /lib/libnss_files-2.8.90.so
7f330e96a000-7f330e96b000 r--p 0000a000 fe:00 565279 /lib/libnss_files-2.8.90.so
7f330e96b000-7f330e96c000 rw-p 0000b000 fe:00 565279 /lib/libnss_files-2.8.90.so
7f330e96c000-7f330e976000 r-xp 00000000 fe:00 565281 /lib/libnss_nis-2.8.90.so
7f330e976000-7f330eb75000 ---p 0000a000 fe:00 565281 /lib/libnss_nis-2.8.90.so
7f330eb75000-7f330eb76000 r--p 00009000 fe:00 565281 /lib/libnss_nis-2.8.90.so
7f330eb76000-7f330eb77000 rw-p 0000a000 fe:00 565281 /lib/libnss_nis-2.8.90.so
7f330eb77000-7f330eb8d000 r-xp 00000000 fe:00 565276 /lib/libnsl-2.8.90.so
7f330eb8d000-7f330ed8c000 ---p 00016000 fe:00 565276 /lib/libnsl-2.8.90.so
7f330ed8c000-7f330ed8d000 r--p 00015000 fe:00 565276 /lib/libnsl-2.8.90.so
7f330ed8d000-7f330ed8e000 rw-p 00016000 fe:00 565276 /lib/libnsl-2.8.90.so
7f330ed8e000-7f330ed90000 rw-p 7f330ed8e000 00:00 0
7f330ed90000-7f330ed98000 r-xp 00000000 fe:00 565277 /lib/libnss_compat-2.8.90.so
7f330ed98000-7f330ef97000 ---p 00008000 fe:00 565277 /lib/libnss_compat-2.8.90.so
7f330ef97000-7f330ef98000 r--p 00007000 fe:00 565277 /lib/libnss_compat-2.8.90.so
7f330ef98000-7f330ef99000 rw-p 00008000 fe:00 565277 /lib/libnss_compat-2.8.90.so
7f330ef99000-7f330efab000 r-xp 00000000 fe:00 3408709 /usr/lib/python2.5/lib-dynload/datetime.so
7f330efab000-7f330f1aa000 ---p 00012000 fe:00 3408709 /usr/lib/python2.5/lib-dynload/datetime.so
7f330f1aa000-7f330f1ab000 r--p 00011000 fe:00 3408709 /usr/lib/python2.5/lib-dynload/datetime.so
7f330f1ab000-7f330f1af000 rw-p 00012000 fe:00 3408709 /usr/lib/python2.5/lib-dynload/datetime.so
7f330f1af000-7f330f1b7000 r-xp 00000000 fe:00 3404097 /usr/lib/libltdl.so.7.1.2
7f330f1b7000-7f330f3b6000 ---p 00008000 fe:00 3404097 /usr/lib/libltdl.so.7.1.2
7f330f3b6000-7f330f3b7000 r--p 00007000 fe:00 3404097 /usr/lib/libltdl.so.7.1.2
7f330f3b7000-7f330f3b8000 rw-p 00008000 fe:00 3404097 /usr/lib/libltdl.so.7.1.2
7f330f3b8000-7f330f3ce000 r-xp 00000000 fe:00 566338 /lib/libgcc_s.so.1
7f330f3ce000-7f330f5ce000 ---p 00016000 fe:00 566338 /lib/libgcc_s.so.1
7f330f5ce000-7f330f5cf000 r--p 00016000 fe:00 566338 /lib/libgcc_s.so.1
7f330f5cf000-7f330f5d0000 rw-p 00017000 fe:00 566338 /lib/libgcc_s.so.1
7f330f5d0000-7f330f6c1000 r-xp 00000000 fe:00 3404063 /usr/lib/libstdc++.so.6.0.10
7f330f6c1000-7f330f8c1000 ---p 000f1000 fe:00 3404063 Aborted

more crash

Postby neuroman » Wed Jan 14, 2009 1:35

This also happens when I try to create an ExampleTable:
Code: Select all
In [12]: table = orange.ExampleTable('example.tab')
*** buffer overflow detected ***: /usr/bin/python terminated

Example table file looks like:
Code: Select all
mS#UID   D#isorg   D#city   C#employeesft   cD#isinactive   
21125   False   New York   0   False   
21126   False   New York   0   False   
21127   False   Mahwah   0   False   
21128   False   Mahwah   0   False   

Postby Janez » Sat Jan 17, 2009 0:15

As for the first post: it crashes when converting the continuous attribute... What is Decimal?

If I put 0 instead of Decimal("0") I get an error message ("New York" is not a valid value for city). If you construct an attribute manually like this, you have to provide the set of values for the attribute, e.g. domain["city"].values = ["New York", "Mahwah"].

For the second: it works if you name the file to .txt. The .tab are slightly different. If I name it example.tab, like you, I get an error.

It would seem that your Orange crashes instead of printing out an error. Can you try it with something stupid, like orange.Domain([])[5]?

Postby neuroman » Tue Jan 20, 2009 14:47

The Decimal type was a type that came straight from a database. I tried converting them all to strings first and that crashed as well.

This line:
orange.Domain([])[5]
produces "IndexError: index out of range"

Basically what I am doing is pulling values from a database and trying to create my own example table from the list of values returned from the database. They will be strings, floats and integers. Doesn't orange try to convert the values to the right types? Do I have to convert values to an Orange value type?

This gives me big suprise. So nice is orange.

Postby Guy Hoozdis » Fri Feb 06, 2009 7:19

I am having much love with orange. Thank you.

The following has occured on a 64-bit Ubuntu 8.10

--- test.py ------
import orange

data = orange.ExampleTable( "../datasets/adult_sample.tab" )
domain = data.domain

# Great Success
print domain[1].randomvalue()

# Horrible Failure
print domain[0].randomvalue()

---- End test.py -----

*** buffer overflow detected ***: python terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7fc48eb77877]
/lib/libc.so.6[0x7fc48eb75740]
/lib/libc.so.6[0x7fc48eb74d7b]
/lib/libc.so.6(__snprintf_chk+0x7b)[0x7fc48eb74c4b]
/usr/lib64/python2.5/site-packages/orange/orange.so(_ZNK7TOrange10raiseErrorEPKcz+0xc8)[0x7fc48dd3ae68]
/usr/lib64/python2.5/site-packages/orange/orange.so(_ZN14TFloatVariable11randomValueERKi+0xb9)[0x7fc48ddc76b9]
/usr/lib64/python2.5/site-packages/orange/orange.so(_Z20Variable_randomvalueP7_objectS0_+0xd4)[0x7fc48dba0534]
python(PyEval_EvalFrameEx+0x57e2)[0x491052]
python(PyEval_EvalCodeEx+0x6ad)[0x4927cd]
python(PyEval_EvalCode+0x32)[0x4929c2]
python(PyRun_InteractiveOneFlags+0x1e8)[0x4b2278]
python(PyRun_InteractiveLoopFlags+0x4e)[0x4b24ae]
python(PyRun_AnyFileExFlags+0x6e)[0x4b2b8e]
python(Py_Main+0x505)[0x4142a5]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7fc48ea96466]
python[0x413ca9]
======= Memory map: ========
00400000-00525000 r-xp 00000000 07:00 17198 /usr/bin/python2.5
00724000-00725000 r--p 00124000 07:00 17198 /usr/bin/python2.5
00725000-00757000 rw-p 00125000 07:00 17198 /usr/bin/python2.5
00757000-0075f000 rw-p 00757000 00:00 0
022c8000-027b9000 rw-p 022c8000 00:00 0 [heap]
7fc48d2f6000-7fc48d30c000 r-xp 00000000 07:00 545659 /lib/libgcc_s.so.1
7fc48d30c000-7fc48d50c000 ---p 00016000 07:00 545659 /lib/libgcc_s.so.1
7fc48d50c000-7fc48d50d000 r--p 00016000 07:00 545659 /lib/libgcc_s.so.1
7fc48d50d000-7fc48d50e000 rw-p 00017000 07:00 545659 /lib/libgcc_s.so.1
7fc48d50e000-7fc48d5ff000 r-xp 00000000 07:00 16629 /usr/lib/libstdc++.so.6.0.10
7fc48d5ff000-7fc48d7ff000 ---p 000f1000 07:00 16629 /usr/lib/libstdc++.so.6.0.10
7fc48d7ff000-7fc48d806000 r--p 000f1000 07:00 16629 /usr/lib/libstdc++.so.6.0.10
7fc48d806000-7fc48d808000 rw-p 000f8000 07:00 16629 /usr/lib/libstdc++.so.6.0.10
7fc48d808000-7fc48d81b000 rw-p 7fc48d808000 00:00 0
7fc48d81b000-7fc48df1d000 r-xp 00000000 07:00 108402 /usr/lib/python2.5/site-packages/orange/orange.so
7fc48df1d000-7fc48e11c000 ---p 00702000 07:00 108402 /usr/lib/python2.5/site-packages/orange/orange.so
7fc48e11c000-7fc48e134000 r--p 00701000 07:00 108402 /usr/lib/python2.5/site-packages/orange/orange.so
7fc48e134000-7fc48e183000 rw-p 00719000 07:00 108402 /usr/lib/python2.5/site-packages/orange/orange.so
7fc48e183000-7fc48e1af000 rw-p 7fc48e183000 00:00 0
7fc48e1af000-7fc48e1e6000 r-xp 00000000 07:00 545724 /lib/libncurses.so.5.6
7fc48e1e6000-7fc48e3e5000 ---p 00037000 07:00 545724 /lib/libncurses.so.5.6
7fc48e3e5000-7fc48e3ea000 rw-p 00036000 07:00 545724 /lib/libncurses.so.5.6
7fc48e3ea000-7fc48e42d000 r-xp 00000000 07:00 545726 /lib/libncursesw.so.5.6
7fc48e42d000-7fc48e62c000 ---p 00043000 07:00 545726 /lib/libncursesw.so.5.6
7fc48e62c000-7fc48e631000 rw-p 00042000 07:00 545726 /lib/libncursesw.so.5.6
7fc48e631000-7fc48e668000 r-xp 00000000 07:00 545766 /lib/libreadline.so.5.2
7fc48e668000-7fc48e868000 ---p 00037000 07:00 545766 /lib/libreadline.so.5.2
7fc48e868000-7fc48e870000 rw-p 00037000 07:00 545766 /lib/libreadline.so.5.2
7fc48e870000-7fc48e871000 rw-p 7fc48e870000 00:00 0
7fc48e871000-7fc48e875000 r-xp 00000000 07:00 106842 /usr/lib/python2.5/lib-dynload/readline.so
7fc48e875000-7fc48ea75000 ---p 00004000 07:00 106842 /usr/lib/python2.5/lib-dynload/readline.so
7fc48ea75000-7fc48ea76000 r--p 00004000 07:00 106842 /usr/lib/python2.5/lib-dynload/readline.so
7fc48ea76000-7fc48ea78000 rw-p 00005000 07:00 106842 /usr/lib/python2.5/lib-dynload/readline.so
7fc48ea78000-7fc48ebe1000 r-xp 00000000 07:00 547954 /lib/libc-2.8.90.so
7fc48ebe1000-7fc48ede0000 ---p 00169000 07:00 547954 /lib/libc-2.8.90.so
7fc48ede0000-7fc48ede4000 r--p 00168000 07:00 547954 /lib/libc-2.8.90.so
7fc48ede4000-7fc48ede5000 rw-p 0016c000 07:00 547954 /lib/libc-2.8.90.so
7fc48ede5000-7fc48edea000 rw-p 7fc48ede5000 00:00 0
7fc48edea000-7fc48ee6e000 r-xp 00000000 07:00 547958 /lib/libm-2.8.90.so
7fc48ee6e000-7fc48f06d000 ---p 00084000 07:00 547958 /lib/libm-2.8.90.so
7fc48f06d000-7fc48f06e000 r--p 00083000 07:00 547958 /lib/libm-2.8.90.so
7fc48f06e000-7fc48f06f000 rw-p 00084000 07:00 547958 /lib/libm-2.8.90.so
7fc48f06f000-7fc48f071000 r-xp 00000000 07:00 547973 /lib/libutil-2.8.90.so
7fc48f071000-7fc48f270000 ---p 00002000 07:00 547973 /lib/libutil-2.8.90.so
7fc48f270000-7fc48f271000 r--p 00001000 07:00 547973 /lib/libutil-2.8.90.so
7fc48f271000-7fc48f272000 rw-p 00002000 07:00 547973 /lib/libutil-2.8.90.so
7fc48f272000-7fc48f274000 r-xp 00000000 07:00 547957 /lib/libdl-2.8.90.so
7fc48f274000-7fc48f474000 ---p 00002000 07:00 547957 /lib/libdl-2.8.90.so
7fc48f474000-7fc48f475000 r--p 00002000 07:00 547957 /lib/libdl-2.8.90.so
7fc48f475000-7fc48f476000 rw-p 00003000 07:00 547957 /lib/libdl-2.8.90.so
7fc48f476000-7fc48f48d000 r-xp 00000000 07:00 547968 /lib/libpthread-2.8.90.so
7fc48f48d000-7fc48f68c000 ---p 00017000 07:00 547968 /lib/libpthread-2.8.90.so
7fc48f68c000-7fc48f68d000 r--p 00016000 07:00 547968 /lib/libpthread-2.8.90.so
7fc48f68d000-7fc48f68e000 rw-p 00017000 07:00 547968 /lib/libpthread-2.8.90.so
7fc48f68e000-7fc48f692000 rw-p 7fc48f68e000 00:00 0
7fc48f692000-7fc48f6b1000 r-xp 00000000 07:00 545714 /lib/ld-2.8.90.so
7fc48f71b000-7fc48f7cf000 rw-p 7fc48f71b000 00:00 0
7fc48f7cf000-7fc48f7d6000 r--s 00000000 07:00 32995 /usr/lib/gconv/gconv-modules.cache
7fc48f7d6000-7fc48f815000 r--p 00000000 07:00 50549 /usr/lib/locale/en_US.utf8/LC_CTYPE
7fc48f815000-7fc48f89a000 rw-p 7fc48f815000 00:00 0
7fc48f8ad000-7fc48f8b0000 rw-p 7fc48f8ad000 00:00 0
7fc48f8b0000-7fc48f8b1000 r--p 0001e000 07:00 545714 /lib/ld-2.8.90.so
7fc48f8b1000-7fc48f8b2000 rw-p 0001f000 07:00 545714 /lib/ld-2.8.90.so
7fff9789d000-7fff978b2000 rw-p 7ffffffea000 00:00 0 [stack]
7fff979ff000-7fff97a00000 r-xp 7fff979ff000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted

Postby Janez » Fri Feb 06, 2009 10:41

Great, I can replicate this one! (I couldn't replicate those above.)

I'll look into it.

-- Janez

Postby Janez » Fri Feb 06, 2009 10:58

I did. Please get the fixed version from the SVN.

Or, you can open source/orange/errors.cpp and source/orange/root.cpp and change

excbuf[256], excbuf2[256]

to

excbuf[512], excbuf2[512]

As you can see from the variable names and the type of change required, this bug qualifies me for work at Microsoft. ;)

Don't be so hard on yourself.

Postby GuyHoozdis » Mon Feb 16, 2009 18:57

Haha.

Thanks for the tracking this down and fixing it.

Postby GuyHoozdis » Tue Apr 14, 2009 21:52

Sorry I never got back to you on this. I followed your advice to modify the buffer sizes in root.cpp and errors.cpp, but that did not work until I had raised the buffer size to a very large number.

I worked up from 256, 512, 1024, ... . It was a while ago that I did this; I think I just jumped to 4096 soon after. That's what I have it set to now, but I haven't identified exactly why the error is occurring. I think the buffer size mis-match is related, but maybe something deeper than this. The obscenely large buffer size is only masking the problem I think.


If you want my svn diff I will run that for you. I saw a post around here one time on how you like the diff to be delivered; could you remind me, please?

$> cd .../source/orange/
$> svn diff errors.cpp root.cpp

Something about the diff being perfered "inline" or something like that... what do I need to do?

Postby Janez » Sat Apr 18, 2009 13:56

Hi,

I cannot replicate the bug anymore and the code looks OK, so I don't know what to do.

Your diff could be helpful. I don' remember me or anybody else giving any instructions about the format, so you can just send it in any way you like. :)

Thanks,
JAnez

Postby GuyHoozdis » Sat Apr 18, 2009 18:52

Here is the svn diff of errors.cpp and root.cpp. This is not a solution to the problem, but it will cover the errors I have been seeing. I think I could share some datasets with you that cause errors, but I can't post them publicly.

I think the issue at hand here is how two statically declared buffers are used. The buffers in errors.cpp and root.cpp have the same name, but they may not actually be related. I haven't gone digging through the code to discuover how the buffers are used; I'm hopiing that someone more familiar with the code can quickly identify what needs to be done.

... now that I have reviewed the diff below; I am starting to think that I need to force update my working copy from the repository. Maybe it's only sticking around because I made changes to it.

Index: errors.cpp
===================================================================
--- errors.cpp (revision 7512)
+++ errors.cpp (working copy)
@@ -28,7 +28,12 @@

bool exhaustiveWarnings = false;

-char excbuf[512], excbuf2[256];
+// XXX: 02/21/09 - This was how I found it from repository.
+// Thread with Janez indicates sizes should both be 512.
+// * http://www.ailab.si/orange/forum/viewtopic.php?p=1711
+//char excbuf[512], excbuf2[256];
+#define BUF_SIZE 4096
+char excbuf[BUF_SIZE], excbuf2[BUF_SIZE];

void raiseError(const char *anerr, ...)
{ va_list vargs;
@@ -38,7 +43,7 @@
va_start(vargs);
#endif

- vsnprintf(excbuf, 512, anerr, vargs);
+ vsnprintf(excbuf, BUF_SIZE, anerr, vargs);
throw mlexception(excbuf);
}

@@ -51,8 +56,9 @@
va_start(vargs);
#endif

- snprintf(excbuf2, 256, "%s: %s", who, anerr);
- vsnprintf(excbuf, 512, excbuf2, vargs);
+ snprintf(excbuf2, BUF_SIZE, "%s: %s", who, anerr);
+ vsnprintf(excbuf, BUF_SIZE, excbuf2, vargs);
throw mlexception(excbuf);
}

Index: root.cpp
===================================================================
--- root.cpp (revision 7512)
+++ root.cpp (working copy)
@@ -162,9 +162,12 @@
}


+// XXX: 02/21/09 - There seems to be a mismatch between
+// defined buffer sizes in this file and errors.cpp
+// extern char excbuf[256], excbuf2[256]; // defined in errors.cpp
+#define BUF_SIZE 4096
+extern char excbuf[BUF_SIZE], excbuf2[BUF_SIZE]; // defined in errors.cpp

-extern char excbuf[256], excbuf2[256]; // defined in errors.cpp
-
void TOrange::raiseError(const char *anerr, ...) const
{ va_list vargs;
#ifdef HAVE_STDARG_PROTOTYPES
@@ -173,8 +176,8 @@
va_start(vargs);
#endif

- snprintf(excbuf, 512, "'orange.%s': %s", TYPENAME(typeid(*this)), anerr);
- vsnprintf(excbuf2, 512, excbuf, vargs);
+ snprintf(excbuf, BUF_SIZE, "'orange.%s': %s", TYPENAME(typeid(*this)), anerr);
+ vsnprintf(excbuf2, BUF_SIZE, excbuf, vargs);
throw mlexception(excbuf2);
}

@@ -187,8 +190,8 @@
va_start(vargs);
#endif

- snprintf(excbuf, 512, "'orange.%s.%s': %s", TYPENAME(typeid(*this)), who, anerr);
- vsnprintf(excbuf2, 512, excbuf, vargs);
+ snprintf(excbuf, BUF_SIZE, "'orange.%s.%s': %s", TYPENAME(typeid(*this)), who, anerr);
+ vsnprintf(excbuf2, BUF_SIZE, excbuf, vargs);
throw mlexception(excbuf2);
}

@@ -203,8 +206,8 @@
va_start(vargs);
#endif

- snprintf(excbuf, 512, "'%s': %s", TYPENAME(typeid(*this)), anerr);
- vsnprintf(excbuf2, 512, excbuf, vargs);
+ snprintf(excbuf, BUF_SIZE, "'%s': %s", TYPENAME(typeid(*this)), anerr);
+ vsnprintf(excbuf2, BUF_SIZE, excbuf, vargs);
warningFunction(false, excbuf2);
}
}
@@ -219,8 +222,8 @@
va_start(vargs);
#endif

- snprintf(excbuf, 512, "'%s': %s", TYPENAME(typeid(*this)), anerr);
- vsnprintf(excbuf2, 512, excbuf, vargs);
+ snprintf(excbuf, BUF_SIZE, "'%s': %s", TYPENAME(typeid(*this)), anerr);
+ vsnprintf(excbuf2, BUF_SIZE, excbuf, vargs);
warningFunction(true, excbuf2);
}
}
@@ -235,8 +238,8 @@
va_start(vargs);
#endif

- snprintf(excbuf, 512, "'orange.%s.%s': %s", TYPENAME(typeid(*this)), who, anerr);
- vsnprintf(excbuf2, 512, excbuf, vargs);
+ snprintf(excbuf, BUF_SIZE, "'orange.%s.%s': %s", TYPENAME(typeid(*this)), who, anerr);
+ vsnprintf(excbuf2, BUF_SIZE, excbuf, vargs);
warningFunction(false, excbuf2);
}
}

Postby Guest » Sun Apr 19, 2009 0:21

... or if you want me to compile with certain options, use my datasets, and then deliver you debugging output... we can do that too.

Postby GuyHoozdis » Sun Apr 19, 2009 0:23

Sorry, that was me.


Return to Bugs



cron