Skip to content

Valgrind reports Invalid Read of Size 4 at software_interrupt_handle_signals #69

Description

@bushidocodes

Edit: Also need to document / script how to run Valgrind with the runtime.

Number of cores 16, sandboxing cores 15 (start: 1) and module reqs 0
==8856== Thread 6:
==8856== Invalid read of size 4
==8856==    at 0x56132A6: pthread_kill (pthread_kill.c:40)
==8856==    by 0x409F66: software_interrupt_handle_signals (software_interrupt.c:72)
==8856==    by 0x561689F: ??? (in /lib/x86_64-linux-gnu/libpthread-2.27.so)
==8856==    by 0x56131F5: pthread_sigmask (pthread_sigmask.c:45)
==8856==    by 0x40A712: software_interrupt_unmask_signal (software_interrupt.h:86)
==8856==    by 0x40A712: worker_thread_main (worker_thread.c:188)
==8856==    by 0x560B6DA: start_thread (pthread_create.c:463)
==8856==    by 0x5944A3E: clone (clone.S:95)
==8856==  Address 0x2d0 is not stack'd, malloc'd or (recently) free'd
Number of cores 16, sandboxing cores 15 (start: 1) and module reqs 0
==8856== Thread 6:
==8856== Invalid read of size 4
==8856==    at 0x56132A6: pthread_kill (pthread_kill.c:40)
==8856==    by 0x409F66: software_interrupt_handle_signals (software_interrupt.c:72)
==8856==    by 0x561689F: ??? (in /lib/x86_64-linux-gnu/libpthread-2.27.so)
==8856==    by 0x56131F5: pthread_sigmask (pthread_sigmask.c:45)
==8856==    by 0x40A712: software_interrupt_unmask_signal (software_interrupt.h:86)
==8856==    by 0x40A712: worker_thread_main (worker_thread.c:188)
==8856==    by 0x560B6DA: start_thread (pthread_create.c:463)
==8856==    by 0x5944A3E: clone (clone.S:95)
==8856==  Address 0x2d0 is not stack'd, malloc'd or (recently) free'd

Which is basically this code:

		/* A POSIX signal is delivered to one of the threads in our process.If sent by the kernel, "broadcast"
		 * by forwarding to all all threads */
		if (signal_info->si_code == SI_KERNEL) {
			for (int i = 0; i < runtime_total_worker_processors; i++) {
				if (pthread_self() != runtime_worker_threads[i]) {
					pthread_kill(runtime_worker_threads[i], SIGALRM);
				}
			}
		} else {
			/* If not sent by the kernel, this should be a signal forwarded from another thread */
			assert(signal_info->si_code == SI_TKILL);
		}

runtime_worker_threads is being indexed properly and seems to have sane pthread IDs
I have no clue about address 0x2d0

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions