toitlang / toit

Program your microcontrollers in a fast and robust high-level language.
https://toitlang.org/
GNU Lesser General Public License v2.1
1.22k stars 81 forks source link

file-test has valgrind errors #326

Open floitsch opened 2 years ago

floitsch commented 2 years ago
==1244076== Mismatched free() / delete / delete []
==1244076==    at 0x484127F: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1244076==    by 0x20F850: toit::tracing_free(void*, char const*, int) (top.cc:86)
==1244076==    by 0x1EE242: toit::primitive_closedir(toit::Process*, toit::Object**) (primitive_file_posix.cc:222)
==1244076==    by 0x1AE6E4: toit::Interpreter::_run() (interpreter_run.cc:997)
==1244076==    by 0x1AA93C: toit::Interpreter::run() (interpreter.cc:369)
==1244076==    by 0x20456B: toit::Scheduler::run_process(toit::Locker&, toit::Process*, toit::SchedulerThread*) (scheduler.cc:474)
==1244076==    by 0x20331A: toit::Scheduler::run(toit::SchedulerThread*) (scheduler.cc:293)
==1244076==    by 0x2020A0: toit::SchedulerThread::entry() (scheduler.cc:41)
==1244076==    by 0x1BD2B8: toit::Thread::_boot() (os_posix.cc:191)
==1244076==    by 0x1BD206: toit::thread_start(void*) (os_posix.cc:183)
==1244076==    by 0x4897258: start_thread (in /usr/lib/libpthread-2.33.so)
==1244076==    by 0x4AFF5E2: clone (in /usr/lib/libc-2.33.so)
==1244076==  Address 0x4ca8ce0 is 0 bytes inside a block of size 8 alloc'd
==1244076==    at 0x483F899: operator new(unsigned long, std::nothrow_t const&) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1244076==    by 0x1EDB2C: toit::primitive_opendir(toit::Process*, toit::Object**) (primitive_file_posix.cc:156)
==1244076==    by 0x1AE6E4: toit::Interpreter::_run() (interpreter_run.cc:997)
==1244076==    by 0x1AA93C: toit::Interpreter::run() (interpreter.cc:369)
==1244076==    by 0x20456B: toit::Scheduler::run_process(toit::Locker&, toit::Process*, toit::SchedulerThread*) (scheduler.cc:474)
==1244076==    by 0x20331A: toit::Scheduler::run(toit::SchedulerThread*) (scheduler.cc:293)
==1244076==    by 0x2020A0: toit::SchedulerThread::entry() (scheduler.cc:41)
==1244076==    by 0x1BD2B8: toit::Thread::_boot() (os_posix.cc:191)
==1244076==    by 0x1BD206: toit::thread_start(void*) (os_posix.cc:183)
==1244076==    by 0x4897258: start_thread (in /usr/lib/libpthread-2.33.so)
==1244076==    by 0x4AFF5E2: clone (in /usr/lib/libc-2.33.so)
==1244076== 
==1244076== Warning: invalid file descriptor -1 in syscall close()
==1244076== 
kasperl commented 2 years ago

Is this still the case?