Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marley errors when parsing default COPY_ME.js files #8

Open
jack-y-xu opened this issue Sep 29, 2023 · 0 comments
Open

Marley errors when parsing default COPY_ME.js files #8

jack-y-xu opened this issue Sep 29, 2023 · 0 comments

Comments

@jack-y-xu
Copy link

jack-y-xu commented Sep 29, 2023

When parsing /package_srcs/marley/examples/config/COPY_ME.js

Error:
It outputs:

Seeded random number generator with 123456Created Fermi-Dirac 1000170370νe source with parameters

60 has a tabulated decay scheme in the file Cl.dat

before having a segmentation fault

Expected behavior:
I would expect it to return a marley::Generator object with the configuration as set in the COPY_ME.js file

Minimal working example:

config_file_name = std::string(std::getenv("MARLEY"))+"/examples/config/COPY_ME.js"
fMarleyMessenger = new MarleyMessenger(this); 
marley::JSONConfig config(config_file_name);
marley_generator_= config.create_generator();
std::cout << "Finished creating marley generator\n";

Version:
c80cfb5-dirty

Stacktrace:

sndwrm(65619,0x280887000) malloc: Heap corruption detected, free list is damaged at 0x6000005f6dc0
*** Incorrect guard value: 105553219572816
Process 65619 stopped
* thread #8, stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x0000000100f7cf98 libMARLEY.dylib`std::__1::__shared_count::__release_shared[abi:v15006]() + 56
libMARLEY.dylib`std::__1::__shared_count::__release_shared[abi:v15006]:
->  0x100f7cf98 <+56>: ldr    x8, [x8, #0x10]
    0x100f7cf9c <+60>: blr    x8
    0x100f7cfa0 <+64>: mov    w8, #0x1
    0x100f7cfa4 <+68>: and    w8, w8, #0x1
Target 0: (sndwrm) stopped.

Backtrace:

* thread #9, stop reason = EXC_BAD_ACCESS (code=1, address=0xbeadce37a4a0)
  * frame #0: 0x000000018e744858 libc++.1.dylib`std::__1::__shared_weak_count::__release_weak() + 44
    frame #1: 0x0000000100f7cf50 libMARLEY.dylib`std::__1::__shared_weak_count::__release_shared[abi:v15006]() + 44
    frame #2: 0x0000000100f7cf10 libMARLEY.dylib`std::__1::shared_ptr<std::__1::basic_ostream<char, std::__1::char_traits<char> > >::~shared_ptr[abi:v15006]() + 64
    frame #3: 0x0000000100f7cec0 libMARLEY.dylib`std::__1::shared_ptr<std::__1::basic_ostream<char, std::__1::char_traits<char> > >::~shared_ptr[abi:v15006]() + 28
    frame #4: 0x0000000100f7ce94 libMARLEY.dylib`marley::Logger::OutStream::~OutStream() + 28
    frame #5: 0x0000000100f7cc08 libMARLEY.dylib`marley::Logger::OutStream::~OutStream() + 28
    frame #6: 0x0000000100fdfd10 libMARLEY.dylib`marley::Logger::OutStreamVector& marley::Logger::OutStreamVector::operator<<<char [23]>(char const (&) [23]) + 184
    frame #7: 0x0000000100fd6124 libMARLEY.dylib`marley::Logger::Message&& marley::Logger::Message::operator<<<char [23]>(char const (&) [23]) + 40
    frame #8: 0x0000000101042b68 libMARLEY.dylib`marley::StructureDatabase::load_structure_index() + 536
    frame #9: 0x00000001010423a8 libMARLEY.dylib`marley::StructureDatabase::get_decay_scheme(int) + 232
    frame #10: 0x0000000101035758 libMARLEY.dylib`(anonymous namespace)::set_level_ptrs(std::__1::vector<marley::MatrixElement, std::__1::allocator<marley::MatrixElement> >&, int, int, marley::StructureDatabase&) + 52
    frame #11: 0x000000010103530c libMARLEY.dylib`marley::Reaction::load_from_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, marley::StructureDatabase&) + 2136
    frame #12: 0x0000000100ff357c libMARLEY.dylib`marley::JSONConfig::prepare_reactions(marley::Generator&) const + 860
    frame #13: 0x0000000100fef43c libMARLEY.dylib`marley::JSONConfig::create_generator() const + 560
    frame #14: 0x0000000100028db0 sndwrm`PrimaryGeneratorAction::PrimaryGeneratorAction(this=0x0000000109501800) at PrimaryGeneratorAction.cc:71:29 [opt]


stepping w/ lldb through the create_generator function in marley pinpointed the error to prepare_direction


* thread #8, stop reason = breakpoint 2.1
    frame #0: 0x00000001015f5ffc libMARLEY.dylib`marley::JSONConfig::prepare_direction(marley::Generator&) const
libMARLEY.dylib`marley::JSONConfig::prepare_direction:
->  0x1015f5ffc <+0>:  stp    x20, x19, [sp, #-0x20]!
    0x1015f6000 <+4>:  stp    x29, x30, [sp, #0x10]
    0x1015f6004 <+8>:  add    x29, sp, #0x10
    0x1015f6008 <+12>: sub    x9, sp, #0x300
Target 0: (sndwrm) stopped.
(lldb) continue
Process 78721 resuming
Incident neutrino direction: (0.000000, 0.000000, 1.000000)
=================================================================
==78721==ERROR: AddressSanitizer: container-overflow on address 0x00010b6f7c40 at pc 0x0001015ee97c bp 0x00016ff0f310 sp 0x00016ff0f308
WRITE of size 8 at 0x00010b6f7c40 thread T7
Seeded random number generator with 1696014266373310
PrimaryGenAction: Marley config file is /Users/jackxu/local_code/package_srcs/marley/examples/config/COPY_ME.js
PrimaryGenAction: Unused if nu_e is not specified 
Process 78721 stopped
* thread #7, stop reason = breakpoint 3.1
    frame #0: 0x00000001015f35c4 libMARLEY.dylib`marley::JSONConfig::create_generator() const
libMARLEY.dylib`marley::JSONConfig::create_generator:
->  0x1015f35c4 <+0>:  stp    x20, x19, [sp, #-0x20]!
    0x1015f35c8 <+4>:  stp    x29, x30, [sp, #0x10]
    0x1015f35cc <+8>:  add    x29, sp, #0x10
    0x1015f35d0 <+12>: sub    x9, sp, #0x600
Target 0: (sndwrm) stopped.


Doing image lookup gives

(lldb) image lookup --address 0x0001015ee97c
Address: libMARLEY.dylib[0x00000000001b697c] (libMARLEY.dylib.__TEXT.__text + 1782704)
Summary: libMARLEY.dylib`marley::Integrator::Integrator(unsigned long) + 816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant