-
Notifications
You must be signed in to change notification settings - Fork 594
Open
Description
When you allocate an entirely un-used variable in the gpgpu_sim class, you segfault (scroll to end of snippet):
public:
gpgpu_sim(const gpgpu_sim_config &config, gpgpu_context *ctx);
void set_prop(struct cudaDeviceProp *prop);
void launch(kernel_info_t *kinfo);
bool can_start_kernel();
unsigned finished_kernel();
void set_kernel_done(kernel_info_t *kernel);
void stop_all_running_kernels();
void init();
void cycle();
bool active();
bool cycle_insn_cta_max_hit() {
return (m_config.gpu_max_cycle_opt && (gpu_tot_sim_cycle + gpu_sim_cycle) >=
m_config.gpu_max_cycle_opt) ||
(m_config.gpu_max_insn_opt &&
(gpu_tot_sim_insn + gpu_sim_insn) >= m_config.gpu_max_insn_opt) ||
(m_config.gpu_max_cta_opt &&
(gpu_tot_issued_cta >= m_config.gpu_max_cta_opt)) ||
(m_config.gpu_max_completed_cta_opt &&
(gpu_completed_cta >= m_config.gpu_max_completed_cta_opt));
}
void print_stats(unsigned long long streamID);
void update_stats();
void deadlock_check();
void inc_completed_cta() { gpu_completed_cta++; }
void get_pdom_stack_top_info(unsigned sid, unsigned tid, unsigned *pc,
unsigned *rpc);
int shared_mem_size() const;
int shared_mem_per_block() const;
int compute_capability_major() const;
int compute_capability_minor() const;
int num_registers_per_core() const;
int num_registers_per_block() const;
int wrp_size() const;
int shader_clock() const;
int max_cta_per_core() const;
int get_max_cta(const kernel_info_t &k) const;
const struct cudaDeviceProp *get_prop() const;
enum divergence_support_t simd_model() const;
unsigned threads_per_core() const;
bool get_more_cta_left() const;
bool kernel_more_cta_left(kernel_info_t *kernel) const;
bool hit_max_cta_count() const;
kernel_info_t *select_kernel();
PowerscalingCoefficients *get_scaling_coeffs();
void decrement_kernel_latency();
const gpgpu_sim_config &get_config() const { return m_config; }
void gpu_print_stat(unsigned long long streamID);
void dump_pipeline(int mask, int s, int m) const;
void perf_memcpy_to_gpu(size_t dst_start_addr, size_t count);
// The next three functions added to be used by the functional simulation
// function
//! Get shader core configuration
/*!
* Returning the configuration of the shader core, used by the functional
* simulation only so far
*/
const shader_core_config *getShaderCoreConfig();
//! Get shader core Memory Configuration
/*!
* Returning the memory configuration of the shader core, used by the
* functional simulation only so far
*/
const memory_config *getMemoryConfig();
//! Get shader core SIMT cluster
/*!
* Returning the cluster of of the shader core, used by the functional
* simulation so far
*/
simt_core_cluster *getSIMTCluster();
void hit_watchpoint(unsigned watchpoint_num, ptx_thread_info *thd,
const ptx_instruction *pI);
/**
* @brief Check if we are in SST mode
*
* @return true
* @return false
*/
bool is_SST_mode() { return m_config.is_SST_mode(); }
// backward pointer
class gpgpu_context *gpgpu_ctx;
protected:
// clocks
void reinit_clock_domains(void);
int next_clock_domain(void);
void issue_block2core();
void print_dram_stats(FILE *fout) const;
void shader_print_runtime_stat(FILE *fout);
void shader_print_l1_miss_stat(FILE *fout) const;
void shader_print_cache_stats(FILE *fout) const;
void shader_print_scheduler_stat(FILE *fout, bool print_dynamic_info) const;
void visualizer_printstat();
void print_shader_cycle_distro(FILE *fout) const;
void gpgpu_debug();
protected:
///// data /////
class simt_core_cluster **m_cluster;
class memory_partition_unit **m_memory_partition_unit;
class memory_sub_partition **m_memory_sub_partition;
std::vector<kernel_info_t *> m_running_kernels;
unsigned m_last_issued_kernel;
std::list<unsigned> m_finished_kernel;
// m_total_cta_launched == per-kernel count. gpu_tot_issued_cta == global
// count.
unsigned long long m_total_cta_launched;
unsigned long long gpu_tot_issued_cta;
unsigned gpu_completed_cta;
unsigned m_last_cluster_issue;
float *average_pipeline_duty_cycle;
float *active_sms;
// time of next rising edge
double core_time;
double icnt_time;
double dram_time;
double l2_time;
// debug
bool gpu_deadlock;
//// configuration parameters ////
const gpgpu_sim_config &m_config;
const struct cudaDeviceProp *m_cuda_properties;
const shader_core_config *m_shader_config;
const memory_config *m_memory_config;
volatile long test; <------------------------------------------------ TRIGGERS SEG FAULT!
There seems to be some wicked memory unsafety going on that I havent been able to debug. A sanitizer returns:
make: Leaving directory '/root/Repos/shared/accel-sim-framework/gpu-simulator'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==16206==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7fb572714cf1 bp 0x50c000010780 sp 0x7ffd5d3c24b0 T0)
==16206==The signal is caused by a READ memory access.
==16206==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#0 0x7fb572714cf1 in shader_core_ctx::cycle() /root/Repos/shared/accel-sim-framework/gpu-simulator/gpgpu-sim/src/gpgpu-sim/shader.cc:3675
#1 0x7fb572714d8f in simt_core_cluster::core_cycle() /root/Repos/shared/accel-sim-framework/gpu-simulator/gpgpu-sim/src/gpgpu-sim/shader.cc:4488
#2 0x7fb5726d893e in gpgpu_sim::cycle() /root/Repos/shared/accel-sim-framework/gpu-simulator/gpgpu-sim/src/gpgpu-sim/gpu-sim.cc:2162
#3 0x5586e70567b8 in accel_sim_framework::simulate() /root/Repos/shared/accel-sim-framework/gpu-simulator/accel-sim.cc:155
#4 0x5586e705c450 in accel_sim_framework::simulation_loop() /root/Repos/shared/accel-sim-framework/gpu-simulator/accel-sim.cc:70
#5 0x5586e7041ca5 in main /root/Repos/shared/accel-sim-framework/gpu-simulator/main.cc:30
#6 0x7fb571f751c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#7 0x7fb571f7528a in __libc_start_main_impl ../csu/libc-start.c:360
#8 0x5586e7041e24 in _start (/root/Repos/shared/accel-sim-framework/gpu-simulator/bin/release/accel-sim.out+0x15e24) (BuildId: bffc46e66423e9a3b4ca09de113e67029c0087da)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /root/Repos/shared/accel-sim-framework/gpu-simulator/gpgpu-sim/src/gpgpu-sim/shader.cc:3675 in shader_core_ctx::cycle()
==16206==ABORTING
Metadata
Metadata
Assignees
Labels
No labels