Conditional segmentation faults

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Conditional segmentation faults

David Sumbler
I am running Ubuntu 18.04, Lilypond 2.21.4, emacs 25.2.2

Ever since I started my current Lilypond project, I have been
getting occasional segmentation faults when compiling.  Until today I
thought it was something to do with errors or inconsistencies in my
Lilypond code, and I have been able to make changes which appeared to
solve the problem.

However, today I discovered something very odd.

I edit my files in emacs, and I compile the main file by using Ctrl_C
Ctrl_L in emacs, which issues the command 'lilypond <filename>'.  Since
earlier today, whenever I do this, the compile fails with a
segmentation fault.  Sometimes commenting out one or more instruments
in the score allows the incomplete score to compile, but there seems to
be no rhyme or reason as to which combinations of instruments allow
compilation to take place successfully.

As a result, I have spent several hours today trying to work out why
this crash has started occurring again.

But now I find that if I issue the command 'lilypond <filename>'
directly from a GNOME terminal, the file compiles faultlessly.  Yet
even if I issue 'lilypond <filename>' as a shell command within emacs
(rather than using Ctrl_C Ctrl_L) I again get a segmentation fault
reported.

I have tried rebooting the computer and then running emacs without
starting any other programs at the same time, but I still get the same
result.

As I don't really understand what "segmentation fault" actually
implies, can anybody suggest why this apparently inconsistent behaviour
might be occurring?

David



Reply | Threaded
Open this post in threaded view
|

Re: Conditional segmentation faults

Kevin Barry
Hi David,

That certainly is strange behaviour. A segmentation fault occurs when
a program tries to access a segment of memory that it isn't allowed
to. It's usually the result of memory bugs in the program. If it's a
bug in emacs, which looks possible, then I am not sure what you will
be able to do. Generally speaking, if a program segfaults then that is
always a bug in that program, but it's often the result of invalid
input, so sometimes you can at least narrow down the behaviour that is
triggering it. You could try starting emacs with the "-q" option so
that it doesn't load your init file. Then try running the shell
command from within emacs to see if it still segfaults (ctrl_C ctrl_L
won't work with no init loaded). If it doesn't that might tell you
something. Also check if you have multiple versions of LilyPond
installed - maybe emacs is running a different one? I'm sorry I can't
be of more help.

Kevin

On Fri, 28 Aug 2020 at 20:04, David Sumbler <[hidden email]> wrote:

>
> I am running Ubuntu 18.04, Lilypond 2.21.4, emacs 25.2.2
>
> Ever since I started my current Lilypond project, I have been
> getting occasional segmentation faults when compiling.  Until today I
> thought it was something to do with errors or inconsistencies in my
> Lilypond code, and I have been able to make changes which appeared to
> solve the problem.
>
> However, today I discovered something very odd.
>
> I edit my files in emacs, and I compile the main file by using Ctrl_C
> Ctrl_L in emacs, which issues the command 'lilypond <filename>'.  Since
> earlier today, whenever I do this, the compile fails with a
> segmentation fault.  Sometimes commenting out one or more instruments
> in the score allows the incomplete score to compile, but there seems to
> be no rhyme or reason as to which combinations of instruments allow
> compilation to take place successfully.
>
> As a result, I have spent several hours today trying to work out why
> this crash has started occurring again.
>
> But now I find that if I issue the command 'lilypond <filename>'
> directly from a GNOME terminal, the file compiles faultlessly.  Yet
> even if I issue 'lilypond <filename>' as a shell command within emacs
> (rather than using Ctrl_C Ctrl_L) I again get a segmentation fault
> reported.
>
> I have tried rebooting the computer and then running emacs without
> starting any other programs at the same time, but I still get the same
> result.
>
> As I don't really understand what "segmentation fault" actually
> implies, can anybody suggest why this apparently inconsistent behaviour
> might be occurring?
>
> David
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Conditional segmentation faults

Paul Scott
I was also getting occasional seg. faults with 21.1.4.  I would add a little more to the code and they would go away.  Since I was able to finish that project I didn’t worry about it and it certainly worth the trouble to try too create a MWE.  I also use Emacs but I just alt-tab to another shell to compile.  (Also alt-tab to look at the results.)

Paul


> On Aug 28, 2020, at 2:39 PM, Kevin Barry <[hidden email]> wrote:
>
> Hi David,
>
> That certainly is strange behaviour. A segmentation fault occurs when
> a program tries to access a segment of memory that it isn't allowed
> to. It's usually the result of memory bugs in the program. If it's a
> bug in emacs, which looks possible, then I am not sure what you will
> be able to do. Generally speaking, if a program segfaults then that is
> always a bug in that program, but it's often the result of invalid
> input, so sometimes you can at least narrow down the behaviour that is
> triggering it. You could try starting emacs with the "-q" option so
> that it doesn't load your init file. Then try running the shell
> command from within emacs to see if it still segfaults (ctrl_C ctrl_L
> won't work with no init loaded). If it doesn't that might tell you
> something. Also check if you have multiple versions of LilyPond
> installed - maybe emacs is running a different one? I'm sorry I can't
> be of more help.
>
> Kevin
>
> On Fri, 28 Aug 2020 at 20:04, David Sumbler <[hidden email]> wrote:
>>
>> I am running Ubuntu 18.04, Lilypond 2.21.4, emacs 25.2.2
>>
>> Ever since I started my current Lilypond project, I have been
>> getting occasional segmentation faults when compiling.  Until today I
>> thought it was something to do with errors or inconsistencies in my
>> Lilypond code, and I have been able to make changes which appeared to
>> solve the problem.
>>
>> However, today I discovered something very odd.
>>
>> I edit my files in emacs, and I compile the main file by using Ctrl_C
>> Ctrl_L in emacs, which issues the command 'lilypond <filename>'.  Since
>> earlier today, whenever I do this, the compile fails with a
>> segmentation fault.  Sometimes commenting out one or more instruments
>> in the score allows the incomplete score to compile, but there seems to
>> be no rhyme or reason as to which combinations of instruments allow
>> compilation to take place successfully.
>>
>> As a result, I have spent several hours today trying to work out why
>> this crash has started occurring again.
>>
>> But now I find that if I issue the command 'lilypond <filename>'
>> directly from a GNOME terminal, the file compiles faultlessly.  Yet
>> even if I issue 'lilypond <filename>' as a shell command within emacs
>> (rather than using Ctrl_C Ctrl_L) I again get a segmentation fault
>> reported.
>>
>> I have tried rebooting the computer and then running emacs without
>> starting any other programs at the same time, but I still get the same
>> result.
>>
>> As I don't really understand what "segmentation fault" actually
>> implies, can anybody suggest why this apparently inconsistent behaviour
>> might be occurring?
>>
>> David
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Conditional segmentation faults

David Sumbler
Thank you for these responses.  Before I received them, I had already
done a little more work on my score.  After all, I knew that I could
work around the seg. fault problem by issuing the lilypond command in a
terminal, rather than from within emacs.

So I reinstated the viola line, which was previously temporarily
excluded, and added a few more bars of music to it.  Almost inevitably
I forgot to use the terminal to compile, and did my usual Ctrl-C
Ctrl-L.

I immediately realized my mistake, but let the process continue.  The
file compiled without any problem!  So it now seems that this
intermittent fault can be cured by adding, as well as by removing
material in the code.  How crazy is that?

My next line of attack was in any case going to be installing Lilypond
21.2.5, and Paul's mention of the fact that he had had similar problems
to mine with 21.2.4 suggested that this might well be a solution.
Today I changed to 21.2.5, and so far I haven't had any more seg.
faults.  Time will tell whether the problem has actually gone away
completely.

David

On Fri, 2020-08-28 at 14:56 -0700, Paul Scott wrote:

> I was also getting occasional seg. faults with 21.1.4.  I would add a
> little more to the code and they would go away.  Since I was able to
> finish that project I didn’t worry about it and it certainly worth
> the trouble to try too create a MWE.  I also use Emacs but I just
> alt-tab to another shell to compile.  (Also alt-tab to look at the
> results.)
>
> Paul
>
>
> > On Aug 28, 2020, at 2:39 PM, Kevin Barry <[hidden email]> wrote:
> >
> > Hi David,
> >
> > That certainly is strange behaviour. A segmentation fault occurs
> > when
> > a program tries to access a segment of memory that it isn't allowed
> > to. It's usually the result of memory bugs in the program. If it's
> > a
> > bug in emacs, which looks possible, then I am not sure what you
> > will
> > be able to do. Generally speaking, if a program segfaults then that
> > is
> > always a bug in that program, but it's often the result of invalid
> > input, so sometimes you can at least narrow down the behaviour that
> > is
> > triggering it. You could try starting emacs with the "-q" option so
> > that it doesn't load your init file. Then try running the shell
> > command from within emacs to see if it still segfaults (ctrl_C
> > ctrl_L
> > won't work with no init loaded). If it doesn't that might tell you
> > something. Also check if you have multiple versions of LilyPond
> > installed - maybe emacs is running a different one? I'm sorry I
> > can't
> > be of more help.
> >
> > Kevin
> >
> > On Fri, 28 Aug 2020 at 20:04, David Sumbler <[hidden email]>
> > wrote:
> > >
> > > I am running Ubuntu 18.04, Lilypond 2.21.4, emacs 25.2.2
> > >
> > > Ever since I started my current Lilypond project, I have been
> > > getting occasional segmentation faults when compiling.  Until
> > > today I
> > > thought it was something to do with errors or inconsistencies in
> > > my
> > > Lilypond code, and I have been able to make changes which
> > > appeared to
> > > solve the problem.
> > >
> > > However, today I discovered something very odd.
> > >
> > > I edit my files in emacs, and I compile the main file by using
> > > Ctrl_C
> > > Ctrl_L in emacs, which issues the command 'lilypond
> > > <filename>'.  Since
> > > earlier today, whenever I do this, the compile fails with a
> > > segmentation fault.  Sometimes commenting out one or more
> > > instruments
> > > in the score allows the incomplete score to compile, but there
> > > seems to
> > > be no rhyme or reason as to which combinations of instruments
> > > allow
> > > compilation to take place successfully.
> > >
> > > As a result, I have spent several hours today trying to work out
> > > why
> > > this crash has started occurring again.
> > >
> > > But now I find that if I issue the command 'lilypond <filename>'
> > > directly from a GNOME terminal, the file compiles
> > > faultlessly.  Yet
> > > even if I issue 'lilypond <filename>' as a shell command within
> > > emacs
> > > (rather than using Ctrl_C Ctrl_L) I again get a segmentation
> > > fault
> > > reported.
> > >
> > > I have tried rebooting the computer and then running emacs
> > > without
> > > starting any other programs at the same time, but I still get the
> > > same
> > > result.
> > >
> > > As I don't really understand what "segmentation fault" actually
> > > implies, can anybody suggest why this apparently inconsistent
> > > behaviour
> > > might be occurring?
> > >
> > > David
> > >
> > >
> > >
>
>
>