You are not logged in.

#1 2015-09-24 01:46:16

Palmitoxico
Member
From: Brazil
Registered: 2015-09-24
Posts: 17

Emacs Segmentation Fault

Hello Arch users!

Recently I've using Emacs for editing some Latex documents and I've tried to open to open the resulting pdfs with docview, but I always get a segmentation fault when I try to open any pdf. Here is the backtrace:

Fatal error 11: Segmentation fault
Backtrace:
emacs[0x5032b3]
emacs[0x4e99be]
emacs[0x50206e]
emacs[0x502293]
/usr/lib/libpthread.so.0(+0x10d60)[0x7f31c1a92d60]
/usr/lib/libLLVM-3.6.so(_ZN4llvm14finalizeBundleERNS_17MachineBasicBlockENS_14ilist_iteratorINS_12MachineInstrEEES4_+0x8d)[0x7f31a42d3a9d]
/usr/lib/libLLVM-3.6.so(_ZN4llvm18VLIWPacketizerList9endPacketEPNS_17MachineBasicBlockEPNS_12MachineInstrE+0x20)[0x7f31a42256b0]
/usr/lib/libLLVM-3.6.so(+0xf45602)[0x7f31a4767602]
/usr/lib/libLLVM-3.6.so(_ZN4llvm18VLIWPacketizerList12PacketizeMIsEPNS_17MachineBasicBlockENS1_15bundle_iteratorINS_12MachineInstrENS_14ilist_iteratorIS4_EEEES7_+0x581)[0x7f31a42260d1]
/usr/lib/libLLVM-3.6.so(+0xf44dd8)[0x7f31a4766dd8]
/usr/lib/libLLVM-3.6.so(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x1e7)[0x7f31a3eb9bb7]
/usr/lib/libLLVM-3.6.so(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x2b)[0x7f31a3eb9e0b]
/usr/lib/libLLVM-3.6.so(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x301)[0x7f31a3eb9811]
/usr/lib/libLLVM-3.6.so(+0xc611fd)[0x7f31a44831fd]
/usr/lib/libLLVM-3.6.so(LLVMTargetMachineEmitToMemoryBuffer+0x171)[0x7f31a44833e1]
/usr/lib/libMesaOpenCL.so.1(+0x1b8fc4)[0x7f31a5d76fc4]
/usr/lib/libMesaOpenCL.so.1(+0x1bce37)[0x7f31a5d7ae37]
/usr/lib/libMesaOpenCL.so.1(+0x1b3ca2)[0x7f31a5d71ca2]
/usr/lib/libMesaOpenCL.so.1(+0x193fb8)[0x7f31a5d51fb8]
/usr/lib/libOpenCL.so(clBuildProgram+0x4f)[0x7f31a6bfbfdf]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(+0x14b5c0)[0x7f31c3cd25c0]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(InitOpenCLEnvInternal+0xcf)[0x7f31c3cd2c9f]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(+0x14bf2f)[0x7f31c3cd2f2f]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(+0x14c93a)[0x7f31c3cd393a]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(InitOpenCLEnv+0x7c)[0x7f31c3cd43ec]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(+0x445c0)[0x7f31c3bcb5c0]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(AccelerateCompositeImage+0x79)[0x7f31c3bda839]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(CompositeImageChannel+0x2aa)[0x7f31c3c1960a]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(MergeImageLayers+0x1e8)[0x7f31c3cb6bc8]
/usr/lib/libMagickWand-6.Q16HDRI.so.2(MagickMergeImageLayers+0x4a)[0x7f31c41016ca]
emacs[0x5cd29c]
emacs[0x5d0b11]
emacs[0x5d0dc0]
emacs[0x55d17d]
emacs[0x5927b3]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cfab]
emacs[0x55e692]
...
Falha de segmentação (imagem do núcleo gravada)

I already updated my machine, can someone confirms if it also happens to you?

Offline

#2 2015-09-28 22:00:58

mike_r
Member
Registered: 2009-01-22
Posts: 114

Re: Emacs Segmentation Fault

No problems here. However, my emacs binary doesn't have any libLLVM references (nor does libpthread.so), and the libLLVM.so on my system is at 3.7. Are you sure you are completely up to date?


Linux User #353 - SLS -> Slackware -> Red Hat -> Mandrake -> Fedora -> Arch

Offline

#3 2015-09-28 23:17:06

Palmitoxico
Member
From: Brazil
Registered: 2015-09-24
Posts: 17

Re: Emacs Segmentation Fault

Thank you for your attention!

I just updated my machine now, and the crash keeps happening, but the backtrace has changed now:

LLVM ERROR: Cannot select: 0x3272e10: i32,ch = AtomicLoadAdd 0x3081c40, 0x308d120, 0x32841c0<Volatile LDST4[%119(addrspace=1)]> [ORD=11] [ID=30]
  0x308d120: i32 = add 0x3274638, 0x32fc760 [ORD=10] [ID=29]
    0x3274638: i32 = add 0x308cff8, 0x326bfd0 [ORD=10] [ID=28]
      0x308cff8: i32,ch = CopyFromReg 0x3081c40, 0x308c7e0 [ORD=10] [ID=17]
        0x308c7e0: i32 = Register %vreg56 [ID=7]
      0x326bfd0: i32 = shl 0x2d8ae18, 0x2f72360 [ORD=10] [ID=27]
        0x2d8ae18: i32 = bitcast 0x3313818 [ORD=9] [ID=26]
          0x3313818: f32 = select_cc 0x33033e8, 0x2871860, 0x2f72800, 0x3283d20, 0x2f725b0 [ORD=9] [ID=25]
            0x33033e8: f32 = select_cc 0x3313b90, 0x308d7f0, 0x30bfad0, 0x2871860, 0x3272f38 [ORD=9] [ID=22]
              0x3313b90: f32 = select_cc 0x325c478, 0x2871860, 0x2870f40, 0x32ff4d0, 0x2f725b0 [ORD=6] [ID=21]
                0x325c478: f32 = select_cc 0x2871190, 0x308d7f0, 0x30bfad0, 0x2871860, 0x2f71b48 [ORD=6] [ID=19]
                  0x2871190: f32,ch = CopyFromReg 0x3081c40, 0x330dd00 [ORD=2] [ID=16]

                  0x308d7f0: f32 = ConstantFP<6.553500e+04> [ID=2]
                  0x30bfad0: f32 = ConstantFP<1.000000e+00> [ID=13]
                  0x2871860: f32 = ConstantFP<0.000000e+00> [ID=4]
                0x2871860: f32 = ConstantFP<0.000000e+00> [ID=4]
                0x2870f40: f32 = fadd 0x2d81828, 0x2f72238 [ORD=5] [ID=20]
                  0x2d81828: f32 = FMAX_LEGACY 0x2871860, 0x2871190 [ORD=4] [ID=18]


                  0x2f72238: f32 = ConstantFP<5.000000e-01> [ID=5]
                0x32ff4d0: f32 = ConstantFP<6.553550e+04> [ID=6]
              0x308d7f0: f32 = ConstantFP<6.553500e+04> [ID=2]
              0x30bfad0: f32 = ConstantFP<1.000000e+00> [ID=13]
              0x2871860: f32 = ConstantFP<0.000000e+00> [ID=4]
            0x2871860: f32 = ConstantFP<0.000000e+00> [ID=4]
            0x2f72800: f32 = bitcast 0x325b8e8 [ORD=9] [ID=24]
              0x325b8e8: i32 = fp_to_uint 0x3313b90 [ORD=8] [ID=23]
                0x3313b90: f32 = select_cc 0x325c478, 0x2871860, 0x2870f40, 0x32ff4d0, 0x2f725b0 [ORD=6] [ID=21]
                  0x325c478: f32 = select_cc 0x2871190, 0x308d7f0, 0x30bfad0, 0x2871860, 0x2f71b48 [ORD=6] [ID=19]




                  0x2871860: f32 = ConstantFP<0.000000e+00> [ID=4]
                  0x2870f40: f32 = fadd 0x2d81828, 0x2f72238 [ORD=5] [ID=20]


                  0x32ff4d0: f32 = ConstantFP<6.553550e+04> [ID=6]
            0x3283d20: f32 = ConstantFP<9.183409e-41> [ID=15]
        0x2f72360: i32 = Constant<4> [ID=8]
    0x32fc760: i32 = Constant<8> [ID=9]
  0x32841c0: i32 = Constant<1> [ID=10]
In function: Histogram

I figured out that emacs uses ghostscript to render the pdf, but when I try to open an pdf directly with ghostscript it works fine.

I also tried to convert the pdf to png images through ghostscript using the same flags that I've found in doc-view.el with no problems:

gs -dSAFER -dNOPAUSE -sDEVICE=png16m -dTextAlphaBits=4 -dBATCH -dGraphicsAlphaBits=4 -r300 -dFirstPage=1 -dLastPage=1 -sOutputFile=test.png -dQUIET Lista01.pdf

One thing that I don't understand is why the crashes occurs in libLLVM, emacs and ghostscript aren't linked with libLLVM.

This crash happened with all pdfs I've tested.

Last edited by Palmitoxico (2015-09-28 23:17:45)

Offline

#4 2015-09-29 16:01:05

mike_r
Member
Registered: 2009-01-22
Posts: 114

Re: Emacs Segmentation Fault

I'm quickly getting out of my depth here, but could there be some weird interaction with your graphics driver? I did a quick "pacman -Qi" on the llvm-libs package on my machine, and the only thing that requires llvm-libs is mesa which in turn is required by various graphics and/or window manager packages. Emacs might interact with mesa indirectly; I also note that there were calls to imagemagick in your first stack trace.

I'm sorry I don't have specific recommendations to try, but you might have a look at your dependency chain to see if there is anything funny there. (What requires your llvm-libs?) Also, do you have any software you compiled yourself that might interfere with one of the system libraries?

Edit: I note there has been a fair amount of chatter with llvm-libs in the last day or two. You might try a new update from today (just a package level change from -3 to -4), and if that doesn't do anything, try rolling back a bit to see if an older version changes things.

Last edited by mike_r (2015-09-29 17:07:56)


Linux User #353 - SLS -> Slackware -> Red Hat -> Mandrake -> Fedora -> Arch

Offline

#5 2015-09-29 20:37:26

Palmitoxico
Member
From: Brazil
Registered: 2015-09-24
Posts: 17

Re: Emacs Segmentation Fault

Well I've updated to llvm 3.7.0-4 and the problem is gone!

I suspect that ImageMagick was triggering this bug with llvm because it is the only package that uses OpenCL acceleration (and I have an AMD graphics card, xf86-video-ati is not mature yet with OpenCL).

Any way thank you for the help!

Offline

Board footer

Powered by FluxBB