Kernel: Bad memory access (signum=7), see Linux kernel log for details

Hello everyone,

I’m running into an issue when using Goa to perform model inference on Genode.

When I load one model, goa run works fine and the inference completes successfully. However, when I try to load two or more instances of the same model, I get the following error:

Kernel: Bad memory access (signum=7), see Linux kernel log for details

I also tried increasing the RAM quota in the runtime configuration, for example:

<resource name="RAM" quantum="2000M"/>

But this does not solve the problem.

The total size of the three models I’m loading is about 530 MB.

My runtime file is:

<runtime ram="3000M" caps="3000" binary="init">
	<requires> <timer/> <rtc/> </requires>

	<config>

		<parent-provides>
			<service name="ROM"/>
			<service name="LOG"/>
			<service name="CPU"/>
			<service name="PD"/>
			<service name="Timer"/>
			<service name="RTC"/>
		</parent-provides>

		<default-route> <any-service> <parent/> </any-service> </default-route>


		<start name="procA" caps="2000">
			<binary name="procA"/>
			<resource name="RAM" quantum="2000M"/>
			<route>
				<service name="PD"> <parent/> </service>
				<service name="CPU"> <parent/> </service>
				<service name="ROM"> <parent/> </service>
				<service name="LOG"> <parent/> </service>
				<service name="Timer"> <parent/> </service>
				<service name="RTC"> <parent/> </service>
			</route>
			<config>
				<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
				<vfs>
					<dir name="dev"> <log/> <inline name="rtc">2019-08-20 15:01</inline>  </dir>
					
					<dir name="tmp">
							<ram/>
						<rom name="part1_vgg16.tflite" label="part1_vgg16.tflite" binary="yes"/>
						<rom name="part2_vgg16.tflite" label="part2_vgg16.tflite" binary="yes"/>
						<rom name="part3_vgg16.tflite" label="part3_vgg16.tflite" binary="yes"/>
						<rom name="part1_vgg16_copy_2.tflite" label="part1_vgg16_copy_2.tflite" binary="yes"/>
						<rom name="part2_vgg16_copy_2.tflite" label="part2_vgg16_copy_2.tflite" binary="yes"/>
						<rom name="part3_vgg16_copy_2.tflite" label="part3_vgg16_copy_2.tflite" binary="yes"/>
						<rom name="processed_img_test_1.txt" label="processed_img_test_1.txt" binary="no"/>
						<rom name="processed_img_test_2.txt" label="processed_img_test_2.txt" binary="no"/>
					</dir>
				</vfs>
			</config>
		</start>

	</config>

	<content>
		<rom label="procA"/>
		<!-- <rom label="procB"/> -->
		<!-- <rom label="procC"/> -->
		<rom label="init"/>
		<rom label="stdcxx.lib.so"/>
		<rom label="vfs.lib.so"/>
		<rom label="posix.lib.so"/>
		<rom label="libc.lib.so"/>
		<rom label="libm.lib.so"/>

		<rom name="part1_vgg16.tflite" label="part1_vgg16.tflite" binary="yes"/>
		<rom name="part2_vgg16.tflite" label="part2_vgg16.tflite" binary="yes"/>
		<rom name="part3_vgg16.tflite" label="part3_vgg16.tflite" binary="yes"/>
		<rom name="part1_vgg16_copy_2.tflite" label="part1_vgg16_copy_2.tflite" binary="yes"/>
		<rom name="part2_vgg16_copy_2.tflite" label="part2_vgg16_copy_2.tflite" binary="yes"/>
		<rom name="part3_vgg16_copy_2.tflite" label="part3_vgg16_copy_2.tflite" binary="yes"/>
		<rom name="processed_img_test_1.txt" label="processed_img_test_1.txt" binary="no"/>
		<rom name="processed_img_test_2.txt" label="processed_img_test_2.txt" binary="no"/>
	</content>

</runtime>

Does anyone know what might be causing this error, or how I could further debug it? Any hints or suggestions would be greatly appreciated.

Thank you in advance!

First, you should follow the advice and look into your Linux kernel log. With the information provided there you may find which part of your component (program address) is to blame for signal 7 (SIGBUS) or signal 11 (SIGSEGV).

Maybe I lost track of your topics here but I can’t imagine what procA is doing with TensorFlow data.