Hi, today I was continuing my project made in Crystal.
After I fixed an error in my code, I had this bug.
I think it can be interesting for the crystal developers, because this output can’t found the problem:
This the related portion code I fixed:
def writeSettingsFile
settings = Settings.new(@rootPath,
@systemName,
@targetName,
@architecture,
@target,
@makeOptions,
@buildOptions,
@installByChroot,
@chrootSystemName,
@chrootTargetName,
@chrootArchitecture,
@chrootTarget,
@chrootMakeOptions,
@chrootBuildOptions)
file = File.open("/"+ISM::Default::CommandLineSettings::SettingsFilePath,"w")
settings.to_json(file)
file.close
if Ism.settings.rootPath != "/"
chrootFile = File.open(Ism.settings.rootPath+ISM::Default::CommandLineSettings::SettingsFilePath,"w")
chrootSettings = Settings.new( ISM::Default::CommandLineSettings::RootPath,
@chrootSystemName,
@chrootTargetName,
@chrootArchitecture,
@chrootTarget,
@chrootMakeOptions,
@chrootBuildOptions,
ISM::Default::CommandLineSettings::InstallByChroot,
ISM::Default::CommandLineSettings::SystemName,
ISM::Default::CommandLineSettings::TargetName,
ISM::Default::CommandLineSettings::Architecture,
ISM::Default::CommandLineSettings::Target,
ISM::Default::CommandLineSettings::MakeOptions,
ISM::Default::CommandLineSettings::BuildOptions)
chrootSettings.to_json(chrootFile)
chrootFile.close
end
end
The error I had before I fixed it:
zohran@alienware-m17-r3 ~/Documents/Programmation/ISM $ crystal build Main.cr -o ism
Showing last frame. Use --error-trace for full trace.
In ISM/CommandLineSettings.cr:90:43
90 | chrootSettings = Settings.new
^--
Error: wrong number of arguments for 'ISM::CommandLineSettings::Settings.new' (given 0, expected 1, 14)
Overloads are:
- ISM::CommandLineSettings::Settings.new(rootPath : String, systemName : String, targetName : String, architecture : String, target : String, makeOptions : String, buildOptions : String, installByChroot : Bool, chrootSystemName : String, chrootTargetName : String, chrootArchitecture : String, chrootTarget : String, chrootMakeOptions : String, chrootBuildOptions : String)
- ISM::CommandLineSettings::Settings.new(pull : ::JSON::PullParser)
After I fixed it (I didn’t put all of the log, it’s too long):
zohran@alienware-m17-r3 ~/Documents/Programmation/ISM $
crystal build Main.cr -o ism
Stack overflow (e.g., infinite or very deep recursion)
[0x562c0896ecf6] ?? +94747122658550 in crystal
[0x562c0896ec84] ?? +94747122658436 in crystal
[0x7f268bcc8a90] ?? +139803530922640 in /lib64/libc.so.6
[0x562c0855d875] ?? +94747118393461 in crystal
[0x562c0854e556] ?? +94747118331222 in crystal
[0x562c0854e29f] ?? +94747118330527 in crystal
[0x562c0854e48e] ?? +94747118331022 in crystal
[0x562c0855d170] ?? +94747118391664 in crystal
[0x562c0854e556] ?? +94747118331222 in crystal
[0x562c0854e29f] ?? +94747118330527 in crystal
[0x562c0854e48e] ?? +94747118331022 in crystal
[0x562c0855d170] ?? +94747118391664 in crystal
[0x562c0854e556] ?? +94747118331222 in crystal
[0x562c0854e29f] ?? +94747118330527 in crystal
[0x562c0854e48e] ?? +94747118331022 in crystal
[0x562c0855d170] ?? +94747118391664 in crystal