Re: [Gems-users] Segmentation Fault


Date: Tue, 16 May 2006 15:36:44 +0200 (CEST)
From: Enric Herrero <enricherrero@xxxxxxxx>
Subject: Re: [Gems-users] Segmentation Fault
In fact we were using the magic-break-enable but we
forgot to put it in the mail :P
We had the problem that the MAGIC_BREAKPOINT didn't
stop the simulation so we couldn't execute the next
instructions in the script. At the end we solved that
adding this hap handler:

@def hap_callback(user_arg, cpu, arg): 
        SIM_break_simulation("MAGIC Breakpoint")
@SIM_hap_add_callback("Core_Magic_Instruction",
hap_callback, None)


Thank you anyway for your help. 

/Enric and Marco

 --- Dan Gibson <degibson@xxxxxxxx> escribió:

> Add the following to your script, right after
> dstc-disable:
> 
> magic-break-enable
> 
> Regards,
> Dan
> 
> PS:
> We also load ruby in the middle of execution...but
> we don't install 
> python hap callbacks (for simplicity). Our scripts
> look something like this:
> read-configuration [config]
> cpu-switch-time 1
> c 1000
> instruction-fetch-mode instruction-fetch-trace
> istc-disable
> dstc-disable
> magic-break-enable
> c # Eventually, we hit our magic breakpoint
> load-module ruby
> ruby0.setparam...
> ruby0.init
> c # Eventually, we hit another magic breakpoint (the
> one to stop the sim)
> ruby0.dump-stats
> q
> 
> 
> Marco Tirado wrote:
> > 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 
> > <mailto: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
> 
=== message truncated ===



		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com
[← Prev in Thread] Current Thread [Next in Thread→]