[Gems-users] Segmentation Fault


Date: Mon, 15 May 2006 21:17:24 +0200
From: "Marco Tirado" <marco.tirado@xxxxxxxxx>
Subject: [Gems-users] Segmentation Fault
Hello Dan:
 
Thank you for answering so quickly. We are not getting the segmentation error now, the problem was that we were loading the ruby module but we did not initialize it with instruction ruby0.init untill we went into a MAGIC_BREAKPOINT subroutine that we have impemented in our code. However we still have some problems trying to load ruby on a magic breakpoint subroutine. We are running SPLASH2 on a sarek SPARC target and we want to start ruby in a specific part of the workload code so we are using magic breakpoints. Our script is the following:
 

read-configuration /localdisk/cmp/chkpt/cold_watersp4p.chkpt

instruction-fetch-mode instruction-fetch-trace
istc-disable
dstc-disable

$control = 0
@def hap_callback(user_arg, cpu, arg):          
 if simenv.control == 0:
    eval_cli_line("run-command-file startRuby.simics")
 else:
           eval_cli_line("run-command-file stopRuby.simics")
 simenv.control = simenv.control+1
@SIM_hap_add_callback("Core_Magic_Instruction", hap_callback, None)
echo("Magic interruption handler conf sucess")
c

We added the MAGIC_BREAKPOINT instruction in the workload source right before the important part of the code starts, and we start ruby there, the script looks lile this:
 
load-module ruby
ruby0.setparam g_NUM_PROCESSORS 4
ruby0.setparam g_NUM_L2_BANKS 4
ruby0.setparam g_NUM_MEMORIES 4
ruby0.setparam g_PROCS_PER_CHIP 4
ruby0.setparam g_endpoint_bandwidth 1000
ruby0.setparam_str g_NETWORK_TOPOLOGY FILE_SPECIFIED
ruby0.setparam_str g_CACHE_DESIGN NUCA_Mesh
ruby0.setparam L1_CACHE_NUM_SETS_BITS 8
#ruby0.setparam DIR_CACHE_NUM_SETS_BITS 8
ruby0.setparam L2_CACHE_NUM_SETS_BITS 12
ruby0.setparam g_DATA_BLOCK_BYTES 32
ruby0.setparam g_MEMORY_SIZE_BYTES 4294967296

ruby0.init
 

However we get an error message once we go into the MAGIC_BREAKPOINT subroutine since we need to stop simics in order to load ruby. The message is:
 
[start2.simics:37] c
[startRuby.simics:1] load-module ruby
This command cannot be used when Simics is running.
[startRuby.simics:1] the command did not complete properly; interrupting script
 
We thought the magic breakpoint would stop simics, but it is not the case. Are we missing something? is there another way to do this? Thanks again. Best Regards
 
Enric and Marco


 
On 5/15/06, Dan Gibson <degibson@xxxxxxxx> wrote:
Marco+Enric,

As you may have guessed from previous posts on this topic, Ruby will
segfault if it is loaded before a "phys_mem0" object exists (the call to
acquire this object returns NULL, and the pointer is then used).
However, it looks like you are successfully loading a checkpoint before
installing ruby. Can you confirm that "phys_mem0" exists before
load-module ruby?

Have a look in Ruby's module/ruby.c file, in the init_local() function.
Try inserting some print statements to determine if this function
returns successfully. If not, the segfault is certainly somewhere within
this function (only this function is executed at load-time).

Regards,
Dan

Enric Herrero wrote:
> Hi,
> We are having a similar problem as the one that had
> Arrvindh this march. Sudenly when we try to load Ruby
> we get a segmentation fault like that:
>
> simics> run-command-file ../sarek/start.simics
> Turning I-STC off and flushing old data
> Turning D-STC off and flushing old data
> successful installation of the ruby timing model.
> ***  Simics getting shaky, switching to 'safe' mode.
> Simics (main thread) received a segmentation fault.
> Will try to recuperate.
> simics>
>
> And the script we run is the following:
>
> read-configuration
> /localdisk/cmp/chkpt/cold_watersp4p.chkpt
> instruction-fetch-mode instruction-fetch-trace
> istc-disable
> dstc-disable
> load-module ruby
> ruby0.setparam g_NUM_PROCESSORS 4
> ruby0.setparam g_NUM_L2_BANKS 4
> ruby0.setparam g_NUM_MEMORIES 4
> ruby0.setparam g_PROCS_PER_CHIP 4
> ruby0.setparam L1_CACHE_NUM_SETS_BITS 8
> ruby0.setparam L2_CACHE_NUM_SETS_BITS 12
> ruby0.setparam g_DATA_BLOCK_BYTES 32
> ruby0.setparam g_MEMORY_SIZE_BYTES 4294967296 (32
> bits)
> c
>
> The original configuration with the simics script is
> the following:
>
> # set up 4 processors with 512MB
> @boards = {0 : [[0, 4, 2048]]}
> @sarek_disk_size = 4256972800L
> @sarek_files = [["sarek-sol9-install.disk", "ro", 0,
> 4256972800L]]
>
> Also if we check the memory in simics it appears like
> that:
>
> simics> phys_mem0.map
> base               object     fn offs   length
>
> 0x0000000000000000 memory0    0 0x0     0x80000000
> 0x000007fff07ffff0 hfs0       0 0x0     0x10
> simics>
>
> Does anyone know how to solve this problem?
> Thank you very much
>
> /Marco and Enric
>
>
>
>
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
> _______________________________________________
> Gems-users mailing list
> Gems-users@xxxxxxxxxxx
> https://lists.cs.wisc.edu/mailman/listinfo/gems-users
>
_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users

[← Prev in Thread] Current Thread [Next in Thread→]