Closed ryco117 closed 4 years ago
A new stack-trace error is
6 rc_del refcount.c 16 0x44869c
7 str_del YASL_String.c 89 0x44adad
8 env_contains env.c 58 0x43b90c
9 YASL_setglobal yasl.c 171 0x436f2b
10 MainWindow::onConversationSelected mainwindow.cpp 192 0x41a4d1
... <More>
New valgrind
==178660== Invalid read of size 8
==178660== at 0x448A3E: dec_strong_ref (refcount.c:122)
==178660== by 0x448ADD: dec_ref (refcount.c:140)
==178660== by 0x4425B9: del_item (YASL_Table.c:22)
==178660== by 0x442AA0: YASL_Table_insert (YASL_Table.c:115)
==178660== by 0x437059: YASL_setglobal (yasl.c:184)
==178660== by 0x41A4A5: MainWindow::onConversationSelected(QTreeWidgetItem*, QTreeWidgetItem*) (mainwindow.cpp:187)
==178660== Address 0x19335c00 is 0 bytes inside a block of size 16 free'd
==178660== at 0x483AA0C: free (vg_replace_malloc.c:540)
==178660== by 0x44869B: rc_del (refcount.c:16)
==178660== by 0x447D1B: cfn_del_rc (YASL_Object.c:42)
==178660== by 0x448A79: dec_strong_ref (refcount.c:125)
==178660== by 0x448ADD: dec_ref (refcount.c:140)
==178660== by 0x436FF6: YASL_setglobal (yasl.c:182)
==178660== by 0x41A4A5: MainWindow::onConversationSelected(QTreeWidgetItem*, QTreeWidgetItem*) (mainwindow.cpp:187)
==178660== Block was alloc'd at
==178660== at 0x483980B: malloc (vg_replace_malloc.c:309)
==178660== by 0x448662: rc_new (refcount.c:9)
==178660== by 0x447CE8: new_cfn (YASL_Object.c:34)
==178660== by 0x437460: YASL_pushcfunction (yasl.c:256)
==178660== by 0x41A492: MainWindow::onConversationSelected(QTreeWidgetItem*, QTreeWidgetItem*) (mainwindow.cpp:186)
...
When the global var being set is a
string
orlist
that was declared in a previously run script, setting it using YASL_setglobal causes weird errors to appear later in the code, where the error is different depending on what code I've commented. Here is the most direct stack trace I've seen, setting a variable previously of typestring
Valgrind gives the following errors when using setglobal.
Note This error does not appear when the variable is a table or ints, which are the only other two I checked