Signal SIGSEGV: Segmentation fault - invalid memory reference

Dear FLUKA Experts,

I hope this message finds you well.

I am currently running a FLUKA simulation where I aim to score information on protons crossing a specific boundary. To achieve this, I am using a user-defined mgdraw.f routine combined with a source.f routine.

Unfortunately, I am encountering errors that I am unable to resolve. Specifically, the simulation terminates with a segmentation fault:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x7f3a3527e5af in ???
#1 0x409a58 in master.0.mgdraw
at …/Routines/Mgdraw/AM_mgdraw_custom_2024v3.f:71
#2 0x7a9f09 in ???
#3 0x5e5433 in ???
#4 0x4b90c5 in ???
#5 0x41c64b in ???
#6 0x407080 in ???
#7 0x7f3a3526a7e4 in ???
#8 0x40878d in ???
#9 0xffffffffffffffff in ???

and an error regarding the source executable:

image

I would greatly appreciate any advice or guidance on how to debug this issue further. I have attached for your reference my customized scoring routine, the routine used to define the source particles and the input files for the simulation setup.

Thank you very much for your time and support.
Best regards,
Antonella

AM_mgdraw_custom_2024v3.f (9.5 KB)
MT96_2024_cf_ambe_cfmod.f (13.5 KB)
phase_space_20012025.flair (31.8 KB)
phase_space_20012025.inp (4.9 KB)

Dear Antonella,

You accidentally removed the RETURN statement before the line beginning with ENTRY BXDRAW.

Cheers,
David

A post was split to a new topic: Unexpected dip in LET spectrum