lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUB and mpfr/mpc


From: Masamichi HOSODA
Subject: Re: GUB and mpfr/mpc
Date: Wed, 03 Dec 2014 21:37:01 +0900 (JST)

>>>>> I changed mingw.org's mingw-runtime to mingw-64 (32-bit).
>>>>> Then an error didn't occur and correct test.pdf was generated.
>>>>> 
>>>>> https://github.com/trueroad/gub/tree/binutils-2.24
>>>>> 
>>>>> I may pull request if you request it.
>>>>> 
>>>>> Further, even if the runtime is mingw-w64,
>>>>> bad_alloc occurred when optimization was turned on.
>>>>
>>>> For both of bad_alloc prevented and optimization,
>>>> I tried the following setting.
>>>> Only one file (lily/skyline.cc) optimization is disabled
>>>> and all other files optimization is enabled.
>>> 
>>> Do you have a backtrace that might give us some more clue about where
>>> lily/skyline.cc has a problem?
>>> 
>>> I thought that I had at one time proposed something to be changed (as
>>> part of some issue?) order to deal with possible memory corruption, but
>>> a quick look through the log messages does not turn up either a commit
>>> from me or a commit message ringing a bell.
>>
>> I turned off optimization to get correct backtrace,
>> but bad_alloc didn't occur.
>> Therefore I could get only incomplete backtrace.
>>
>> It seems that push_back in Skyline::internal_merge_skyline throws bad_alloc.
>> I think the problem is Skyline::internal_merge_skyline
>> and/or first_intersection.
>>
>> Skyline::internal_merge_skyline has a while loop with push_back.
>> I think that the loop termination condition may break by optimization.
> 
> I need more elements from the backtrace.  The problem most likely is
> that the Skyline is destructed before work with it is finished, and that
> means that somewhere in the call chain the Skyline is not maintained in
> a manner where the Lisp Garbage collector will consider it as still in
> use.
> 
> So internal_merge_skyline is likely only the place where things blow up,
> but the actual cause will be further up in the call chain.

Here is first backtrace.
I stopped lilypond.exe by Ctrl-C
when the memory that lilypond.exe uses was increased rapidly.
I think that it was in the infinite loop.

```
C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin>gdb lilypond.exe
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from lilypond.exe...done.
(gdb) r test.ly
Starting program: C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin\lilypond.exe 
test.ly
[New Thread 7936.0x2234]
GNU LilyPond 2.19.16
Processing `test.ly'
Parsing...
test.ly:1: warning: no \version statement found, please add

\version "2.19.16"

for future compatibility
Interpreting music...
Preprocessing graphical objects...[New Thread 7936.0x256c]

Program received signal SIGINT, Interrupt.
[Switching to Thread 7936.0x256c]
0x76cedbf6 in KERNELBASE!CtrlRoutine ()
   from C:\WINDOWS\SYSTEM32\KernelBase.dll
(gdb) bt
#0  0x76cedbf6 in KERNELBASE!CtrlRoutine ()
   from C:\WINDOWS\SYSTEM32\KernelBase.dll
#1  0x97b0d836 in ?? ()
#2  0x00000000 in ?? ()
(gdb) info thread
  Id   Target Id         Frame
* 2    Thread 7936.0x256c 0x76cedbf6 in KERNELBASE!CtrlRoutine ()
   from C:\WINDOWS\SYSTEM32\KernelBase.dll
  1    Thread 7936.0x2234 0x77138fc0 in ntdll!RtlCompareMemoryUlong ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) thread 1
[Switching to thread 1 (Thread 7936.0x2234)]
#0  0x77138fc0 in ntdll!RtlCompareMemoryUlong ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0  0x77138fc0 in ntdll!RtlCompareMemoryUlong ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x7718f95a in ntdll!RtlFindCharInUnicodeString ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x7714dfb4 in ntdll!RtlAllocateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x771eee08 in ntdll!RtlpNtSetValueKey ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x7718f75a in ntdll!RtlFindCharInUnicodeString ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x7714dfb4 in ntdll!RtlAllocateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x76889ad1 in msvcrt!malloc () from C:\WINDOWS\SYSTEM32\msvcrt.dll
#7  0x6fcbddef in operator new (sz=40)
    at 
/home/gub/gub/target/mingw/src/cross/gcc-4.8.2/libstdc++-v3/libsupc++/new_op.cc:51
#8  0x0060da2d in Skyline::internal_merge_skyline(std::list<Building, 
std::allocator<Building> >*, std::list<Building, std::allocator<Building> >*, 
std::list<Building, std::allocator<Building> >*) const ()
#9  0x00611495 in Skyline::padded(double) const ()
#10 0x005fb306 in Separation_item::calc_skylines(scm_unused_struct*) ()
#11 0x6bf921c0 in scm_dapply ()
   from C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin\libguile-17.dll
#12 0x00000000 in ?? ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 7936] will be killed.

Quit anyway? (y or n) y

C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin>
```





Here is second backtrace.
I didn't stop lilypond.exe by Ctrl-C.

```
C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin>gdb lilypond.exe
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from lilypond.exe...done.
(gdb) r test.ly
Starting program: C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin\lilypond.exe 
test.ly
[New Thread 10480.0x1af0]
GNU LilyPond 2.19.16
Processing `test.ly'
Parsing...
test.ly:1: warning: no \version statement found, please add

\version "2.19.16"

for future compatibility
Interpreting music...
Preprocessing graphical objects...
Program received signal SIGSEGV, Segmentation fault.
0x7714ebcb in ntdll!RtlAllocateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0  0x7714ebcb in ntdll!RtlAllocateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x7714edbe in ntdll!RtlAllocateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x7714ed40 in ntdll!RtlAllocateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x7714dfb4 in ntdll!RtlAllocateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x771eee08 in ntdll!RtlpNtSetValueKey ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x7718f75a in ntdll!RtlFindCharInUnicodeString ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x7714dfb4 in ntdll!RtlAllocateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x7688a915 in wcsstr () from C:\WINDOWS\SYSTEM32\msvcrt.dll
#8  0x7688be6f in msvcrt!calloc () from C:\WINDOWS\SYSTEM32\msvcrt.dll
#9  0x64942f54 in pthread_mutex_init ()
   from C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin\libwinpthread-1.dll
#10 0x64943082 in pthread_mutex_init ()
   from C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin\libwinpthread-1.dll
#11 0x00611495 in Skyline::padded(double) const ()
#12 0x005fb306 in Separation_item::calc_skylines(scm_unused_struct*) ()
#13 0x6bf921c0 in scm_dapply ()
   from C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin\libguile-17.dll
#14 0x00000000 in ?? ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 10480] will be killed.

Quit anyway? (y or n) y

C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin>
```



reply via email to

[Prev in Thread] Current Thread [Next in Thread]