Bizarre bus error in Macintalk after 10.5.2 update

Here's an odd one... after the 10.5.2 update, both Skype and Elgato EyeTV software fail at startup. EyeTV bounces a bit and then vanishes... Skype starts, loads my contact list, then vanishes. Both failures produce a message in the console log indicating a bus error triggered by, of all things, the Macintalk speech synthesizer. Complete removal and reinstallation of either EyeTV or Skype won't correct the problem... still fails in precisely the same manner.
I wasn't even aware that MacInTalk had any connection to either piece of software.
So, here's the question: any way to remove and replace MacInTalk code without completely blowing away the machine (it'd have to be back to 10.5.0 off the DVD) and reinstalling from scratch, all for the sake of some code I don't even want or need?

Finally did a cold reinstall and the problem went away. Still no clue about the cause.

Similar Messages

  • Blue screen error Windows 7 after June 2014 Windows updates

    Hi,
    just wondering if someone could help determine the cause of a blue screen error from interpreting the following minidump file. My PC has been having blue screen problems after getting the automatic windows updates recently. Initially the only way I could
    get the computer working was to restore the system back to prior to the updates. The updates seem to have now successfully installed but are still causing occasional blue screen errors. I have Windows 7 Home Premium
    The minidump is 061614-32666-01 andthe  link is as follows:
    https://onedrive.live.com/redir?resid=1665B282DEF2D2DC%21111
    Any help would be appreciated

    Hi,
    just wondering if someone could help determine the cause of a blue screen error from interpreting the following minidump file. My PC has been having blue screen problems after getting the automatic windows updates recently. Initially the only way I could
    get the computer working was to restore the system back to prior to the updates. The updates seem to have now successfully installed but are still causing occasional blue screen errors. I have Windows 7 Home Premium
    The minidump is 061614-32666-01 andthe  link is as follows:
    https://onedrive.live.com/redir?resid=1665B282DEF2D2DC%21111
    Any help would be appreciated
    These crashes were related to memory corruption (probably caused by a driver). 
    Please run these tests to verify your memory and find which driver is causing the problem.  
    If you are overclocking (pushing the components beyond their design) you should revert to default at least until the crashing is solved. If you don't
    know what it is you probably are not overclocking.
    Since it is more likely to be a driver please run verifier first.
    1-Driver verifier (for complete directions see our wiki here)
    If verifier does not find the issue we can move on to this.
    2-Memtest. (You can read more about running memtest here)
    If you cannot boot after enabling verifier reboot into safe mode
    In Vista & win & (F8)
    In win 8 http://www.howtogeek.com/107511/how-to-boot-into-safe-mode-on-windows-8-the-easy-way/
    Co-Authored by  JMH3143
    Wanikiya and Dyami--Team Zigzag

  • WOL error in ZCC after 10.2.2 update

    After updating our server to 10.2.2 I now get the following error when
    trying to wake up workstations in ZCC:
    Error: Failed to Wake up device: Failed to wakeup devices
    See the ZENworks Control Center log file (zcc.log) for the full stack trace.
    Server is Windows 2003 using the built in database. I didn't see any errors
    in the logs after the server update but I will go back through them in the
    morning and make sure.
    Jim Koerner
    ZCC.log of the error
    16 Dec 2009 22:30:06
    Exception Info:
    16 Dec 2009 22:30:06 Class....... javax.servlet.jsp.JspException
    16 Dec 2009 22:30:06 Message..... Invalid view state
    16 Dec 2009 22:30:06 Logged at... Page................545
    16 Dec 2009 22:30:06 ============== Exception (end)
    =============================
    16 Dec 2009 23:00:16 RemoteControlDial..1111 :OnLoad(): Remote Management
    XML blob:<RMProxyData />
    16 Dec 2009 23:00:16 RemoteControlDial..1049 :Entered the function
    addDropdownListElements
    16 Dec 2009 23:00:16 RemoteControlDialo..403 :initialize controls called
    16 Dec 2009 23:05:54 MessageUtil..........99 :Note: Your username or
    password is incorrect, please check spelling and try again
    16 Dec 2009 23:07:22 BaseDeviceList......344 :Inside WOL menuitemclick
    selected devices ed13cc2b12c67dc98c44f3d74e09b20cWorkstation Folder
    16 Dec 2009 23:07:31 WakeOnLanOptionsDi..516 :BroadcastAddressList:[]
    ServersList :[] Retry :1 Timeout :2
    16 Dec 2009 23:07:31 WakeOnLanUtil........42 :Failed to wake up
    devicecom.novell.zenworks.wol.WOLException: Failed to wakeup devices
    16 Dec 2009 23:07:31 MessageUtil..........85 :Error: Failed to Wake up
    device
    16 Dec 2009 23:07:31 ============== Exception (begin)
    ===========================
    16 Dec 2009 23:07:31 Exception occured
    com.novell.zenworks.wol.WOLException: Failed to wakeup devices
    at
    com.novell.zenworks.wol.WakeOnLanDirectImpl.insert WOLActionToQueue(WakeOnLanDirectImpl.java:194)
    at
    com.novell.zenworks.wol.WakeOnLanDirectImpl.addWOL ActionToQueue(WakeOnLanDirectImpl.java:110)
    at
    com.novell.zenworks.admin.pages.devices.wakeOnLan. WakeOnLanUtil.wakeUpDevices(WakeOnLanUtil.java:30)
    at
    com.novell.zenworks.admin.pages.devices.wakeOnLan. WakeOnLanOptionsDialog.wolOkButton_click(WakeOnLan OptionsDialog.java:518)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.novell.web.controls.WebControl.fireEvent(WebCo ntrol.java:1977)
    at com.novell.web.controls.WebControl.fireEvent(WebCo ntrol.java:1952)
    at com.novell.web.controls.Button.raisePostBackEvent( Button.java:475)
    at com.novell.web.controls.Page.raisePostBackEvent(Pa ge.java:885)
    at com.novell.web.controls.Page.raisePostBackEvents(P age.java:872)
    at com.novell.web.controls.Page.internalProcessReques t(Page.java:584)
    at com.novell.web.controls.Page.processRequest(Page.j ava:528)
    at
    com.novell.zenworks.fw.web.internal.layout.Index.p rocessRequest(Index.java:518)
    at com.novell.web.internal.controls.PageTag.doEndTag( PageTag.java:86)
    at org.apache.jsp.jsp.index_jsp._jspService(index_jsp .java:179)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at
    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at
    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at
    org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:691)
    at
    org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:469)
    at
    org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:364)
    at
    org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:301)
    at com.novell.web.NJWCServlet.serviceImpl(NJWCServlet .java:97)
    at
    com.novell.zenworks.fw.web.internal.ZENworksServle t.service(ZENworksServlet.java:84)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at
    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at
    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at
    com.patchlink.sapphire.web.pages.vulnerability.ses sion.HibernateSessionFilter.doFilter(HibernateSess ionFilter.java:75)
    at
    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:215)
    at
    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at
    org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:210)
    at
    org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:174)
    at
    org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:525)
    at
    org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
    at
    org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:108)
    at
    com.novell.zenworks.tomcat.ZENRequestValve.invoke( ZENRequestValve.java:1122)
    at
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:151)
    at
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:870)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
    at
    org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
    at
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Thread.java:595)
    Caused by:
    com.novell.zenworks.datamodel.exceptions.InternalD ataModelException:
    org.hibernate.exception.GenericJDBCException: could not execute query
    at
    com.novell.zenworks.datamodel.database.AbstractDat abaseTypeHelper.newStandardDataModelException(Abst ractDatabaseTypeHelper.java:436)
    at
    com.novell.zenworks.datamodel.database.sqlanywhere .SQLAnywhereHelper.newStandardDataModelException(S QLAnywhereHelper.java:282)
    at
    com.novell.zenworks.datamodel.database.AbstractDat abaseTypeHelper.throwStandardDataModelException(Ab stractDatabaseTypeHelper.java:421)
    at
    com.novell.zenworks.datamodel.session.hibernate.Ab stractHibernateSessionImpl.handleException(Abstrac tHibernateSessionImpl.java:177)
    at
    com.novell.zenworks.datamodel.session.hibernate.Ab stractHibernateSessionImpl.simpleQueryCount(Abstra ctHibernateSessionImpl.java:467)
    at
    com.novell.zenworks.datamodel.services.queue.Queue AdminImpl.addIfNotPending(QueueAdminImpl.java:380)
    at
    com.novell.zenworks.wol.WakeOnLanDirectImpl.insert WOLActionToQueue(WakeOnLanDirectImpl.java:189)
    ... 51 more
    Caused by: org.hibernate.exception.GenericJDBCException: could not execute
    query
    at
    org.hibernate.exception.SQLStateConverter.handledN onSpecificException(SQLStateConverter.java:103)
    at
    org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:91)
    at
    org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
    at org.hibernate.loader.Loader.doList(Loader.java:214 8)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(L oader.java:2029)
    at org.hibernate.loader.Loader.list(Loader.java:2024)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoa der.java:392)
    at
    org.hibernate.hql.ast.QueryTranslatorImpl.list(Que ryTranslatorImpl.java:333)
    at
    org.hibernate.engine.query.HQLQueryPlan.performLis t(HQLQueryPlan.java:172)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.ja va:1109)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:7 9)
    at
    org.hibernate.impl.AbstractQueryImpl.uniqueResult( AbstractQueryImpl.java:756)
    at
    com.novell.zenworks.datamodel.session.hibernate.Ab stractHibernateSessionImpl.simpleQueryCount(Abstra ctHibernateSessionImpl.java:459)
    ... 53 more
    Caused by: java.sql.SQLException: [Sybase][ODBC Driver][SQL Anywhere]The
    pattern is too long
    at ianywhere.ml.jdbcodbc.IIPreparedStatement.executeQ uery(Native Method)
    at
    ianywhere.ml.jdbcodbc.IPreparedStatement.executeQu ery(IPreparedStatement.java:201)
    at
    com.mchange.v2.c3p0.impl.NewProxyPreparedStatement .executeQuery(NewProxyPreparedStatement.java:76)
    at
    org.hibernate.jdbc.AbstractBatcher.getResultSet(Ab stractBatcher.java:186)
    at org.hibernate.loader.Loader.getResultSet(Loader.ja va:1669)
    at org.hibernate.loader.Loader.doQuery(Loader.java:66 2)
    at
    org.hibernate.loader.Loader.doQueryAndInitializeNo nLazyCollections(Loader.java:224)
    at org.hibernate.loader.Loader.doList(Loader.java:214 5)
    ... 62 more
    16 Dec 2009 23:07:31
    Exception Info:
    16 Dec 2009 23:07:31 Class....... com.novell.zenworks.wol.WOLException
    16 Dec 2009 23:07:31 Message..... Failed to wakeup devices
    16 Dec 2009 23:07:31 Logged at... Messages............313
    16 Dec 2009 23:07:31 ============== Exception (end)
    ===========================

    Thanks!
    Craig Wilson - MCNE, MCSE, CCNA
    Novell Knowledge Partner
    Novell does not officially monitor these forums.
    Suggestions/Opinions/Statements made by me are solely my own.
    These thoughts may not be shared by either Novell or any rational human.
    "Jim Koerner" <[email protected]> wrote in message
    news:EaMXm.510$[email protected]..
    >I have a SR in process since last Thursday. All my logs and a Zeninfo has
    >been uploaded for SR 10583214311.
    >
    > Jim Koerner
    >
    > "Craig Wilson" <[email protected]> wrote in message
    > news:OSLXm.505$[email protected]..
    >> I would recommend someone in this thread open an SR and then Email me at
    >> [email protected] with the SR#.
    >> I will try and get it nudged along as quickly as possible.
    >>
    >> --
    >> Craig Wilson - MCNE, MCSE, CCNA
    >> Novell Knowledge Partner
    >>
    >> Novell does not officially monitor these forums.
    >>
    >> Suggestions/Opinions/Statements made by me are solely my own.
    >> These thoughts may not be shared by either Novell or any rational human.
    >>
    >>
    >> "Bob-O-Rama" <[email protected]> wrote in message
    >> news:[email protected]..
    >>>
    >>> Same here... researching...
    >>>
    >>> Running SLES 10.2 + patches. Also tried advanced settings to specify
    >>> the server and IP addresses, no dice.
    >>>
    >>> -- Bob
    >>>
    >>>
    >>> --
    >>> Bob Mahar -- Novell Knowledge Partner
    >>> Do you do what you do at a .EDU? http://novell.com/ttp
    >>> "Programming is like teaching a jellyfish to build a house."
    >>> http://twitter.com/BobMahar http://vimeo.com/boborama
    >>> ------------------------------------------------------------------------
    >>> Bob-O-Rama's Profile: http://forums.novell.com/member.php?userid=5269
    >>> View this thread: http://forums.novell.com/showthread.php?t=396101
    >>>
    >>
    >>

  • After Security Update today: "Bus error" when starting "ssh" client

    Hi,
    I'm using OS X 10.5.2 and updated my system with the newest Safari 3.1 and Security Update a few hours ago. After I did this update, I cant use the command-line ssh client anymore. When I start the ssh, I immediately get a "Bus error" on the shell.
    Any suggestions?
    Thanks, Marc

    Disk Utility Permission Repair doesn't do any good either.
    I now actually use my Parallels VM to ssh thanks to putty but still...
    This is what Crash Reporter has to say:
    The application ssh quit unexpectedly.
    Process: ssh [323]
    Path: /usr/bin/ssh
    Identifier: ssh
    Version: ??? (???)
    Code Type: X86 (Native)
    Parent Process: bash [189]
    Date/Time: 2008-03-18 23:04:56.717 +0100
    OS Version: Mac OS X 10.5.2 (9C31)
    Report Version: 6
    Exception Type: EXCBADACCESS (SIGBUS)
    Exception Codes: KERNPROTECTIONFAILURE at 0x0000000000001014
    Crashed Thread: 0
    Thread 0 Crashed:
    0 ??? 0x0004c4e7 0 + 312551
    1 ??? 0x0004c56e 0 + 312686
    2 ??? 0x0004c7f7 0 + 313335
    3 ??? 0x0004b070 0 + 307312
    Thread 0 crashed with X86 Thread State (32-bit):
    eax: 0x00001000 ebx: 0x0004c7d5 ecx: 0x0004e338 edx: 0x0004e340
    edi: 0x0000101c esi: 0x00000000 ebp: 0xbffffa18 esp: 0xbffff9f0
    ss: 0x0000001f efl: 0x00010286 eip: 0x0004c4e7 cs: 0x00000017
    ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
    cr2: 0x00001014
    Binary Images:
    0x363d8000 - 0x36415fef +ssh ??? (???) <38f6d3ec24f0b372e64c12b15bb319d4> /usr/bin/ssh
    0x8fe00000 - 0x8fe2da53 dyld 96.2 (???) <7af47d3b00b2268947563c7fa8c59a07> /usr/lib/dyld
    0x90125000 - 0x90129fff libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib
    0x90841000 - 0x909a0ff3 libSystem.B.dylib ??? (???) <4899376234e55593b22fc370935f8cdf> /usr/lib/libSystem.B.dylib
    0x9316d000 - 0x9317bffd libz.1.dylib ??? (???) <5ddd8539ae2ebfd8e7cc1c57525385c7> /usr/lib/libz.1.dylib
    0x9317c000 - 0x931a7fe7 libauto.dylib ??? (???) <42d8422dc23a18071869fdf7b5d8fab5> /usr/lib/libauto.dylib
    0x931a9000 - 0x93206ffb libstdc++.6.dylib ??? (???) <04b812dcec670daa8b7d2852ab14be60> /usr/lib/libstdc++.6.dylib
    0x936a2000 - 0x937d4fef com.apple.CoreFoundation 6.5.1 (476.10) <d5bed2688a5eea11a6dc3a3c5c17030e> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x93adf000 - 0x93b91ffb libcrypto.0.9.7.dylib ??? (???) <330b0e48e67faffc8c22dfc069ca7a47> /usr/lib/libcrypto.0.9.7.dylib
    0x93be1000 - 0x93cc0fff libobjc.A.dylib ??? (???) <a53206274b6c2d42691f677863f379ae> /usr/lib/libobjc.A.dylib
    0x93d20000 - 0x93e58ff7 libicucore.A.dylib ??? (???) <afcea652ff2ec36885b2c81c57d06d4c> /usr/lib/libicucore.A.dylib
    0x93fbc000 - 0x93fdafff libresolv.9.dylib ??? (???) <0629b6dcd71f4aac6a891cbe26253e85> /usr/lib/libresolv.9.dylib
    0x94c9c000 - 0x94d4cfff edu.mit.Kerberos 6.0.12 (6.0.12) <3dd13466876a8fe4549cfc1354233ec3> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
    0x94d4d000 - 0x94d54ffe libbsm.dylib ??? (???) <d25c63378a5029648ffd4b4669be31bf> /usr/lib/libbsm.dylib
    0x95ca0000 - 0x95e6bff7 com.apple.security 5.0.2 (33001) <0788969ffe7961153219be10786da436> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x966d7000 - 0x966defe9 libgcc_s.1.dylib ??? (???) <f53c808e87d1184c0f9df63aef53ce0b> /usr/lib/libgcc_s.1.dylib
    0xfffe8000 - 0xfffebfff libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib
    0xffff0000 - 0xffff1780 libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib

  • Bus error on some applications after installing 2013-002 update

    Hi,
    After installing 2013-002 Security Update on Mac Os 10.6.8 I get Bus Error when starting chrome (last version), trying to select a disc image in VirtualBox 4.2.12 and possibly in other applications.
    Any known bug that I'm not aware of? Reseting PRAM didn't work.
    Thanks.

    Tried to fix permission with Disk Utility but it didn't work.
    Here is the beggining of my crash reports:
    Process:    
    Google Chrome [248]
    Path:       
    /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    Identifier: 
    com.google.Chrome
    Version:    
    27.0.1453.110 (1453.110)
    Code Type:  
    X86 (Native)
    Parent Process:  launchd [211]
    Date/Time:  
    2013-06-05 17:58:25.353 -0300
    OS Version: 
    Mac OS X 10.6.8 (10K549)
    Report Version:  6
    Interval Since Last Report:     
    13318 sec
    Crashes Since Last Report:      
    25
    Per-App Interval Since Last Report:  40 sec
    Per-App Crashes Since Last Report:   11
    Anonymous UUID:                 
    9839EF92-04E8-4A96-A582-68E940C20B35
    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000000a
    Crashed Thread:  0  CrBrowserMain  Dispatch queue: com.apple.main-thread

  • Application crashes after a bus error

    Hi, by testing my (AIR) application, after several
    "click/digit/select" the app crashes and in the console appears
    "bus error" on Mac OS X, on Windows xp it crashes without message.
    How can I try to solve the problem?
    (My application is based on Ext, so I'm using javascript,
    html and css.)
    ps. I've noticed that on Mac my app is 4/5 times faster than
    on Windows (the machines have similar hardware)

    Hi,
    That sounds like a bug. Please file a bug at
    http://www.adobe.com/go/wish
    with the sample that can reproduce it.

  • Module bus errors after update

    I did a system update tonight and now I've got a problem.
    The upgrade seemed to go fine, I didn't notice any issues, so I upgrated my virutalbox_bin from aur as well.
    It exited with:
    FATAL: Module vboxdrv not found
    So I tried:
    sudo modprobe vboxdrv
    and got the same.
    Then I rebooted and the boot messages don't look too good, can't find vboxdrv then below that a message saying Updating module dependencies..... This fails with a
    /etc/rc.d/functions line 136: 4056 Bus error
    It manages to boot, and I tried running depmod manually, but I also get a bus error here.
    What's going on? What should I do next?
    Thanks,
      Jeremy

    I managed to insert the vboxdrv.ko using "insmod vboxdrv.ko" from /lib/modules/2.6.33-ARCH/misc.
    This works, and VirtualBox correctly uses the module and runs fine.
    But, modprobe still fails.
    The module is good, the path to the module looks right (matches uname -r).
    I can't even find any helpful messages in /var/log/ or dmesg. 
    Can someone give me a pointer?
    Thanks,
      Jeremy

  • Bus error - Help!

    Hi,
    I've been asked to see if I can fix a C program so that it will run on a mac. It currently compiles and runs perfectly on a linux machine, but as soon as you run it on a mac, it will compile, but quit with a bus error very early on. The full code is here:
    // Program for the construction of cartograms (density-equalizing map
    // projections) using the Gastner-Newman technique. The program needs polygon
    // coordinates and a count of cases in each region as input, calculates the new
    // coordinates, and writes these to a file. Postscript images of the original
    // map and the cartogram are created.
    // WRITTEN BY MICHAEL GASTNER, September 20, 2004.
    // If you use output created by this program please acknowledge the use of this
    // code and its first publication in:
    // "Generating population density-equalizing maps", Michael T. Gastner and
    // M. E. J. Newman, Proceedings of the National Academy of Sciences of the
    // United States of America, vol. 101, pp. 7499-7504, 2004.
    // The input coordinates in MAPGENFILE must be in ArcInfo "generate" format of
    // the type:
    // 1
    // 0.3248690E+06 0.8558454E+06
    // 0.3248376E+06 0.8557575E+06
    // 0.3248171E+06 0.8556783E+06
    // 0.3247582E+06 0.8556348E+06
    // 0.3246944E+06 0.8555792E+06
    // 0.3246167E+06 0.8555253E+06
    // 0.3250221E+06 0.8557324E+06
    // 0.3249436E+06 0.8557322E+06
    // 0.3248690E+06 0.8558454E+06
    // END
    // 1
    // 0.3248690E+06 0.8558454E+06
    // 0.3249651E+06 0.8558901E+06
    // 0.3250519E+06 0.8559769E+06
    // 0.3250691E+06 0.8561246E+06
    // 0.3249678E+06 0.8560541E+06
    // 0.3249003E+06 0.8560088E+06
    // 0.3076424E+06 0.8477603E+06
    // 0.3075691E+06 0.8477461E+06
    // 0.3075595E+06 0.8476719E+06
    // END
    // 2
    // 0.6233591E+06 0.6056502E+06
    // 0.6235193E+06 0.6056467E+06
    // 0.6235054E+06 0.6055372E+06
    // 0.7384296E+06 0.2334260E+06
    // 0.7383532E+06 0.2345770E+06
    // END
    // END
    // The number of cases in CENSUSFILE must be given in the form
    // region #cases (optional comment), e. g:
    // 43 0.9 Alabama
    // 51 0.3 Alaska
    // 37 0.8 Arizona
    // 47 0.6 Arkansas
    // 25 5.4 California
    // 32 0.8 Colorado
    // 19 0.8 Connecticut
    // 29 0.3 Delaware
    // 28 0.3 District of Columbia
    // 49 2.5 Florida
    // 45 1.3 Georgia
    // 1 0.4 Hawaii
    // The output coordinates are written to CARTGENFILE in ArcInfo "generate"
    // format. A postscript image of the original input is prepared as MAP2PS,
    // an image of the cartogram as CART2PS.
    // Modified on Oct 29, 2004. The number of divisions in each dimension lx, ly
    // will now be determined from the input map. Also fixed array bound
    // violations in intpol and newt2, and centered the ps-files.
    // Modified on Dec 3, 2004. Introduced pointers bbmaxx,bbmaxy,bbminx,bbminy -
    // the bounding box coordinates for each polygon - to reduce calculations in
    // crnmbr. Thanks to Chris Brunsdon for the suggestion.
    // Program now terminates with error message if there is no density specified
    // in CENSUSFILE for a region on the map.
    // "Donut" polygons are now handled properly. Polygons oriented clockwise will
    // be considered exterior boundaries. If they are oriented anti-clockwise they
    // are holes inside an enclosing polygon. (Unconventional for mathematicians,
    // but this is ArcGIS standard.) The identifier is either that of the enclosing
    // polygon, or -99999 in which case it is a hole in the preceding polygon.
    // The population can now be a floating-point number.
    // If a region contains exactly zero population, it will be replaced by
    // MINPOPFAC times the smallest positive population in any region.
    // Obviously, MINPOPFAC should be <1, I will set it to 0.1 by default. This
    // should reduce the value of sigma necessary for the integrator to finish
    // properly.
    // Modified on March 31, 2005. Initialized maxchange in nonlinvoltra() as
    // INFTY. Replaced crnmbr() by a similar, but faster routine interior().
    // Many thanks to Stuart Anderson for pointing out this shortcut.
    // TO DO LIST:
    // - Do Gaussian blur within nonlinvoltra as a simple call to calcv and
    // eliminate gaussianblur().
    // - Modify the NR code for the FFTs to deal more naturally with the fencepost
    // issue. No more copying of arrays in sinft and cosft.
    // - Write truly two-dimensional versions of coscosft, cossinft, and sincosft.
    // See Chan and Ho: A new two-dimensional fast cosine transform algorithm,
    // IEEE Transactions on Signal Processing, 39, 481ff. (1991).
    // - Read polygon data directly from shapefile instead of generate file.
    // - Reorganize data structures. It is currently quite a mess to read.
    // Inclusions
    #include <math.h>
    #include <stdio.h>
    #include <stdlib.h>
    // Definitions
    #define CART2PS "./cart.ps","w" // Cartogram image.
    #define CARTGENFILE "./cartogram.gen" // Cartogram generate file.
    #define CENSUSFILE "./census.dat","r" // Input.
    #define CONVERGENCE 1e-100 // Convergence criterion for integrator.
    // #define DISPLFILE "./displ.dat","w"
    #define FALSE 0
    #define HINITIAL 1e-4 // Initial time step size in nonlinvoltra.
    #define IMAX 50 // Maximum number of iterations in Newton-Raphson routine.
    #define INFTY 1e100
    #define LINELENGTH 1000
    #define MAP2PS "map.ps","w" // Map image.
    #define MAPGENFILE "./map.gen","r" // Input coordinates.
    #define MAX(a,b) ((b>a)?(b):(a))
    #define MAXINTSTEPS 3000 // Maximum number of time steps in nonlinvoltra.
    #define MAXNSQLOG 18 // The number of sample points for rho_0 is <~2^MAXNSQLOG.
    #define MIN(a,b) ((b<a)?(b):(a))
    #define MINH 1e-5 // Smallest permitted time step in the integrator.
    #define MINPOPFAC 0.1 // Replace 0 population by a fraction of the minimum.
    #define NR_END 1
    #define NSUBDIV 1 // Number of linear subdivisions for digitizing the density.
    #define PADDING 1.5 // Determines space between map and boundary.
    #define PI 3.141592653589793
    #define SIGMA 0.1 // Initial width of Gaussian blur.
    #define SIGMAFAC 1.2 // Increase sigma by this factor. Must be > 1.
    #define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr;
    #define TIMELIMIT 1e8 // Maximum time allowed in integrator.
    #define TOLF 1e-3 // Sensitivity w. r. t. function value in newt2.
    #define TOLINT 1e-3 // Sensitivity of the integrator.
    #define TOLX 1e-3 // Sensitivity w. r. t. independent variables in newt2.
    #define TRUE !FALSE
    // Types
    typedef int BOOLEAN;
    typedef struct
    float x;
    float y;
    } POINT;
    // Globals
    float bbmaxx,*bbmaxy,*bbminx,*bbminy,**gridvx,*gridvy,maxx,maxy,minpop,
    minx,miny,polymaxx,polymaxy,polyminx,polyminy,*rho,**rho_0,**vx,**vy,*x,
    *xappr,xstepsize,**y,*yappr,ystepsize;
    int lx,ly,maxid,nblurs=0,npoly,npolycorn,*npolyinreg,nregcorn,nregion,
    polygonid,**polyinreg,*regionid,*regionidinv,*within;
    POINT *polycorn,*regcorn;
    // Function prototypes
    int readline(char line[],FILE *infile);
    void countpoly(FILE *infile);
    void countcorn(FILE *infile);
    void readcorn(FILE *infile);
    void makeregion(void);
    void pspicture(FILE *outfile);
    void bboxes(void);
    void interior(void);
    double regionarea(int ncrns,POINT *polygon);
    void digdens(void);
    void four1(float data[],unsigned long nn,int isign);
    void realft(float data[],unsigned long n,int isign);
    void cosft(float z[],unsigned long n,int isign);
    void sinft(float z[],unsigned long n,int isign);
    void coscosft(float **y,int isign1,int isign2);
    void cossinft(float **y,int isign1,int isign2);
    void sincosft(float **y,int isign1,int isign2);
    float **dmatrix(long nrl,long nrh,long ncl,long nch);
    float *d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
    void free_matrix(float **m,long nrl,long nrh,long ncl,long nch);
    void free_f3tensor(float *t,long nrl,long nrh,long ncl,long nch,long ndl,
    long ndh);
    void fourn(float data[],unsigned long nn[],int ndim,int isign);
    void rlft3(float *data,float **speq,unsigned long nn1,unsigned long nn2,
    unsigned long nn3,int isign);
    void gaussianblur(void);
    void initcond(void);
    void calcv(float t);
    float intpol(float **arr,float x,float y);
    BOOLEAN newt2(float h,float *xappr,float xguess,float *yappr,float yguess,
    int j,int k);
    BOOLEAN nonlinvoltra(void);
    POINT transf(POINT p);
    void cartogram(void);
    // Function to read one line.
    int readline(char line[],FILE *infile)
    if (fgets(line,LINELENGTH,infile)==NULL) return 1;
    return 0;
    // Function to count the number of polygons.
    void countpoly(FILE *infile)
    char line[LINELENGTH];
    npoly = 0;
    while (!readline(line,infile)) if (line[0] == 'E') npoly++;
    npoly--; // The .gen file ends with two consecutive "END"s.
    // Function to count polygon corners. Also determines minimum/maximum x-/y-
    // coordinate.
    void countcorn(FILE *infile)
    BOOLEAN bnd_ok = FALSE;
    char line[LINELENGTH];
    float x,y;
    int polyctr=0,ratiolog;
    npolycorn = (int*)calloc(npoly,sizeof(int));
    polycorn = (POINT*)malloc(npoly*sizeof(POINT));
    readline(line,infile); // Skip first line.
    readline(line,infile);
    sscanf(line,"%f %f",&x,&y);
    polyminx = x; polymaxx = x; polyminy = y; polymaxy = y;
    npolycorn[0] = 1;
    while (!readline(line,infile))
    if (line[0] != 'E')
    sscanf(line,"%f %f",&x,&y);
    if (x < polyminx) polyminx = x;
    if (x > polymaxx) polymaxx = x;
    if (y < polyminy) polyminy = y;
    if (y > polymaxy) polymaxy = y;
    npolycorn[polyctr]++;
    else
    readline(line,infile);
    polycorn[polyctr] = (POINT)malloc(npolycorn[polyctr]sizeof(POINT));
    polyctr++;
    if (ceil(log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2))+
    floor(log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2))>
    2*log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2))
    ratiolog = (int)floor(log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2));
    else
    ratiolog = (int)ceil(log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2));
    lx = (int)pow(2,(int)(0.5*(ratiolog+MAXNSQLOG)));
    ly = (int)pow(2,(int)(0.5*(MAXNSQLOG-ratiolog)));
    if ((polymaxx-polyminx)/lx > (polymaxy-polyminy)/ly)
    maxx = 0.5((1PADDING)*polymaxx(1-PADDING)polyminx);
    minx = 0.5((1-PADDING)*polymaxx(1PADDING)polyminx);
    maxy = 0.5(polymaxypolyminy(maxx-minx)ly/lx);
    miny = 0.5(polymaxy+polyminy-(maxx-minx)ly/lx);
    else
    maxy = 0.5((1PADDING)*polymaxy(1-PADDING)polyminy);
    miny = 0.5((1-PADDING)*polymaxy(1PADDING)polyminy);
    maxx = 0.5(polymaxxpolyminx(maxy-miny)lx/ly);
    minx = 0.5(polymaxx+polyminx-(maxy-miny)lx/ly);
    // Uncomment the next lines for interactive choice of boundary conditions.
    /* printf("For the %i polygon(s) under consideration:\n",npoly);
    printf("minimum x = %f\tmaximum x = %f\n",polyminx,polymaxx);
    printf("minimum y = %f\tmaximum y = %f\n",polyminy,polymaxy);
    while (!bnd_ok)
    printf("Type in your choice of boundaries.\nminx = ");
    scanf("%f",&minx);
    printf("maxx = ");
    scanf("%f",&maxx);
    printf("miny = ");
    scanf("%f",&miny);
    printf("maxy = ");
    scanf("%f",&maxy);
    if (minx>polyminx || maxx<polymaxx || miny>polyminy || maxy<polymaxy)
    printf("Invalid choice, does not enclose the polygon(s).\n");
    else bnd_ok = TRUE;
    // Function to read polygon corners. The first and last vertex of each polygon
    // must be identical.
    void readcorn(FILE *infile)
    char line[LINELENGTH];
    float xcoord,ycoord;
    int i,id,polyctr=0;
    polygonid = (int)malloc(npolysizeof(int));
    xstepsize = (maxx-minx)/lx;
    ystepsize = (maxy-miny)/ly;
    if (fabs((xstepsize/ystepsize)-1)>1e-3)
    fprintf(stderr,"WARNING: Area elements are not square: %f : %f\n",
    xstepsize,ystepsize);
    readline(line,infile);
    sscanf(line,"%i",&id);
    polygonid[polyctr] = id;
    i = 0;
    while (!readline(line,infile))
    if (line[0] != 'E')
    sscanf(line,"%f %f",&xcoord,&ycoord);
    polycorn[polyctr].x = (xcoord-minx)/xstepsize;
    polycorn[polyctr][i++].y = (ycoord-miny)/ystepsize;
    else
    // Is first and last vertex the same?
    if (fabs(polycorn[polyctr][0].x-
    polycorn[polyctr][npolycorn[polyctr]-1].x)+
    fabs(polycorn[polyctr][0].y-
    polycorn[polyctr][npolycorn[polyctr]-1].y)>1e-12)
    fprintf(stderr,
    "ERROR: %i-th polygon does not close upon itself.\n",
    polyctr+1);
    fprintf(stderr,"Identifier %i, first point %f %f.\n",
    polygonid[polyctr],polycorn[polyctr][0].x*xstepsize+minx,
    polycorn[polyctr][0].y*ystepsize+miny);
    exit(1);
    readline(line,infile);
    sscanf(line,"%i",&id);
    i = 0;
    polyctr++;
    if (polyctr<npoly) polygonid[polyctr] = id;
    polyminx = (polyminx-minx)/xstepsize;
    polyminy = (polyminy-miny)/ystepsize;
    polymaxx = (polymaxx-minx)/xstepsize;
    polymaxy = (polymaxy-miny)/ystepsize;
    // Function to make regions from polygons.
    void makeregion(void)
    BOOLEAN repeat;
    int i,lastid,minid,polyctr,ptctr,regctr;
    // Count the number of regions.
    nregion = 0;
    maxid = minid = polygonid[0];
    for (polyctr=0; polyctr<npoly; polyctr++)
    if (polygonid[polyctr] == -99999) continue;
    if (polygonid[polyctr]>maxid || polygonid[polyctr]<minid) nregion++;
    else
    repeat = FALSE;
    for (i=0; i<polyctr; i++)
    if (polygonid[polyctr]==polygonid)
    repeat = TRUE;
    break;
    if (!repeat) nregion++;
    if (polygonid[polyctr]>maxid) maxid = polygonid[polyctr];
    if (polygonid[polyctr]<minid) minid = polygonid[polyctr];
    if (minid < 0)
    fprintf(stderr,
    "ERROR: Negative region identifier %i.\n",minid);
    exit(1);
    // Match region identifiers.
    regionid = (int)malloc(nregionsizeof(int));
    nregion = 0;
    maxid = minid = polygonid[0];
    for (polyctr=0; polyctr<npoly; polyctr++)
    if (polygonid[polyctr] == -99999) continue;
    if (polygonid[polyctr]>maxid || polygonid[polyctr]<minid)
    regionid[nregion++] = polygonid[polyctr];
    else
    repeat = FALSE;
    for (i=0; i<polyctr; i++)
    if (polygonid[polyctr]==polygonid)
    repeat = TRUE;
    break;
    if (!repeat) regionid[nregion++] = polygonid[polyctr];
    if (polygonid[polyctr]>maxid) maxid = polygonid[polyctr];
    if (polygonid[polyctr]<minid) minid = polygonid[polyctr];
    regionidinv = (int)malloc((maxid+1)sizeof(int));
    // Negative number for unused identifiers.
    for (i=0; i<=maxid; i++) regionidinv = -1;
    for (regctr=0; regctr<nregion; regctr++)
    regionidinv[regionid[regctr]] = regctr;
    // Which polygons contribute to which regions?
    npolyinreg = (int*)calloc(nregion,sizeof(int));
    polyinreg = (int*)malloc(nregion*sizeof(int));
    lastid = polygonid[0];
    for (polyctr=0; polyctr<npoly; polyctr++)
    if (polygonid[polyctr] != -99999)
    npolyinreg[regionidinv[polygonid[polyctr]]]++;
    lastid = polygonid[polyctr];
    else npolyinreg[regionidinv[lastid]]++;
    for (regctr=0; regctr<nregion; regctr++)
    polyinreg[regctr] = (int)malloc(npolyinreg[regctr]sizeof(int));
    for (regctr=0; regctr<nregion; regctr++) npolyinreg[regctr] = 0;
    lastid = polygonid[0];
    for (polyctr=0; polyctr<npoly; polyctr++)
    if (polygonid[polyctr] != -99999)
    polyinreg[regionidinv[polygonid[polyctr]]]
    [npolyinreg[regionidinv[polygonid[polyctr]]]++] = polyctr;
    lastid = polygonid[polyctr];
    else polyinreg[regionidinv[lastid]][npolyinreg[regionidinv[lastid]]++]
    = polyctr;
    // Make regions from polygons. Start and end each polygon at (0,0).
    nregcorn = (int*)calloc(nregion,sizeof(int));
    regcorn = (POINT*)malloc(nregion*sizeof(POINT));
    for (regctr=0; regctr<nregion; regctr++)
    for (i=0; i<npolyinreg[regctr]; i++)
    nregcorn[regctr] += npolycorn[polyinreg[regctr]]+1;
    nregcorn[regctr]++;
    for (regctr=0; regctr<nregion; regctr++)
    regcorn[regctr] = (POINT)malloc(nregcorn[regctr]sizeof(POINT));
    ptctr = 0;
    regcorn[regctr][ptctr].x = regcorn[regctr][ptctr++].y = 0.0;
    for (polyctr=0; polyctr<npolyinreg[regctr]; polyctr++)
    for (i=0; i<npolycorn[polyinreg[regctr][polyctr]]; i++)
    regcorn[regctr][ptctr++] = polycorn[polyinreg[regctr][polyctr]];
    regcorn[regctr][ptctr].x = regcorn[regctr][ptctr++].y = 0.0;
    // Function to prepare a map in postscript standard letter format.
    void pspicture(FILE *outfile)
    char line[LINELENGTH];
    float addx,addy,b,conv,g,r;
    int ptctr,regctr;
    if (11*lx > 8.5*ly)
    conv = (float)8.5*72/lx;
    addx = 0;
    addy = 1136-8.5*36ly/lx;
    else
    conv = (float)11*72/ly;
    addx = 8.536-11*36lx/ly;
    addy = 0;
    fprintf(outfile,"0.5 setlinewidth\n");
    for (regctr=0; regctr<nregion; regctr++)
    fprintf(outfile,"newpath\n");
    fprintf(outfile,"%f %f moveto\n",
    regcorn[regctr][1].x*conv+addx,
    regcorn[regctr][1].y*conv+addy);
    for (ptctr=2; ptctr<nregcorn[regctr]; ptctr++)
    if (fabs(regcorn[regctr][ptctr].x)+
    fabs(regcorn[regctr][ptctr].y)>1e-12)
    fprintf(outfile,"%f %f lineto\n",
    regcorn[regctr][ptctr].x*conv+addx,
    regcorn[regctr][ptctr].y*conv+addy);
    else
    fprintf(outfile,"closepath\n");
    if (ptctr<nregcorn[regctr]-1)
    ptctr++;
    fprintf(outfile,"%f %f moveto\n",
    regcorn[regctr][ptctr].x*conv+addx,
    regcorn[regctr][ptctr].y*conv+addy);
    // Determine colors for map (without better knowledge I will do it
    // arbitrarily).
    if (regctr%3 == 0)
    r = (float)regctr/nregion;
    g = 1-(float)regctr/nregion;
    b = fabs(1-2*(float)regctr/nregion);
    else if (regctr%3 == 1)
    b = (float)regctr/nregion;
    r = 1-(float)regctr/nregion;
    g = fabs(1-2*(float)regctr/nregion);
    else
    g = (float)regctr/nregion;
    b = 1-(float)regctr/nregion;
    r = fabs(1-2*(float)regctr/nregion);
    fprintf(outfile,"%f %f %f setrgbcolor\ngsave\nfill\n",r,g,b);
    fprintf(outfile,"grestore\n0 setgray stroke\n");
    fprintf(outfile,"showpage\n");
    // Function to find the bounding box for each polygon.
    void bboxes(void)
    int i,j;
    float maxx, minx, maxy, miny;
    bbmaxx = (float)malloc(npolysizeof(float));
    bbmaxy = (float)malloc(npolysizeof(float));
    bbminx = (float)malloc(npolysizeof(float));
    bbminy = (float)malloc(npolysizeof(float));
    for (i = 0; i < npoly; i++)
    maxx = polycorn[0].x;
    maxy = polycorn[0].y;
    minx = maxx;
    miny = maxy;
    for (j = 0; j < npolycorn; j++)
    if (polycorn[j].x > maxx) maxx = polycorn[j].x;
    if (polycorn[j].x < minx) minx = polycorn[j].x;
    if (polycorn[j].y < miny) miny = polycorn[j].y;
    if (polycorn[j].y > maxy) maxy = polycorn[j].y;
    bbmaxx=maxx;
    bbmaxy=maxy;
    bbminx=minx;
    bbminy=miny;
    void interior(void)
    int i,inhowmanyregions,inregion[2],j,k,l,m,n,regctr;
    // Initialize within[][]. -1 means outside all regions.
    for (i=0; i<=lx; i++) for (j=0; j<=ly; j++) within[j] = -1;
    // Fill within[][].
    for (i=0; i<nregion; i++) for (j=0; j<npolyinreg; j++)
    for (k=0, n=npolycorn[polyinreg[j]]-1;
    k<npolycorn[polyinreg[j]]; n=k++)
    for (l=(int)ceil(MIN(polycorn[polyinreg[j]][k-1].y,
    polycorn[polyinreg[j]][k].y));
    l<MAX(polycorn[polyinreg[j]][k-1].y,
    polycorn[polyinreg[j]][k].y); l++)
    for (m=(int)floor(bbminx[polyinreg[j]]);
    m<(polycorn[polyinreg[j]][n].x-
    polycorn[polyinreg[j]][k].x)*
    (l-polycorn[polyinreg[j]][k].y)/
    (polycorn[polyinreg[j]][n].y-
    polycorn[polyinreg[j]][k].y)+
    polycorn[polyinreg[j]][k].x;
    m++)
    within[m][l] = i-within[m][l]-1;
    // Function to determine polygon area. This is needed to determine the average
    // population.
    // The problem in short is to find the area of a polygon whose vertices are
    // given. Recall Stokes' theorem in 3d for a vector field v:
    // integral[around closed curve dA]v(x,y,z).ds =
    // integral[over area A]curl(v).dA.
    // Now let v(x,y,z) = (0,Q(x,y),0) and dA = (0,0,dx*dy). Then
    // integral[around closed curve dA]Q(x,y)dy = integral[over area A]dQ/dxdxdy.
    // If Q = x:
    // A = integral[over area A]dx*dy = integral[around closed curve dA]x dy.
    // For every edge from (x,y) to (x[i1],y[i1]) there is a
    // parametrization
    // (x(t),y(t)) = ((1-t)xtx[i+1],(1-t)y+ty[i1]), 0<t<1
    // so that the path integral along this edge is
    // int[from 0 to 1]{(1-t)xt*x[i+1]}(y[i1]-y)dt =
    // 0.5(y[i1]-y)(x+x[i1]).
    // Summing over all edges yields:
    // Area = 0.5*[(x[0]+x[1])(y[1]-y[0]) + (x[1]+x[2])(y[2]-y[1]) + ...
    // ...(x[n-1]+x[n])(y[n]-y[n-1])+(x[n]x[0])(y[0]-y[n])]
    // ArcGIS treats a clockwise direction as positive, so there is a minus sign.
    double regionarea(int ncrns,POINT *polygon)
    double area=0;
    int i;
    for (i=0; i<ncrns-1; i++)
    area -=
    0.5(polygon.xpolygon[i+1].x)(polygon[i1].y-polygon.y);
    return area -= 0.5(polygon[ncrns-1].x+polygon[0].x)
    (polygon[0].y-polygon[ncrns-1].y);
    // Function to digitize density.
    void digdens(void)
    char line[LINELENGTH];
    double area,avgdens,*cases,dens,minpop=INFTY,ncases,totarea=0.0,totpop=0.0;
    FILE* infile;
    int i,id,ii,inhowmanyregions,inregion[2],j,jj,regctr;
    if ((infile=fopen(CENSUSFILE))==NULL)
    fprintf(stderr,"ERROR: Cannot find CENSUSFILE.\n");
    exit(1);
    // Find the minimum positive number of cases.
    while (!readline(line,infile))
    sscanf(line,"%i %lf",&id,&ncases);
    if (ncases<minpop && ncases>1e-12) minpop = ncases;
    fclose(infile);
    // Store the number of cases in an array.
    cases = (double)malloc(nregionsizeof(double));
    for (i=0; i<nregion; i++) cases = -1.0;
    infile = fopen(CENSUSFILE);
    while (!readline(line,infile))
    sscanf(line,"%i %lf",&id,&ncases);
    if (id>maxid || regionidinv[id]<0)
    fprintf(stderr,"ERROR: Identifier %i in CENSUSFILE does not\n",id);
    fprintf(stderr,"match any identifier in generate file.\n");
    exit(1);
    if (ncases>1e-12) totpop += (cases[regionidinv[id]] = ncases);
    else totpop += (cases[regionidinv[id]] = MINPOPFAC*minpop);
    for (regctr=0; regctr<nregion; regctr++) if (cases[regctr] < 0.0)
    fprintf(stderr,"ERROR: No density for region %i?\n",regionid[regctr]);
    fprintf(stderr,"cases = %f\n",cases[regctr]);
    exit(1);
    fclose(infile);
    // Calculate regions' areas, total area to be mapped, regional and average
    // densities.
    area = (double)malloc(nregionsizeof(double));
    for (regctr=0; regctr<nregion; regctr++)
    totarea += (area[regctr] = regionarea(nregcorn[regctr],regcorn[regctr]));
    dens = (double)malloc(nregionsizeof(double));
    for (regctr=0; regctr<nregion; regctr++)
    dens[regctr] = cases[regctr]/area[regctr];
    avgdens = totpop/totarea;
    // Digitize density.
    for (i=0; i<=lx; i++) for (j=0; j<=ly; j++) rho_0[j] = 0; // Initialize.
    printf("digitizing density ...\n");
    for (i=0; i<lx; i++) for (j=0; j<ly; j++)
    if (within[j]==-1) rho_0[j] = avgdens;
    else rho_0[j] = dens[within[j]];
    // Fill the edges correctly.
    rho_0[0][0] += rho_0[0][ly] + rho_0[lx][0] + rho_0[lx][ly];
    for (i=1; i<lx; i++) rho_0[0] += rho_0[ly];
    for (j=1; j<ly; j++) rho_0[0][j] += rho_0[lx][j];
    for (i=0; i<lx; i++) rho_0[ly] = rho_0[0];
    for (j=0; j<=ly; j++) rho_0[lx][j] = rho_0[0][j];
    // Replace rho_0 by Fourier transform
    coscosft(rho_0,1,1);
    free(area);
    free(cases);
    for (i=0; i<npoly; i++) free(polycorn);
    free(polycorn);
    for (i=0; i<nregion; i++) free(regcorn);
    free(regcorn);
    free(dens);
    free(npolycorn);
    free(nregcorn);
    free(polygonid);
    free(regionid);
    free(regionidinv);
    free(bbmaxx);
    free(bbmaxy);
    free(bbminx);
    free(bbminy);
    for (i=0; i<nregion; i++) free(polyinreg);
    free(polyinreg);
    free(npolyinreg);
    // Function to replace data[1...2*nn] by its discrete Fourier transform, if
    // isign is input as 1; or replaces data[1...2*nn] by nn times its inverse
    // discrete Fourier transform, if isign is input as -1. data is a complex array
    // of length nn or, equivalently, a real array of length 2*nn. nn MUST be an
    // integer power of 2 (this is not checked for!).
    // From "Numerical Recipes in C".
    void four1(float data[],unsigned long nn,int isign)
    double theta,wi,wpi,wpr,wr,wtemp;
    float tempi,tempr;
    unsigned long i,istep,j,m,mmax,n;
    n=nn<<1;
    j=1;
    for (i=1; i<n; i+=2)
    if (j>i)
    // This is the bit-reversal section of the routine.
    SWAP(data[j],data);
    SWAP(data[j1],data[i1]); // Exchange the two complex numbers.
    m=n>>1;
    while (m>=2 && j>m)
    j -= m;
    m>>=1;
    j += m;
    // Here begins the Danielson-Lanczos section of the routine.
    mmax=2;
    while (n>mmax) // Outer loop executed log_2 nn times.
    istep = mmax<<1;
    // Initialize the trigonometric recurrence.
    theta = isign*(6.28318530717959/mmax);
    wtemp = sin(0.5*theta);
    wpr = -2.0wtempwtemp;
    wpi = sin(theta);
    wr = 1.0;
    wi = 0.0;
    for (m=1; m<mmax; m+=2) // Here are the two nested inner loops.
    for (i=m; i<=n; i+=istep)
    j=i+mmax; // This is the Danielson-Lanczos formula
    tempr=wrdata[j]-widata[j+1];
    tempi=wrdata[j1]widata[j];
    data[j]=data-tempr;
    data[j1]=data[i1]-tempi;
    data += tempr;
    data[i+1] += tempi;
    wr = (wtemp=wr)wpr-wiwpi+wr; // Trigonometric recurrence.
    wi = wiwprwtempwpiwi;
    mmax=istep;
    // Function to calculate the Fourier Transform of a set of n real-valued data
    // points. It replaces this data (which is stored in array data[1...n]) by the
    // positive frequency half of its complex Fourier Transform. The real-valued
    // first and last components of the complex transform are returned as elements
    // data[1] and data[2] respectively. n must be a power of 2. This routine also
    // calculates the inverse transform of a complex data array if it is the
    // transform of real data. (Result in this case must be multiplied by 2/n).
    // From "Numerical Recipes in C".
    void realft(float data[],unsigned long n,int isign)
    double theta,wi,wpi,wpr,wr,wtemp;
    float c1=0.5,c2,h1i,h1r,h2i,h2r;
    unsigned long i,i1,i2,i3,i4,np3;
    theta = 3.141592653589793/(double) (n>>1); // Initialize the recurrence
    if (isign == 1)
    c2 = -0.5;
    four1(data,n>>1,1); // The forward transform is here.
    else // Otherwise set up for an inverse transform.
    c2 = 0.5;
    theta = -theta;
    wtemp = sin(0.5*theta);
    wpr = -2.0wtempwtemp;
    wpi = sin(theta);
    wr = 1.0+wpr;
    wi = wpi;
    np3 = n+3;
    for (i=2; i<=(n>>2); i++) // Case i=1 done separately below.
    i4 = 1(i3=np3-(i2=1+(i1=ii-1)));
    // The two separate transforms are separated out of data.
    h1r = c1*(data[i1]+data[i3]);
    h1i = c1*(data[i2]-data[i4]);
    h2r = -c2*(data[i2]+data[i4]);
    h2i = c2*(data[i1]-data[i3]);
    // Here they are recombined to form the true transform of the original
    // data.
    data[i1] = h1r+wrh2r-wih2i;
    data[i2] = h1iwrh2iwih2r;
    data[i3] = h1r-wrh2r+wih2i;
    data[i4] = -h1iwrh2iwih2r;
    wr = (wtemp=wr)wpr-wiwpi+wr; // The recurrence.
    wi = wiwprwtempwpiwi;
    if (isign == 1)
    data[1] = (h1r=data[1])+data[2]; // Squeeze the first and last data
    // together to get them all within the original array.
    data[2] = h1r-data[2];
    else
    data[1] = c1*((h1r=data[1])+data[2]);
    data[2] = c1*(h1r-data[2]);
    // This is the inverse transform for the case isign = -1.
    four1(data,n>>1,-1);
    // Function to calculate the cosine transform of a set z[0...n] of real-valued
    // data points. The transformed data replace the original data in array z. n
    // must be a power of 2. For forward transform set isign=1, for back transform
    // isign = -1. (Note: The factor 2/n has been taken care of.)
    // From "Numerical Recipes in C".
    void cosft(float z[],unsigned long n,int isign)
    double theta,wi=0.0,wpi,wpr,wr=1.0,wtemp;
    float *a,sum,y1,y2;
    int j,n2;
    // Numerical Recipes starts counting at 1 which is rather confusing. I will
    // count from 0.
    a = (float)malloc((n+2)sizeof(float));
    for (j=1; j<=n+1; j++) a[j] = z[j-1];
    // Here is the Numerical Recipes code.
    theta=PI/n; //Initialize the recurrence.
    wtemp = sin(0.5*theta);
    wpr = -2.0wtempwtemp;
    wpi = sin(theta);
    sum = 0.5*(a[1]-a[n+1]);
    a[1] = 0.5*(a[1]a[n1]);
    n2 = n+2;
    for (j=2; j<=(n>>1); j++)
    wr = (wtemp=wr)wpr-wiwpi+wr;
    wi = wiwprwtempwpiwi;
    y1 = 0.5*(a[j]+a[n2-j]);
    y2 = (a[j]-a[n2-j]);
    a[j] = y1-wi*y2;
    a[n2-j] = y1+wi*y2;
    sum += wr*y2;
    realft(a,n,1);
    a[n+1] = a[2];
    a[2] = sum;
    for (j=4; j<=n; j+=2)
    sum += a[j];
    a[j] = sum;
    // Finally I revert to my counting method.
    if (isign == 1) for (j=1; j<=n+1; j++) z[j-1] = a[j];
    else if (isign == -1) for (j=1; j<=n+1; j++) z[j-1] = 2.0*a[j]/n;
    free(a);
    // Function to calculate the sine transform of a set of n real-valued data
    // points stored in array z[0..n]. The number n must be a power of 2. On exit
    // z is replaced by its transform. For forward transform set isign=1, for back
    // transform isign = -1.
    void sinft(float z[],unsigned long n,int isign)
    double theta,wi=0.0,wpi,wpr,wr=1.0,wtemp;
    float *a,sum,y1,y2;
    int j;
    unsigned long n2=n+2;
    // See my comment about Numerical Recipe's counting above. Note that the last
    // component plays a completely passive role and does not need to be stored.
    a = (float*) malloc((n+1)*sizeof(float));
    for (j=1; j<=n; j++) a[j] = z[j-1];
    // Here is the Numerical Recipes code.
    theta = PI/(double)n; // Initialize the recurrence.
    wtemp = sin(0.5*theta);
    wpr = -2.0wtempwtemp;
    wpi = sin(theta);
    a[1] = 0.0;
    for (j=2; j<=(n>>1)+1; j++)
    // Calculate the sine for the auxiliary array.
    wr = (wtemp=wr)wpr-wiwpi+wr;
    // The cosine is needed to continue the recurrence.
    wi = wiwprwtempwpiwi;
    // Construct the auxiliary array.
    y1 = wi*(a[j]+a[n2-j]);
    y2 = 0.5*(a[j]-a[n2-j]);
    // Terms j and N-j are related.
    a[j] = y1+y2;
    a[n2-j] = y1-y2;
    // Transform the auxiliary array.
    realft(a,n,1);
    // Initialize the sum used for odd terms below.
    a[1] *= 0.5;
    sum = a[2] = 0.0;
    // Even terms determined directly. Odd terms determined by running sum.
    for (j=1; j<=n-1; j+=2)
    sum += a[j];
    a[j] = a[j+1];
    a[j+1] = sum;
    // Change the indices.
    if (isign == 1) for (j=1; j<=n; j++) z[j-1] = a[j];
    else if (isign == -1) for (j=1; j<=n; j++) z[j-1] = 2.0*a[j]/n;
    z[n] = 0.0;
    free(a);
    // Function to calculate a two-dimensional cosine Fourier transform. Forward/
    // backward transform in x: isign1 = +/-1, in y: isign2 = +/-1.
    void coscosft(float **y,int isign1,int isign2)
    float temp[lx+1];
    unsigned long i,j;
    for (i=0; i<=lx; i++)
    cosft(y,ly,isign2);
    for (j=0; j<=ly; j++)
    for (i=0; i<=lx; i++) temp=y[j];
    cosft(temp,lx,isign1);
    for (i=0; i<=lx; i++) y[j]=temp;
    // Function to calculate a cosine Fourier transform in x and a sine transform
    // in y. Forward/backward transform in x: isign1 = +/-1, in y: isign2 = +/-1.
    void cossinft(float **y,int isign1,int isign2)
    float temp[lx+1];
    unsigned long i,j;
    for (i=0; i<=lx; i++)
    sinft(y,ly,isign2);
    for (j=0; j<=ly; j++)
    for (i=0; i<=lx; i++) temp=y[j];
    cosft(temp,lx,isign1);
    for (i=0; i<=lx; i++) y[j]=temp;
    // Function to calculate a sine Fourier transform in x and a cosine transform
    // in y. Forward/backward transform in x: isign1 = +/-1, in y: isign2 = +/-1.
    void sincosft(float **y,int isign1,int isign2)
    float temp[lx+1];
    unsigned long i,j;
    for (i=0; i<=lx; i++)
    cosft(y,ly,isign2);
    for (j=0; j<=ly; j++)
    for (i=0; i<=lx; i++) temp=y[j];
    sinft(temp,lx,isign1);
    for (i=0; i<=lx; i++) y[j]=temp;
    // Function to allocate a float matrix with subscript range
    // m[nrl..nrh][ncl..nch]. From "Numerical Recipes in C".
    float **dmatrix(long nrl,long nrh,long ncl,long nch)
    long i, nrow=nrh-nrl1,ncol=nch-ncl1;
    float **m;
    /* allocate pointers to rows */
    m=(float **) malloc((unsigned int)((nrow+NR_END)sizeof(float)));
    if (!m)
    fprintf(stderr,"allocation failure 1 in matrix()\n");
    exit(1);
    m += NR_END;
    m -= nrl;
    /* allocate rows and set pointers to them */
    m[nrl]=(float *) malloc((unsigned int)((nrowncol+NR_END)sizeof(float)));
    if (!m[nrl])
    fprintf(stderr,"allocation failure 2 in matrix()\n");
    exit(1);
    m[nrl] += NR_END;
    m[nrl] -= ncl;
    for(i=nrl1;i<=nrh;i+) m=m[i-1]+ncol;
    /* return pointer to array of pointers to rows */
    return m;
    // Function to allocate a float 3tensor with range
    // t[nrl..nrh][ncl..nch][ndl..ndh]. From "Numerical Recipes in C".
    float *d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
    long i,j,nrow=nrh-nrl1,ncol=nch-ncl+1,ndep=ndh-ndl1;
    float *t;
    /* allocate pointers to pointers to rows */
    t=(float *) malloc((sizet)((nrow+NREND)sizeof(float*)));
    if (!t)
    fprintf(stderr,"allocation failure 1 in f3tensor()\n");
    exit(1);
    t += NR_END;
    t -= nrl;
    /* allocate pointers to rows and set pointers to them */
    t[nrl]=(float **) malloc((sizet)((nrowncol+NREND)*sizeof(float)));
    if (!t[nrl])
    fprintf(stderr,"allocation failure 2 in f3tensor()\n");
    exit(1);
    t[nrl] += NR_END;
    t[nrl] -= ncl;
    /* allocate rows and set pointers to them */
    t[nrl][ncl]=(float *) malloc((sizet)((nrowncol*ndep+NREND)sizeof(float)));
    if (!t[nrl][ncl])
    fprintf(stderr,"allocation failure 3 in f3tensor()\n");
    exit(1);
    t[nrl][ncl] += NR_END;
    t[nrl][ncl] -= ndl;
    for(j=ncl1;j<=nch;j+) t[nrl][j]=t[nrl][j-1]+ndep;
    for(i=nrl1;i<=nrh;i+) {
    t=t[i-1]+ncol;
    t[ncl]=t[i-1][ncl]+ncol*ndep;
    for(j=ncl1;j<=nch;j+) t[j]=t[j-1]+ndep;
    /* return pointer to array of pointers to rows */
    return t;
    void free_matrix(float **m,long nrl,long nrh,long ncl,long nch)
    free((char*) (m[nrl]+ncl-1));
    free((char*) (m+nrl-1));
    void free_f3tensor(float *t,long nrl,long nrh,long ncl,long nch,long ndl,
    long ndh)
    free((char*) (t[nrl][ncl]+ndl-1));
    free((char*) (t[nrl]+ncl-1));
    free((char*) (t+nrl-1));
    // Function to replace data by its ndim-dimensional discrete Fourier transform,
    // if isign is input as 1. nn[1..ndim] is an integer array containing the
    // lengths of each dimension (number of complex values), which MUST be all
    // powers of 2. data is a real array of length twice the product of these
    // lengths, in which the data are stored as in a multidimensional complex
    // array: real and imaginary parts of each element are in consecutive
    // locations, and the rightmost index of the array increases most rapidly as
    // one proceeds along data. For a two-dimensional array, this is equivalent to
    // storing the arrays by rows. If isign is input as -1, data is replaced by its
    // inverse transform times the product of the lengths of all dimensions.
    void fourn(float data[],unsigned long nn[],int ndim,int isign)
    int idim;
    unsigned long i1,i2,i3,i2rev,i3rev,ip1,ip2,ip3,ifp1,ifp2;
    unsigned long ibit,k1,k2,n,nprev,nrem,ntot;
    double tempi,tempr;
    float theta,wi,wpi,wpr,wr,wtemp;
    for (ntot=1, idim=1; idim<=ndim; idim++)
    ntot *= nn[idim];
    nprev = 1;
    for (idim=ndim; idim>=1; idim--)
    n = nn[idim];
    nrem = ntot/(n*nprev);
    ip1=nprev << 1;
    ip2 = ip1*n;
    ip3 = ip2*nrem;
    i2rev = 1;
    for (i2=1; i2<=ip2; i2+=ip1)
    if (i2 < i2rev)
    for (i1=i2; i1<=i2+ip1-2; i1+=2)
    for (i3=i1; i3<=ip3; i3+=ip2)
    i3rev = i2rev+i3-i2;
    SWAP(data[i3],data[i3rev]);
    SWAP(data[i31],data[i3rev1]);
    ibit = ip2>>1;
    while (ibit>=ip1 && i2rev>ibit)
    i2rev -= ibit;
    ibit >>= 1;
    i2rev += ibit;
    ifp1 = ip1;
    while (ifp1 < ip2)
    ifp2 = ifp1 << 1;
    theta = 2isignPI/(ifp2/ip1);
    wtemp = sin(0.5*theta);
    wpr = -2.0wtempwtemp;
    wpi = sin(theta);
    wr = 1.0;
    wi = 0.0;
    for (i3=1; i3<=ifp1; i3+=ip1)
    for (i1=i3; i1<=i3+ip1-2; i1+=2)
    for (i2=i1; i2<=ip3; i2+=ifp2)
    k1 = i2;
    k2 = k1+ifp1;
    tempr = (float)wrdata[k2]-(float)widata[k2+1];
    tempi = (float)wrdata[k21](float)widata[k2];
    data[k2] = data[k1]-tempr;
    data[k2+1] = data[k1+1]-tempi;
    data[k1] += tempr;
    data[k1+1] += tempi;
    wr = (wtemp=wr)wpr-wiwpi+wr;
    wi = wiwprwtempwpiwi;
    ifp1 = ifp2;
    nprev *= n;
    // Function to calculate a three-dimensional Fourier transform of
    // data[1..nn1][1..nn2][1..nn3] (where nn1=1 for the case of a logically two-
    // dimensional array). This routine returns (for isign=1) the complex fast
    // Fourier transform as two complex arrays: On output, data contains the zero
    // and positive frequency values of the third frequency component, while
    // speq[1..nn1][1..2*nn2] contains the Nyquist critical frequency values of the
    // third frequency component. First (and second) frequency components are
    // stored for zero, positive, and negative frequencies, in standard wrap-around
    // order. See Numerical Recipes for description of how complex values are
    // arranged. For isign=-1, the inverse transform (times nn1nn2nn3/2 as a
    // constant multiplicative factor) is performed, with output data (viewed as
    // real array) deriving from input data (viewed as complex) and speq. For
    // inverse transforms on data not generated first by a forward transform, make
    // sure the complex input data array satisfies property 12.5.2 from NR. The
    // dimensions nn1, nn2, nn3 must always be integer powers of 2.
    void rlft3(float *data,float **speq,unsigned long nn1,unsigned long nn2,
    unsigned long nn3,int isign)
    double theta,wi,wpi,wpr,wr,wtemp;
    float c1,c2,h1r,h1i,h2r,h2i;
    unsigned long i1,i2,i3,j1,j2,j3,nn[4],ii3;
    if (1+&data[nn1][nn2][nn3]-&data[1][1][1] != nn1nn2nn3)
    fprintf(stderr,
    "rlft3: problem with dimensions or contiguity of data array\n");
    exit(1);
    c1 = 0.5;
    c2 = -0.5*isign;
    theta = 2isign(PI/nn3);
    wtemp = sin(0.5*theta);
    wpr = -2.0wtempwtemp;
    wpi = sin(theta);
    nn[1] = nn1;
    nn[2] = nn2;
    nn[3] = nn3 >> 1;
    // Case of forward transform. Here is where most all of the compute time is
    // spent. Extend data periodically into speq.
    if (isign == 1)
    fourn(&data[1][1][1]-1,nn,3,isign);
    for (i1=1; i1<=nn1; i1++)
    for (i2=1, j2=0; i2<=nn2; i2++)
    speq[i1][++j2] = data[i1][i2][1];
    speq[i1][++j2] = data[i1][i2][2];
    for (i1=1; i1<=nn1; i1++)
    // Zero frequency is its own reflection; otherwise locate corresponding
    // negative frequency in wrap-around order.
    j1 = (i1 != 1 ? nn1-i1+2 : 1);
    // Initialize trigonometric recurrence.
    wr = 1.0;
    wi = 0.0;
    for (ii3=1, i3=1; i3<=(nn3>>2)+1; i3+,ii3=2)
    for (i2=1; i2<=nn2; i2++)
    if (i3 == 1)
    j2 = (i2 != 1 ? ((nn2-i2)<<1)+3 : 1);
    h1r = c1*(data[i1][i2][1]+speq[j1][j2]);
    h1i = c1*(data[i1][i2][2]-speq[j1][j2+1]);
    h2i = c2*(data[i1][i2][1]-speq[j1][j2]);
    h2r = -c2*(data[i1][i2][2]speq[j1][j21]);
    data[i1][i2][1] = h1r+h2r;
    data[i1][i2][2] = h1i+h2i;
    speq[j1][j2] = h1r-h2r;
    speq[j1][j2+1] = h2i-h1i;
    else
    j2 = (i2 != 1 ? nn2-i2+2 : 1);
    j3 = nn3+3-(i3<<1);
    h1r = c1*(data[i1][i2][ii3]+data[j1][j2][j3]);
    h1i = c1*(data[i1][i2][ii31]-data[j1][j2][j31]);
    h2i = c2*(data[i1][i2][ii3]-data[j1][j2][j3]);
    h2r = -c2*(data[i1][i2][ii31]+data[j1][j2][j31]);
    data[i1][i2][ii3] = h1r+wrh2r-wih2i;
    data[i1][i2][ii3+1] = h1iwrh2iwih2r;
    data[j1][j2][j3] = h1r-wrh2r+wih2i;
    data[j1][j2][j3+1] = -h1iwrh2iwih2r;
    // Do the recurrence.
    wr = (wtemp=wr)wpr-wiwpi+wr;
    wi = wiwprwtempwpiwi;
    // Case of reverse transform.
    if (isign == -1)
    fourn(&data[1][1][1]-1,nn,3,isign);
    // Function to perform Gaussian blur.
    void gaussianblur(void)
    float **blur,***conv,***pop,**speqblur,**speqconv,*speqpop;
    int i,j,p,q;
    blur = d3tensor(1,1,1,lx,1,ly);
    conv = d3tensor(1,1,1,lx,1,ly);
    pop = d3tensor(1,1,1,lx,1,ly);
    speqblur = dmatrix(1,1,1,2*lx);
    speqconv = dmatrix(1,1,1,2*lx);
    speqpop = dmatrix(1,1,1,2*lx);
    // Fill population and convolution matrix.
    for (i=1; i<=lx; i++) for (j=1; j<=ly; j++)
    if (i > lx/2) p = i-1-lx;
    else p = i-1;
    if (j > ly/2) q = j-1-ly;
    else q = j-1;
    pop[1][j] = rho_0[i-1][j-1];
    conv[1][j] = 0.5*
    (erf((p+0.5)/(sqrt(2.0)(SIGMApow(SIGMAFAC,nblurs))))-
    erf((p-0.5)/(sqrt(2.0)(SIGMA*pow(SIGMAFAC,nblurs)))))
    (erf((q+0.5)/(sqrt(2.0)(SIGMApow(SIGMAFAC,nblurs))))-
    erf((q-0.5)/(sqrt(2.0)(SIGMA*pow(SIGMAFAC,nblurs)))))/(lxly);
    // Fourier transform.
    rlft3(pop,speqpop,1,lx,ly,1);
    rlft3(conv,speqconv,1,lx,ly,1);
    // Multiply pointwise.
    for (i=1; i<=lx; i++)
    for (j=1; j<=ly/2; j++)
    blur[1][2*j-1] =
    pop[1][2j-1]*conv[1][2j-1]-
    pop[1][2j]*conv[1][2j];
    blur[1][2*j] =
    pop[1][2j]*conv[1][2j-1]+
    pop[1][2j-1]*conv[1][2j];
    for (i=1; i<=lx; i++)
    speqblur[1][2*i-1] =
    speqpop[1][2i-1]*speqconv[1][2i-1]-
    speqpop[1][2i]*speqconv[1][2i];
    speqblur[1][2*i] =
    speqpop[1][2i]*speqconv[1][2i-1]+
    speqpop[1][2i-1]*speqconv[1][2i];
    // Backtransform.
    rlft3(blur,speqblur,1,lx,ly,-1);
    // Write to rho_0.
    for (i=1; i<=lx; i++) for (j=1; j<=ly; j++) rho_0[i-1][j-1] = blur[1][j];
    free_f3tensor(blur,1,1,1,lx,1,ly);
    free_f3tensor(conv,1,1,1,lx,1,ly);
    free_f3tensor(pop,1,1,1,lx,1,ly);
    free_matrix(speqblur,1,1,1,2*lx);
    free_matrix(speqconv,1,1,1,2*lx);
    free_matrix(speqpop,1,1,1,2*lx);
    // Function to initialize rho_0. The original density is blurred with width
    // SIGMA*pow(SIGMAFAC,nblurs).
    void initcond(void)
    float maxpop;
    int i,j;
    // Reconstruct population density.
    coscosft(rho_0,-1,-1);
    // There must not be negative densities.
    for (i=0; i<lx; i++) for (j=0; j<ly; j++) if (rho_0[j]<-1e10)
    fprintf(stderr,"ERROR: Negative density in DENSITYFILE.\n");
    exit(1);
    // Perform Gaussian blur.
    printf("Gaussian blur ...\n");
    gaussianblur();
    // Find the mimimum density. If it is very small suggest an increase in
    // SIGMA.
    minpop = rho_0[0][0];
    maxpop = rho_0[0][0];
    for (i=0; i<lx; i++) for (j=0; j<ly; j++) if (rho_0[j]<minpop)
    minpop = rho_0[j];
    for (i=0; i<lx; i++) for (j=0; j<ly; j++) if (rho_0[j]>maxpop)
    maxpop = rho_0[j];
    if (0<minpop && minpop<1e-8*maxpop)
    fprintf(stderr,"Minimimum population very small (%f). Integrator\n",
    minpop);
    fprintf(stderr,
    "will probably converge very slowly. You can speed up the\n");
    fprintf(stderr,"process by increasing SIGMA to a value > %f.\n",
    SIGMA*pow(SIGMAFAC,nblurs));
    // Replace rho_0 by cosine Fourier transform in both variables.
    coscosft(rho_0,1,1);
    // Function to calculate the velocity field
    void calcv(float t)
    int j,k;
    // Fill rho with Fourier coefficients.
    for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
    rho[j][k] = exp(-((PIj/lx)*(PI*j/lx)+(PI*k/ly)*(PI*k/ly))*t)rho_0[j][k];
    // Calculate the Fourier coefficients for the partial derivative of rho.
    // Store temporary results in arrays gridvx, gridvy.
    for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
    gridvx[j][k] = -(PIj/lx)rho[j][k];
    gridvy[j][k] = -(PIk/ly)rho[j][k];
    // Replace rho by cosine Fourier backtransform in both variables.
    coscosft(rho,-1,-1);
    // Replace vx by sine Fourier backtransform in the first and cosine Fourier
    // backtransform in the second variable.
    sincosft(gridvx,-1,-1);
    // Replace vy by cosine Fourier backtransform in the first and sine Fourier
    // backtransform in the second variable.
    cossinft(gridvy,-1,-1);
    // Calculate the velocity field.
    for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
    gridvx[j][k] = -gridvx[j][k]/rho[j][k];
    gridvy[j][k] = -gridvy[j][k]/rho[j][k];
    // Function to bilinearly interpolate a two-dimensional array. For higher
    // accuracy one could consider higher order interpolation schemes.
    float intpol(float **arr,float x,float y)
    int gaussx,gaussy;
    float deltax,deltay;
    // Decompose x and y into an integer part and a decimal.
    gaussx = (int)x;
    gaussy = (int)y;
    deltax = x-gaussx;
    deltay = y-gaussy;
    // Interpolate.
    if (gaussx==lx && gaussy==ly)
    return arr[gaussx][gaussy];
    if (gaussx==lx)
    return (1-deltay)arr[gaussx][gaussy]deltayarr[gaussx][gaussy1];
    if (gaussy==ly)
    return (1-deltax)arr[gaussx][gaussy]deltaxarr[gaussx1][gaussy];
    return (1-deltax)(1-deltay)arr[gaussx][gaussy]+
    (1-deltax)deltayarr[gaussx][gaussy1]
    deltax(1-deltay)arr[gaussx1][gaussy]
    deltaxdeltayarr[gaussx1][gaussy1];
    // Function to find the root of the system of equations
    // xappr-0.5h*v_x(t+h,xappr,yappr)-x[j][k]-0.5*hvx[j][k]=0,
    // yappr-0.5h*v_y(t+h,xappr,yappr)-y[j][k]-0.5*hvy[j][k]=0
    // with Newton-Raphson. Returns TRUE after sufficient convergence.
    BOOLEAN newt2(float h,float *xappr,float xguess,float *yappr,float yguess,
    int j,int k)
    float deltax,deltay,dfxdx,dfxdy,dfydx,dfydy,fx,fy;
    int gaussx,gaussxplus,gaussy,gaussyplus,i;
    // Initial guess.
    *xappr = xguess;
    *yappr = yguess;
    for (i=1; i<=IMAX; i++)
    // fx, fy are the left-hand sides of the two equations. Find
    // v_x(t+h,xappr,yappr), v_y(t+h,xappr,yappr) by interpolation.
    fx = xappr-0.5*h*intpol(gridvx,*xappr,*yappr)-x[j][k]-0.5*hvx[j][k];
    fy = yappr-0.5*h*intpol(gridvy,*xappr,*yappr)-y[j][k]-0.5*hvy[j][k];
    // Linearly approximate the partial derivatives of fx, fy with a finite
    // difference method. More elaborate techniques are possible, but this
    // quick and dirty method appears to work reasonably for our purpose.
    gaussx = (int)(*xappr);
    gaussy = (int)(*yappr);
    if (gaussx == lx) gaussxplus = 0;
    else gaussxplus = gaussx+1;
    if (gaussy == ly) gaussyplus = 0;
    else gaussyplus = gaussy+1;
    deltax = x[j][k] - gaussx;
    deltay = y[j][k] - gaussy;
    dfxdx = 1 - 0.5h
    ((1-deltay)*(gridvx[gaussxplus][gaussy]-gridvx[gaussx][gaussy])+
    deltay*(gridvx[gaussxplus][gaussyplus]-gridvx[gaussx][gaussyplus]));
    dfxdy = -0.5h
    ((1-deltax)*(gridvx[gaussx][gaussyplus]-gridvx[gaussx][gaussy])+
    deltax*(gridvx[gaussxplus][gaussyplus]-gridvx[gaussxplus][gaussy]));
    dfydx = -0.5h
    ((1-deltay)*(gridvy[gaussxplus][gaussy]-gridvy[gaussx][gaussy])+
    deltay*(gridvy[gaussxplus][gaussyplus]-gridvy[gaussx][gaussyplus]));
    dfydy = 1 - 0.5h
    ((1-deltax)*(gridvy[gaussx][gaussyplus]-gridvy[gaussx][gaussy])+
    deltax*(gridvy[gaussxplus][gaussyplus]-gridvy[gaussxplus][gaussy]));
    // If the current approximation is (xappr,yappr) for the zero of
    // (fx(x,y),fy(x,y)) and J is the Jacobian, then we can approximate (in
    // vector notation) for |delta|<<1:
    // f((xappr,yappr)+delta) = f(xappr,yappr)+J*delta.
    // Setting f((xappr,yappr)+delta)=0 we obtain a set of linear equations
    // for the correction delta which moves f closer to zero, namely
    // J*delta = -f.
    // The improved approximation is then x = xappr+delta.
    // The process will be iterated until convergence is reached.
    if ((fx*fx + fy*fy) < TOLF) return TRUE;
    deltax = (fy*dfxdy - fxdfydy)/(dfxdxdfydy - dfxdy*dfydx);
    deltay = (fx*dfydx - fydfxdx)/(dfxdxdfydy - dfxdy*dfydx);
    if ((deltax*deltax + deltay*deltay) < TOLX) return TRUE;
    *xappr += deltax;
    *yappr += deltay;
    //printf("deltax %f, deltay %f\n",deltax,deltay);
    fprintf(stderr,"newt2 failed, increasing sigma to %f.\n",
    SIGMA*pow(SIGMAFAC,nblurs));
    return FALSE;
    // Function to integrate the nonlinear Volterra equation. Returns TRUE after
    // the displacement field converged, after MAXINTSTEPS integration steps, or
    // if the time exceeds TIMELIMIT.
    BOOLEAN nonlinvoltra(void)
    BOOLEAN stepsize_ok;
    #ifdef DISPLFILE
    FILE *displfile = fopen(DISPLFILE);
    #endif
    float h,maxchange=INFTY,t,vxplus,vyplus,xguess,yguess;
    int i,j,k;
    do
    initcond();
    nblurs++;
    if (minpop<0.0)
    fprintf(stderr,
    "Minimum population negative, will increase sigma to %f\n",
    SIGMA*pow(SIGMAFAC,nblurs));
    while (minpop<0.0);
    h = HINITIAL;
    t = 0; // Start at time t=0.
    // (x[j][k],y[j][k]) is the position for the element that was at position
    // (j,k) at time t=0.
    for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
    x[j][k] = j;
    y[j][k] = k;
    calcv(0.0);
    // (gridvx[j][k],gridvy[j][k]) is the velocity at position (j,k).
    // (vx[j][k],vy[j][k]) is the velocity at position (x[j][k],y[j][k]).
    // At t=0 they are of course identical.
    for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
    vx[j][k] = gridvx[j][k];
    vy[j][k] = gridvy[j][k];
    i = 1; // i counts the integration steps.
    // Here is the integrator.
    do
    stepsize_ok = TRUE;
    calcv(t+h);
    for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
    // First take a naive integration step. The velocity at time t+h for
    // the element [j][k] is approximately
    // v(th,x[j][k]+hvx[j][k],y[j][k]hvy[j][k]).
    // The components, call them vxplus and vyplus, are interpolated from
    // gridvx and gridvy.
    vxplus = intpol(gridvx,x[j][k]hvx[j][k],y[j][k]hvy[j][k]);
    vyplus = intpol(gridvy,x[j][k]hvx[j][k],y[j][k]hvy[j][k]);
    // Based on (vx[j][k],vy[j][k]) and (vxplus,vyplus) we expect the
    // new position at time t+h to be:
    xguess = x[j][k] + 0.5h(vx[j][k]+vxplus);
    yguess = y[j][k] + 0.5h(vy[j][k]+vyplus);
    // Then we make a better approximation by solving the two nonlinear
    // equations:
    // xappr[j][k]-0.5hv_x(t+h,xappr[j][k],yappr[j][k])-
    // x[j][k]-0.5hvx[j][k]=0,
    // yappr[j][k]-0.5hv_y(t+h,xappr[j][k],yappr[j][k])-
    // y[j][k]-0.5hvy[j][k]=0
    // with Newton-Raphson and (xguess,yguess) as initial guess.
    // If newt2 fails to converge, exit nonlinvoltra.
    if (!newt2(h,&xappr[j][k],xguess,&yappr[j][k],yguess,j,k))
    return FALSE;
    // If the integration step was too large reduce the step size.
    if ((xguess-xappr[j][k])*(xguess-xappr[j][k])+
    (yguess-yappr[j][k])*(yguess-yappr[j][k]) > TOLINT)
    if (h<MINH)
    fprintf(stderr,
    "Time step below %f, increasing SIGMA to %f\n",
    h,SIGMA*pow(SIGMAFAC,nblurs));
    nblurs++;
    return FALSE;
    h /= 10;
    stepsize_ok = FALSE;
    break;
    if (!stepsize_ok) continue;
    else
    t += h;
    maxchange = 0.0; // Monitor the maximum change in positions.
    for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
    if ((x[j][k]-xappr[j][k])*(x[j][k]-xappr[j][k])+
    (y[j][k]-yappr[j][k])*(y[j][k]-yappr[j][k]) > maxchange)
    maxchange =
    (x[j][k]-xappr[j][k])*(x[j][k]-xappr[j][k])+
    (y[j][k]-yappr[j][k])*(y[j][k]-yappr[j][k]);
    x[j][k] = xappr[j][k];
    y[j][k] = yappr[j][k];
    vx[j][k] = intpol(gridvx,xappr[j][k],yappr[j][k]);
    vy[j][k] = intpol(gridvy,xappr[j][k],yappr[j][k]);
    h *= 1.2; // Make the next integration step larger.
    if (i%10==0) printf("time %f\n",t);
    i++;
    } while (i<MAXINTSTEPS && t<TIMELIMIT && maxchange>CONVERGENCE);
    if (maxchange>CONVERGENCE)
    fprintf(stderr,
    "WARNING: Insufficient convergence within %i steps, time %f.\n",
    MAXINTSTEPS,TIMELIMIT);
    #ifdef DISPLFILE
    // Write displacement field to file.
    fprintf(displfile,"time %f\nminx %f\nmaxx %f\nminy %f\nmaxy %f\n",
    t,minx,maxx,miny,maxy);
    fprintf(displfile,"sigma %f\n",SIGMA*pow(SIGMAFAC,nblurs-1));
    fprintf(displfile,"background %f\nlx\nly\n\n",0,lx,ly);
    for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
    fprintf(displfile,"j %i, k %i, x %f, y %f\n",j,k,x[j][k],y[j][k]);
    fclose(displfile);
    #endif
    return TRUE;
    // Function to transform points according to displacement field.
    POINT transf(POINT p)
    float deltax,deltay,den,t,u;
    int gaussx,gaussy;
    POINT a,b,c,d,ptr;
    p.x = (p.x-minx)*lx/(maxx-minx);
    p.y = (p.y-miny)*ly/(maxy-miny);
    gaussx = (int)p.x;
    gaussy = (int)p.y;
    if (gaussx<0 || gaussx>lx || gaussy<0 || gaussy>ly)
    fprintf(stderr,"ERROR: Coordinate limits exceeded in transf.\n");
    exit(1);
    deltax = p.x - gaussx;
    deltay = p.y - gaussy;
    // The transformed point is the intersection of the lines:
    // (I) connecting
    // (1-deltax)(x,y[gaussx][gaussy])deltax(x,y[gaussx1][gaussy])
    // and
    // (1-deltax)(x,y[gaussx][gaussy1])+deltax(x,y[gaussx+1][gaussy1])
    // (II) connecting
    // (1-deltay)(x,y[gaussx][gaussy])deltay(x,y[gaussx][gaussy1])
    // and
    // (1-deltay)(x,y[gaussx1][gaussy])+deltay(x,y[gaussx+1][gaussy1]).
    // Call these four points a, b, c and d.
    a.x = (1-deltax)*x[gaussx][gaussy] + deltax*x[gaussx+1][gaussy];
    a.y = (1-deltax)*y[gaussx][gaussy] + deltax*y[gaussx+1][gaussy];
    b.x = (1-deltax)*x[gaussx][gaussy+1] + deltax*x[gaussx1][gaussy1];
    b.y = (1-deltax)*y[gaussx][gaussy+1] + deltax*y[gaussx1][gaussy1];
    c.x = (1-deltay)*x[gaussx][gaussy] + deltay*x[gaussx][gaussy+1];
    c.y = (1-deltay)*y[gaussx][gaussy] + deltay*y[gaussx][gaussy+1];
    d.x = (1-deltay)*x[gaussx+1][gaussy] + deltay*x[gaussx1][gaussy1];
    d.y = (1-deltay)*y[gaussx+1][gaussy] + deltay*y[gaussx1][gaussy1];
    // Solve the vector equation a+t(b-a) = c+u(d-c) for the scalars t, u.
    if (fabs(den=(b.x-a.x)(c.y-d.y)+(a.y-b.y)(c.x-d.x))<1e-12)
    fprintf(stderr,"ERROR: Transformed area element has parallel edges.\n");
    exit(1);
    t = ((c.x-a.x)(c.y-d.y)+(a.y-c.y)(c.x-d.x))/den;
    u = ((b.x-a.x)(c.y-a.y)+(a.y-b.y)(c.x-a.x))/den;
    if (t<-1e-3|| t>1+1e-3 || u<-1e-3 || u>1+1e-3)
    fprintf(stderr,"WARNING: Transformed area element non-convex.\n");
    ptr.x = (1-(a.x+t(b.x-a.x))/lx)minx + ((a.x+t(b.x-a.x))/lx)maxx;
    ptr.y = (1-(a.y+t(b.y-a.y))/ly)miny + ((a.y+t(b.y-a.y))/ly)maxy;
    return ptr;
    // Function to read spatial features from user-specified file and map to
    // cartogram.
    void cartogram(void)
    char id[LINELENGTH],line[LINELENGTH];
    FILE infile,outfile;
    float xcoord,ycoord;
    POINT p;
    infile = fopen(MAPGENFILE);
    outfile = fopen(CARTGENFILE,"w");
    while (!readline(line,infile))
    if (sscanf(line,"%s %f %f",&id,&xcoord,&ycoord)==3)
    p.x = xcoord;
    p.y = ycoord;
    p = transf(p);
    fprintf(outfile,"%s %f %f\n",id,p.x,p.y);
    else if (sscanf(line,"%f %f",&xcoord,&ycoord)==2)
    p.x = xcoord;
    p.y = ycoord;
    p = transf(p);
    fprintf(outfile,"%f %f\n",p.x,p.y);
    else
    sscanf(line,"%s",&id);
    fprintf(outfile,"%s\n",id);
    fclose(infile);
    fclose(outfile);
    main(void)
    BOOLEAN n;
    char c;
    FILE genfile,psfile = fopen(MAP2PS);
    float oldlx,oldly,oldmaxx,oldmaxy,oldminx,oldminy,totarea;
    int i,polyctr,regctr;
    // Read the polygon coordinates.
    if ((genfile = fopen(MAPGENFILE)) == NULL)
    fprintf(stderr,"ERROR: Cannot find MAPGENFILE\n");
    exit(1);
    countpoly(genfile);
    fclose(genfile);
    genfile = fopen(MAPGENFILE);
    countcorn(genfile);
    fclose(genfile);
    genfile = fopen(MAPGENFILE);
    readcorn(genfile);
    fclose(genfile);
    makeregion();
    printf("%i polygon(s), %i region(s)\n",npoly,nregion);
    printf("lx=%i, ly=%i\n",lx,ly);
    // Calculate total area.
    //totarea = 0.0;
    //for (regctr=0; regctr<nregion; regctr++)
    // printf("region %i has area %f, contains %i polygons\n",regionid[regctr],
    // regionarea(nregcorn[regctr],regcorn[regctr]),npolyinreg[regctr]);
    // totarea += regionarea(nregcorn[regctr],regcorn[regctr]);
    //printf("totarea = %f\n",totarea);
    // Make map.
    pspicture(psfile);
    fclose(psfile);
    // Allocate memory for arrays.
    gridvx = (float*)malloc((lx+1)*sizeof(float));
    gridvy = (float*)malloc((lx+1)*sizeof(float));
    rho = (float*)malloc((lx+1)*sizeof(float));
    rho_0 = (float*)malloc((lx+1)*sizeof(float));
    vx = (float*)malloc((lx+1)*sizeof(float));
    vy = (float*)malloc((lx+1)*sizeof(float));
    x = (float*)malloc((lx+1)*sizeof(float));
    xappr = (float*)malloc((lx+1)*sizeof(float));
    y = (float*)malloc((lx+1)*sizeof(float));
    yappr = (float*)malloc((lx+1)*sizeof(float));
    within = (int*)malloc((lx+1)*sizeof(int));
    for (i=0; i<=lx; i++)
    gridvx = (float)malloc((ly+1)sizeof(float));
    gridvy = (float)malloc((ly+1)sizeof(float));
    rho = (float)malloc((ly+1)sizeof(float));
    rho_0 = (float)malloc((ly+1)sizeof(float));
    vx = (float)malloc((ly+1)sizeof(float));
    vy = (float)malloc((ly+1)sizeof(float));
    x = (float)malloc((ly+1)sizeof(float));
    xappr = (float)malloc((ly+1)sizeof(float));
    y = (float)malloc((ly+1)sizeof(float));
    yappr = (float)malloc((ly+1)sizeof(float));
    within = (int)malloc((ly+1)sizeof(int));
    // Digitize the density.
    bboxes();
    interior();
    digdens();
    // Solve the diffusion equation.
    do n = nonlinvoltra(); while (!n);
    // Print cartogram generate file.
    cartogram();
    // Read the transformed polygon coordinates.
    oldlx = lx;
    oldly = ly;
    oldmaxx = maxx;
    oldmaxy = maxy;
    oldminx = minx;
    oldminy = miny;
    genfile = fopen(CARTGENFILE,"r");
    countpoly(genfile);
    fclose(genfile);
    genfile = fopen(CARTGENFILE,"r");
    countcorn(genfile);
    fclose(genfile);
    lx = oldlx;
    ly = oldly;
    maxx = oldmaxx;
    maxy = oldmaxy;
    minx = oldminx;
    miny = oldminy;
    genfile = fopen(CARTGENFILE,"r");
    readcorn(genfile);
    fclose(genfile);
    makeregion();
    // Make cartogram
    psfile = fopen(CART2PS);
    pspicture(psfile);
    fclose(psfile);
    The part of the code where the bus error occurs is this:
    void interior(void)
    int i,inhowmanyregions,inregion[2],j,k,l,m,n,regctr;
    // Initialize within[][]. -1 means outside all regions.
    for (i=0; i<=lx; i++) for (j=0; j<=ly; j++) within[j] = -1;
    // Fill within[][].
    for (i=0; i<nregion; i++) for (j=0; j<npolyinreg; j++)
    for (k=0, n=npolycorn[polyinreg[j]]-1;
    k<npolycorn[polyinreg[j]]; n=k++)
    for (l=(int)ceil(MIN(polycorn[polyinreg[j]][k-1].y,
    polycorn[polyinreg[j]][k].y));
    l<MAX(polycorn[polyinreg[j]][k-1].y,
    polycorn[polyinreg[j]][k].y); l++)
    for (m=(int)floor(bbminx[polyinreg[j]]);
    m<(polycorn[polyinreg[j]][n].x-
    polycorn[polyinreg[j]][k].x)*
    (l-polycorn[polyinreg[j]][k].y)/
    (polycorn[polyinreg[j]][n].y-
    polycorn[polyinreg[j]][k].y)+
    polycorn[polyinreg[j]][k].x;
    m++)
    within[m][l] = i-within[m][l]-1;
    I really have no idea what is going on. Can anyone help?
    Thanks,
    mooseguy

    orangekay wrote:
    That is absolutely unreadable.
    I agree completely. How about also providing a link to a set of input files so that we could actually run the code ourselves? Otherwise, there is no chance to debug the source code, it is just a mess.
    You might have better luck with an older version of the file. To quote the comments:
    // Modified on March 31, 2005. Initialized maxchange in nonlinvoltra() as
    // INFTY. Replaced crnmbr() by a similar, but faster routine interior().
    // Many thanks to Stuart Anderson for pointing out this shortcut.
    I suspect that the "interior" function is just plain incorrect. It doesn't matter if it runs on some other OS. Something about it is wrong and the code is so cryptic that it can't be deciphered.

  • ATA bus error

    Hello,
    I have some problems with hard drive on my laptop. Sometimes everything freezes for few seconds (usually during start-up, but sometimes after I login) and I get some errors. After that, everything seems to be working fine.
    Part of dmesg with errors:
    [ 10.019887] ata1.00: cmd 60/00:10:10:da:59/01:00:0f:00:00/40 tag 2 ncq 131072 in
    res 41/84:00:f2:da:59/00:01:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 10.019968] ata1.00: status: { DRDY ERR }
    [ 10.019992] ata1.00: error: { ICRC ABRT }
    [ 10.020017] ata1: hard resetting link
    [ 10.339913] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
    [ 10.443163] ata1.00: configured for UDMA/133
    [ 10.443191] ata1: EH complete
    [ 10.516832] ata1.00: exception Emask 0x0 SAct 0x7000 SErr 0x0 action 0x6
    [ 10.516877] ata1.00: irq_stat 0x40000008
    [ 10.516902] ata1.00: failed command: READ FPDMA QUEUED
    [ 10.516935] ata1.00: cmd 60/e8:60:e8:16:3b/00:00:0f:00:00/40 tag 12 ncq 118784 in
    res 41/84:e8:8c:17:3b/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 10.517017] ata1.00: status: { DRDY ERR }
    [ 10.517041] ata1.00: error: { ICRC ABRT }
    [ 10.517067] ata1: hard resetting link
    [ 10.836973] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
    [ 10.964972] ata1.00: configured for UDMA/133
    [ 10.965002] ata1: EH complete
    [ 10.984003] ata1: limiting SATA link speed to 3.0 Gbps
    [ 10.984015] ata1.00: exception Emask 0x0 SAct 0x60020000 SErr 0x0 action 0x6
    [ 10.984106] ata1.00: irq_stat 0x40000008
    [ 10.984157] ata1.00: failed command: READ FPDMA QUEUED
    [ 10.984225] ata1.00: cmd 60/20:e8:40:6e:b0/00:00:13:00:00/40 tag 29 ncq 16384 in
    res 41/84:20:46:6e:b0/00:00:13:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 10.984397] ata1.00: status: { DRDY ERR }
    [ 10.984445] ata1.00: error: { ICRC ABRT }
    [ 10.984497] ata1: hard resetting link
    [ 11.304016] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
    [ 11.409308] ata1.00: configured for UDMA/133
    [ 11.409343] ata1: EH complete
    [ 11.441025] vboxpci: IOMMU not found (not registered)
    [ 11.543239] bbswitch: version 0.8
    [ 11.543246] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
    [ 11.543252] bbswitch: Found discrete VGA device 0000:03:00.0: \_SB_.PCI0.RP05.PEGP
    [ 11.543262] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20141107/nsarguments-95)
    [ 11.543355] bbswitch: detected an Optimus _DSM function
    [ 11.543372] pci 0000:03:00.0: enabling device (0006 -> 0007)
    [ 11.543434] bbswitch: Succesfully loaded. Discrete card 0000:03:00.0 is on
    [ 11.545169] bbswitch: disabling discrete graphics
    [ 11.545181] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20141107/nsarguments-95)
    [ 13.327790] r8169 0000:01:00.0 enp1s0: link up
    [ 20.651344] ata1.00: exception Emask 0x0 SAct 0x2000000 SErr 0x0 action 0x6
    [ 20.651349] ata1.00: irq_stat 0x40000008
    [ 20.651353] ata1.00: failed command: READ FPDMA QUEUED
    [ 20.651359] ata1.00: cmd 60/08:c8:98:86:ae/00:00:10:00:00/40 tag 25 ncq 4096 in
    res 41/84:08:98:86:ae/00:00:10:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 20.651361] ata1.00: status: { DRDY ERR }
    [ 20.651363] ata1.00: error: { ICRC ABRT }
    [ 20.651367] ata1: hard resetting link
    [ 20.971293] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
    [ 21.080441] ata1.00: configured for UDMA/133
    [ 21.080467] ata1: EH complete
    [ 21.121498] ata1.00: exception Emask 0x0 SAct 0x20000000 SErr 0x0 action 0x6
    [ 21.121503] ata1.00: irq_stat 0x40000008
    [ 21.121507] ata1.00: failed command: READ FPDMA QUEUED
    [ 21.121513] ata1.00: cmd 60/00:e8:00:f4:69/01:00:0f:00:00/40 tag 29 ncq 131072 in
    res 41/84:00:ee:f4:69/00:01:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 21.121515] ata1.00: status: { DRDY ERR }
    [ 21.121517] ata1.00: error: { ICRC ABRT }
    [ 21.121521] ata1: hard resetting link
    [ 21.441483] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
    [ 21.546775] ata1.00: configured for UDMA/133
    [ 21.546795] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 21.546798] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 21.546801] sd 0:0:0:0: [sda] ASC=0x47 ASCQ=0x0
    [ 21.546802] sd 0:0:0:0: [sda] CDB:
    [ 21.546804] cdb[0]=0x28: 28 00 0f 69 f4 00 00 01 00 00
    [ 21.546812] blk_update_request: I/O error, dev sda, sector 258601984
    [ 21.546829] ata1: EH complete
    [ 21.606131] ata1.00: exception Emask 0x0 SAct 0x200 SErr 0x0 action 0x6
    [ 21.606139] ata1.00: irq_stat 0x40000008
    [ 21.606145] ata1.00: failed command: READ FPDMA QUEUED
    [ 21.606155] ata1.00: cmd 60/88:48:00:d8:36/00:00:0f:00:00/40 tag 9 ncq 69632 in
    res 41/84:88:04:d8:36/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 21.606160] ata1.00: status: { DRDY ERR }
    [ 21.606163] ata1.00: error: { ICRC ABRT }
    [ 21.606170] ata1: hard resetting link
    [ 21.924963] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
    [ 22.035385] ata1.00: configured for UDMA/133
    [ 22.035408] ata1: EH complete
    [ 22.111984] ata1: limiting SATA link speed to 1.5 Gbps
    [ 22.111991] ata1.00: exception Emask 0x0 SAct 0x1000000 SErr 0x0 action 0x6
    [ 22.111994] ata1.00: irq_stat 0x40000008
    [ 22.111997] ata1.00: failed command: READ FPDMA QUEUED
    [ 22.112003] ata1.00: cmd 60/90:c0:48:39:32/00:00:0f:00:00/40 tag 24 ncq 73728 in
    res 41/84:90:8a:39:32/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 22.112005] ata1.00: status: { DRDY ERR }
    [ 22.112007] ata1.00: error: { ICRC ABRT }
    [ 22.112011] ata1: hard resetting link
    [ 22.431783] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 22.535011] ata1.00: configured for UDMA/133
    [ 22.535038] ata1: EH complete
    [ 22.618877] ata1.00: exception Emask 0x0 SAct 0x1e SErr 0x0 action 0x6
    [ 22.618886] ata1.00: irq_stat 0x40000008
    [ 22.618891] ata1.00: failed command: READ FPDMA QUEUED
    [ 22.618901] ata1.00: cmd 60/00:08:08:2c:32/01:00:0f:00:00/40 tag 1 ncq 131072 in
    res 41/84:00:70:2c:32/00:01:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 22.618906] ata1.00: status: { DRDY ERR }
    [ 22.618909] ata1.00: error: { ICRC ABRT }
    [ 22.618920] ata1: hard resetting link
    [ 22.938608] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 23.023643] ata1.00: configured for UDMA/133
    [ 23.023682] ata1: EH complete
    [ 53.428943] ata1.00: exception Emask 0x1 SAct 0x7fffffff SErr 0x0 action 0x6 frozen
    [ 53.428953] ata1.00: irq_stat 0x40000008
    [ 53.428960] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.428971] ata1.00: cmd 60/00:00:00:e8:31/01:00:10:00:00/40 tag 0 ncq 131072 in
    res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x5 (timeout)
    [ 53.428976] ata1.00: status: { DRDY }
    [ 53.428981] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.428990] ata1.00: cmd 60/08:08:20:fe:e9/00:00:0f:00:00/40 tag 1 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.428994] ata1.00: status: { DRDY }
    [ 53.428998] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429006] ata1.00: cmd 60/08:10:28:fe:e9/00:00:0f:00:00/40 tag 2 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429010] ata1.00: status: { DRDY }
    [ 53.429014] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429022] ata1.00: cmd 60/08:18:30:fe:e9/00:00:0f:00:00/40 tag 3 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429026] ata1.00: status: { DRDY }
    [ 53.429029] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429037] ata1.00: cmd 60/08:20:38:fe:e9/00:00:0f:00:00/40 tag 4 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429042] ata1.00: status: { DRDY }
    [ 53.429045] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429053] ata1.00: cmd 60/08:28:40:fe:e9/00:00:0f:00:00/40 tag 5 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429057] ata1.00: status: { DRDY }
    [ 53.429061] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429069] ata1.00: cmd 60/08:30:48:fe:e9/00:00:0f:00:00/40 tag 6 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429073] ata1.00: status: { DRDY }
    [ 53.429076] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429084] ata1.00: cmd 60/08:38:50:fe:e9/00:00:0f:00:00/40 tag 7 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429089] ata1.00: status: { DRDY }
    [ 53.429092] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429100] ata1.00: cmd 60/08:40:58:fe:e9/00:00:0f:00:00/40 tag 8 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429104] ata1.00: status: { DRDY }
    [ 53.429108] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429116] ata1.00: cmd 60/08:48:60:fe:e9/00:00:0f:00:00/40 tag 9 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429120] ata1.00: status: { DRDY }
    [ 53.429124] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429132] ata1.00: cmd 60/08:50:68:fe:e9/00:00:0f:00:00/40 tag 10 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429136] ata1.00: status: { DRDY }
    [ 53.429139] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429148] ata1.00: cmd 60/08:58:70:fe:e9/00:00:0f:00:00/40 tag 11 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429152] ata1.00: status: { DRDY }
    [ 53.429155] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429163] ata1.00: cmd 60/08:60:78:fe:e9/00:00:0f:00:00/40 tag 12 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429168] ata1.00: status: { DRDY }
    [ 53.429171] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429179] ata1.00: cmd 60/08:68:80:fe:e9/00:00:0f:00:00/40 tag 13 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429183] ata1.00: status: { DRDY }
    [ 53.429187] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429195] ata1.00: cmd 60/08:70:18:e8:a9/00:00:16:00:00/40 tag 14 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429199] ata1.00: status: { DRDY }
    [ 53.429203] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429211] ata1.00: cmd 60/08:78:90:fe:e9/00:00:0f:00:00/40 tag 15 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429215] ata1.00: status: { DRDY }
    [ 53.429218] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429226] ata1.00: cmd 60/08:80:98:fe:e9/00:00:0f:00:00/40 tag 16 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429230] ata1.00: status: { DRDY }
    [ 53.429234] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429242] ata1.00: cmd 60/08:88:a0:fe:e9/00:00:0f:00:00/40 tag 17 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429246] ata1.00: status: { DRDY }
    [ 53.429250] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429258] ata1.00: cmd 60/08:90:a8:fe:e9/00:00:0f:00:00/40 tag 18 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429262] ata1.00: status: { DRDY }
    [ 53.429265] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429273] ata1.00: cmd 60/08:98:b0:fe:e9/00:00:0f:00:00/40 tag 19 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429277] ata1.00: status: { DRDY }
    [ 53.429281] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429289] ata1.00: cmd 60/08:a0:b8:fe:e9/00:00:0f:00:00/40 tag 20 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429293] ata1.00: status: { DRDY }
    [ 53.429297] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429305] ata1.00: cmd 60/08:a8:c0:fe:e9/00:00:0f:00:00/40 tag 21 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429309] ata1.00: status: { DRDY }
    [ 53.429312] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429320] ata1.00: cmd 60/08:b0:c8:fe:e9/00:00:0f:00:00/40 tag 22 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429325] ata1.00: status: { DRDY }
    [ 53.429328] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429336] ata1.00: cmd 60/08:b8:d0:fe:e9/00:00:0f:00:00/40 tag 23 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429340] ata1.00: status: { DRDY }
    [ 53.429344] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429352] ata1.00: cmd 60/08:c0:d8:fe:e9/00:00:0f:00:00/40 tag 24 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429356] ata1.00: status: { DRDY }
    [ 53.429360] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429367] ata1.00: cmd 60/08:c8:e0:fe:e9/00:00:0f:00:00/40 tag 25 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429372] ata1.00: status: { DRDY }
    [ 53.429375] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429383] ata1.00: cmd 60/08:d0:e8:fe:e9/00:00:0f:00:00/40 tag 26 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429387] ata1.00: status: { DRDY }
    [ 53.429391] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429399] ata1.00: cmd 60/08:d8:f0:fe:e9/00:00:0f:00:00/40 tag 27 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429403] ata1.00: status: { DRDY }
    [ 53.429407] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429414] ata1.00: cmd 60/08:e0:f8:fe:e9/00:00:0f:00:00/40 tag 28 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429419] ata1.00: status: { DRDY }
    [ 53.429422] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429430] ata1.00: cmd 60/08:e8:00:ff:e9/00:00:0f:00:00/40 tag 29 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429435] ata1.00: status: { DRDY }
    [ 53.429438] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.429446] ata1.00: cmd 60/08:f0:88:fe:e9/00:00:0f:00:00/40 tag 30 ncq 4096 in
    res 40/00:f0:88:fe:e9/00:00:0f:00:00/40 Emask 0x1 (device error)
    [ 53.429450] ata1.00: status: { DRDY }
    [ 53.429458] ata1: hard resetting link
    [ 53.749173] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 53.836070] ata1.00: configured for UDMA/133
    [ 53.836079] ata1.00: device reported invalid CHS sector 0
    [ 53.836116] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836119] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836121] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836123] sd 0:0:0:0: [sda] CDB:
    [ 53.836125] cdb[0]=0x28: 28 00 0f e9 fe 20 00 00 08 00
    [ 53.836133] blk_update_request: I/O error, dev sda, sector 266993184
    [ 53.836148] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836151] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836153] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836154] sd 0:0:0:0: [sda] CDB:
    [ 53.836155] cdb[0]=0x28: 28 00 0f e9 fe 28 00 00 08 00
    [ 53.836162] blk_update_request: I/O error, dev sda, sector 266993192
    [ 53.836167] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836169] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836171] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836173] sd 0:0:0:0: [sda] CDB:
    [ 53.836174] cdb[0]=0x28: 28 00 0f e9 fe 30 00 00 08 00
    [ 53.836180] blk_update_request: I/O error, dev sda, sector 266993200
    [ 53.836185] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836187] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836189] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836190] sd 0:0:0:0: [sda] CDB:
    [ 53.836191] cdb[0]=0x28: 28 00 0f e9 fe 38 00 00 08 00
    [ 53.836198] blk_update_request: I/O error, dev sda, sector 266993208
    [ 53.836202] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836204] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836206] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836208] sd 0:0:0:0: [sda] CDB:
    [ 53.836209] cdb[0]=0x28: 28 00 0f e9 fe 40 00 00 08 00
    [ 53.836215] blk_update_request: I/O error, dev sda, sector 266993216
    [ 53.836220] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836222] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836224] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836225] sd 0:0:0:0: [sda] CDB:
    [ 53.836226] cdb[0]=0x28: 28 00 0f e9 fe 48 00 00 08 00
    [ 53.836232] blk_update_request: I/O error, dev sda, sector 266993224
    [ 53.836237] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836239] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836241] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836242] sd 0:0:0:0: [sda] CDB:
    [ 53.836243] cdb[0]=0x28: 28 00 0f e9 fe 50 00 00 08 00
    [ 53.836249] blk_update_request: I/O error, dev sda, sector 266993232
    [ 53.836253] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836255] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836257] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836259] sd 0:0:0:0: [sda] CDB:
    [ 53.836260] cdb[0]=0x28: 28 00 0f e9 fe 58 00 00 08 00
    [ 53.836266] blk_update_request: I/O error, dev sda, sector 266993240
    [ 53.836270] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836272] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836274] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836276] sd 0:0:0:0: [sda] CDB:
    [ 53.836277] cdb[0]=0x28: 28 00 0f e9 fe 60 00 00 08 00
    [ 53.836283] blk_update_request: I/O error, dev sda, sector 266993248
    [ 53.836287] sd 0:0:0:0: [sda] UNKNOWN Result: hostbyte=0x00 driverbyte=0x08
    [ 53.836289] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
    [ 53.836291] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
    [ 53.836293] sd 0:0:0:0: [sda] CDB:
    [ 53.836294] cdb[0]=0x28: 28 00 0f e9 fe 68 00 00 08 00
    [ 53.836300] blk_update_request: I/O error, dev sda, sector 266993256
    [ 53.836354] ata1: EH complete
    [ 53.922776] ata1.00: exception Emask 0x0 SAct 0x20 SErr 0x0 action 0x6
    [ 53.922827] ata1.00: irq_stat 0x40000008
    [ 53.922855] ata1.00: failed command: READ FPDMA QUEUED
    [ 53.922891] ata1.00: cmd 60/00:28:38:3f:04/01:00:10:00:00/40 tag 5 ncq 131072 in
    res 41/84:00:5a:3f:04/00:01:10:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 53.922981] ata1.00: status: { DRDY ERR }
    [ 53.923007] ata1.00: error: { ICRC ABRT }
    [ 53.923037] ata1: hard resetting link
    [ 54.242882] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 54.357940] ata1.00: configured for UDMA/133
    [ 54.357967] ata1: EH complete
    [ 54.413337] ata1.00: limiting speed to UDMA/100:PIO4
    [ 54.413343] ata1.00: exception Emask 0x0 SAct 0x100 SErr 0x0 action 0x6
    [ 54.413387] ata1.00: irq_stat 0x40000008
    [ 54.413412] ata1.00: failed command: READ FPDMA QUEUED
    [ 54.413445] ata1.00: cmd 60/20:40:c0:04:b1/00:00:16:00:00/40 tag 8 ncq 16384 in
    res 41/84:20:d4:04:b1/00:00:16:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 54.413527] ata1.00: status: { DRDY ERR }
    [ 54.413551] ata1.00: error: { ICRC ABRT }
    [ 54.413578] ata1: hard resetting link
    [ 54.733264] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 54.835393] ata1.00: configured for UDMA/100
    [ 54.835419] ata1: EH complete
    [ 54.883575] ata1.00: exception Emask 0x0 SAct 0x8 SErr 0x0 action 0x6
    [ 54.883618] ata1.00: irq_stat 0x40000008
    [ 54.883643] ata1.00: failed command: READ FPDMA QUEUED
    [ 54.883675] ata1.00: cmd 60/08:18:e0:04:b1/00:00:16:00:00/40 tag 3 ncq 4096 in
    res 41/84:08:e4:04:b1/00:00:16:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 54.883756] ata1.00: status: { DRDY ERR }
    [ 54.883779] ata1.00: error: { ICRC ABRT }
    [ 54.883805] ata1: hard resetting link
    [ 55.203636] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 55.301754] ata1.00: configured for UDMA/100
    [ 55.301780] ata1: EH complete
    [ 55.357428] ata1.00: exception Emask 0x0 SAct 0x40000 SErr 0x0 action 0x6
    [ 55.357474] ata1.00: irq_stat 0x40000008
    [ 55.357500] ata1.00: failed command: READ FPDMA QUEUED
    [ 55.357532] ata1.00: cmd 60/f0:90:e0:34:a5/00:00:0e:00:00/40 tag 18 ncq 122880 in
    res 41/84:f0:ea:34:a5/00:00:0e:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 55.357613] ata1.00: status: { DRDY ERR }
    [ 55.357636] ata1.00: error: { ICRC ABRT }
    [ 55.357661] ata1: hard resetting link
    [ 55.677344] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 55.779200] ata1.00: configured for UDMA/100
    [ 55.779228] ata1: EH complete
    [ 55.954538] ata1.00: exception Emask 0x0 SAct 0xc0000 SErr 0x0 action 0x6
    [ 55.954585] ata1.00: irq_stat 0x40000008
    [ 55.954610] ata1.00: failed command: READ FPDMA QUEUED
    [ 55.954643] ata1.00: cmd 60/00:90:00:eb:a4/01:00:0e:00:00/40 tag 18 ncq 131072 in
    res 41/84:00:10:eb:a4/00:01:0e:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 55.954725] ata1.00: status: { DRDY ERR }
    [ 55.954748] ata1.00: error: { ICRC ABRT }
    [ 55.954774] ata1: hard resetting link
    [ 56.274496] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 56.367864] ata1.00: configured for UDMA/100
    [ 56.367921] ata1: EH complete
    [ 56.448401] ata1.00: limiting speed to UDMA/33:PIO4
    [ 56.448412] ata1.00: exception Emask 0x0 SAct 0x4 SErr 0x0 action 0x6
    [ 56.448483] ata1.00: irq_stat 0x40000008
    [ 56.448524] ata1.00: failed command: READ FPDMA QUEUED
    [ 56.448578] ata1.00: cmd 60/00:10:58:ec:a4/01:00:0e:00:00/40 tag 2 ncq 131072 in
    res 41/84:00:fe:ec:a4/00:01:0e:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 56.448715] ata1.00: status: { DRDY ERR }
    [ 56.448753] ata1.00: error: { ICRC ABRT }
    [ 56.448798] ata1: hard resetting link
    [ 56.768215] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 56.856253] ata1.00: configured for UDMA/33
    [ 56.856297] ata1: EH complete
    [ 56.898690] ata1.00: exception Emask 0x0 SAct 0x60 SErr 0x0 action 0x6
    [ 56.898770] ata1.00: irq_stat 0x40000008
    [ 56.898816] ata1.00: failed command: READ FPDMA QUEUED
    [ 56.898876] ata1.00: cmd 60/00:30:c8:ee:a4/01:00:0e:00:00/40 tag 6 ncq 131072 in
    res 41/84:00:e8:ee:a4/00:01:0e:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 56.899029] ata1.00: status: { DRDY ERR }
    [ 56.899072] ata1.00: error: { ICRC ABRT }
    [ 56.899121] ata1: hard resetting link
    [ 57.218560] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 57.311513] ata1.00: configured for UDMA/33
    [ 57.311542] ata1: EH complete
    [ 57.355664] ata1.00: exception Emask 0x0 SAct 0x500 SErr 0x0 action 0x6
    [ 57.355754] ata1.00: irq_stat 0x40000008
    [ 57.355806] ata1.00: failed command: READ FPDMA QUEUED
    [ 57.355873] ata1.00: cmd 60/58:50:00:ec:a4/00:00:0e:00:00/40 tag 10 ncq 45056 in
    res 41/84:58:1a:ec:a4/00:00:0e:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 57.356044] ata1.00: status: { DRDY ERR }
    [ 57.356091] ata1.00: error: { ICRC ABRT }
    [ 57.356145] ata1: hard resetting link
    [ 57.675608] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 57.766781] ata1.00: configured for UDMA/33
    [ 57.766816] ata1: EH complete
    [ 57.806077] ata1.00: exception Emask 0x0 SAct 0x3000 SErr 0x0 action 0x6
    [ 57.806134] ata1.00: irq_stat 0x40000008
    [ 57.806164] ata1.00: failed command: READ FPDMA QUEUED
    [ 57.806203] ata1.00: cmd 60/00:68:70:24:a5/01:00:0e:00:00/40 tag 13 ncq 131072 in
    res 41/84:00:f2:24:a5/00:01:0e:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 57.806302] ata1.00: status: { DRDY ERR }
    [ 57.806330] ata1.00: error: { ICRC ABRT }
    [ 57.806362] ata1: hard resetting link
    [ 58.125961] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 58.211103] ata1.00: configured for UDMA/33
    [ 58.211156] ata1: EH complete
    [ 58.249769] ata1.00: exception Emask 0x0 SAct 0x18000 SErr 0x0 action 0x6
    [ 58.249854] ata1.00: irq_stat 0x40000008
    [ 58.249901] ata1.00: failed command: READ FPDMA QUEUED
    [ 58.249962] ata1.00: cmd 60/00:80:20:27:a5/01:00:0e:00:00/40 tag 16 ncq 131072 in
    res 41/84:00:a2:27:a5/00:01:0e:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 58.255626] ata1.00: status: { DRDY ERR }
    [ 58.258790] ata1.00: error: { ICRC ABRT }
    [ 58.261924] ata1: hard resetting link
    [ 58.579657] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 58.666164] ata1.00: configured for UDMA/33
    [ 58.666199] ata1: EH complete
    [ 58.716707] ata1.00: exception Emask 0x0 SAct 0x4000000 SErr 0x0 action 0x6
    [ 58.718539] ata1.00: irq_stat 0x40000008
    [ 58.720328] ata1.00: failed command: READ FPDMA QUEUED
    [ 58.722121] ata1.00: cmd 60/00:d0:68:92:5c/01:00:0f:00:00/40 tag 26 ncq 131072 in
    res 41/84:00:76:92:5c/00:01:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 58.725736] ata1.00: status: { DRDY ERR }
    [ 58.727553] ata1.00: error: { ICRC ABRT }
    [ 58.728965] ata1: hard resetting link
    [ 59.046670] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 59.132488] ata1.00: configured for UDMA/33
    [ 59.132515] ata1: EH complete
    [ 59.180459] ata1.00: exception Emask 0x0 SAct 0x20000000 SErr 0x0 action 0x6
    [ 59.181979] ata1.00: irq_stat 0x40000008
    [ 59.182990] ata1.00: failed command: READ FPDMA QUEUED
    [ 59.183943] ata1.00: cmd 60/f8:e8:68:93:5c/00:00:0f:00:00/40 tag 29 ncq 126976 in
    res 41/84:f8:6a:93:5c/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 59.185831] ata1.00: status: { DRDY ERR }
    [ 59.186778] ata1.00: error: { ICRC ABRT }
    [ 59.187715] ata1: hard resetting link
    [ 59.507035] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 59.610051] ata1.00: configured for UDMA/33
    [ 59.610080] ata1: EH complete
    [ 59.661766] ata1.00: exception Emask 0x0 SAct 0x80 SErr 0x0 action 0x6
    [ 59.663154] ata1.00: irq_stat 0x40000008
    [ 59.664089] ata1.00: failed command: READ FPDMA QUEUED
    [ 59.665027] ata1.00: cmd 60/98:38:60:94:5c/00:00:0f:00:00/40 tag 7 ncq 77824 in
    res 41/84:98:64:94:5c/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 59.666916] ata1.00: status: { DRDY ERR }
    [ 59.669774] ata1.00: error: { ICRC ABRT }
    [ 59.672954] ata1: hard resetting link
    [ 59.990695] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 60.087554] ata1.00: configured for UDMA/33
    [ 60.087600] ata1: EH complete
    [ 60.217903] ata1.00: exception Emask 0x0 SAct 0x80 SErr 0x0 action 0x6
    [ 60.219413] ata1.00: irq_stat 0x40000008
    [ 60.220456] ata1.00: failed command: READ FPDMA QUEUED
    [ 60.221440] ata1.00: cmd 60/20:38:00:1b:3e/00:00:0f:00:00/40 tag 7 ncq 16384 in
    res 41/84:20:18:1b:3e/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 60.223332] ata1.00: status: { DRDY ERR }
    [ 60.224269] ata1.00: error: { ICRC ABRT }
    [ 60.225206] ata1: hard resetting link
    [ 60.544531] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 60.653686] ata1.00: configured for UDMA/33
    [ 60.653713] ata1: EH complete
    [ 60.701540] ata1.00: exception Emask 0x0 SAct 0x400 SErr 0x0 action 0x6
    [ 60.703016] ata1.00: irq_stat 0x40000008
    [ 60.704106] ata1.00: failed command: READ FPDMA QUEUED
    [ 60.705056] ata1.00: cmd 60/88:50:78:1b:3e/00:00:0f:00:00/40 tag 10 ncq 69632 in
    res 41/84:88:78:1b:3e/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 60.706949] ata1.00: status: { DRDY ERR }
    [ 60.707884] ata1.00: error: { ICRC ABRT }
    [ 60.708824] ata1: hard resetting link
    [ 61.028237] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 61.142293] ata1.00: configured for UDMA/33
    [ 61.142319] ata1: EH complete
    [ 61.195399] ata1.00: exception Emask 0x0 SAct 0x8000 SErr 0x0 action 0x6
    [ 61.197750] ata1.00: irq_stat 0x40000008
    [ 61.200089] ata1.00: failed command: READ FPDMA QUEUED
    [ 61.201690] ata1.00: cmd 60/20:78:10:39:38/00:00:0f:00:00/40 tag 15 ncq 16384 in
    res 41/84:20:14:39:38/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 61.204897] ata1.00: status: { DRDY ERR }
    [ 61.206484] ata1.00: error: { ICRC ABRT }
    [ 61.208071] ata1: hard resetting link
    [ 61.525313] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 61.630818] ata1.00: configured for UDMA/33
    [ 61.630845] ata1: EH complete
    [ 61.675724] ata1.00: exception Emask 0x0 SAct 0x40000 SErr 0x0 action 0x6
    [ 61.677345] ata1.00: irq_stat 0x40000008
    [ 61.678943] ata1.00: failed command: READ FPDMA QUEUED
    [ 61.680539] ata1.00: cmd 60/50:90:30:39:38/00:00:0f:00:00/40 tag 18 ncq 40960 in
    res 41/84:50:70:39:38/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 61.683756] ata1.00: status: { DRDY ERR }
    [ 61.685369] ata1.00: error: { ICRC ABRT }
    [ 61.686586] ata1: hard resetting link
    [ 62.005676] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 62.108289] ata1.00: configured for UDMA/33
    [ 62.108316] ata1: EH complete
    [ 62.162783] ata1.00: exception Emask 0x0 SAct 0x400000 SErr 0x0 action 0x6
    [ 62.164411] ata1.00: irq_stat 0x40000008
    [ 62.166015] ata1.00: failed command: READ FPDMA QUEUED
    [ 62.167617] ata1.00: cmd 60/20:b0:d8:c3:3d/00:00:0f:00:00/40 tag 22 ncq 16384 in
    res 41/84:20:d8:c3:3d/00:00:0f:00:00/00 Emask 0x410 (ATA bus error) <F>
    [ 62.170837] ata1.00: status: { DRDY ERR }
    [ 62.172433] ata1.00: error: { ICRC ABRT }
    [ 62.173698] ata1: hard resetting link
    [ 62.492749] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [ 62.607944] ata1.00: configured for UDMA/33
    [ 62.607974] ata1: EH complete
    Output of smartctl -a /dev/sda
    smartctl 6.3 2014-07-26 r3976 [x86_64-linux-3.19.3-3-ARCH] (local build)
    Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org
    === START OF INFORMATION SECTION ===
    Model Family: Seagate Laptop SSHD
    Device Model: ST1000LM014-SSHD-8GB
    Serial Number: W3829AM6
    LU WWN Device Id: 5 000c50 07be01372
    Firmware Version: LVD3
    User Capacity: 1,000,204,886,016 bytes [1,00 TB]
    Sector Sizes: 512 bytes logical, 4096 bytes physical
    Rotation Rate: 5400 rpm
    Form Factor: 2.5 inches
    Device is: In smartctl database [for details use: -P show]
    ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b
    SATA Version is: SATA 3.1, 6.0 Gb/s (current: 1.5 Gb/s)
    Local Time is: Sun May 10 11:12:02 2015 CEST
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    See vendor-specific Attribute list for marginal Attributes.
    General SMART Values:
    Offline data collection status: (0x00) Offline data collection activity
    was never started.
    Auto Offline Data Collection: Disabled.
    Self-test execution status: ( 0) The previous self-test routine completed
    without error or no self-test has ever
    been run.
    Total time to complete Offline
    data collection: ( 150) seconds.
    Offline data collection
    capabilities: (0x73) SMART execute Offline immediate.
    Auto Offline data collection on/off support.
    Suspend Offline collection upon new
    command.
    No Offline surface scan supported.
    Self-test supported.
    Conveyance Self-test supported.
    Selective Self-test supported.
    SMART capabilities: (0x0003) Saves SMART data before entering
    power-saving mode.
    Supports SMART auto save timer.
    Error logging capability: (0x01) Error logging supported.
    General Purpose Logging supported.
    Short self-test routine
    recommended polling time: ( 1) minutes.
    Extended self-test routine
    recommended polling time: ( 198) minutes.
    Conveyance self-test routine
    recommended polling time: ( 2) minutes.
    SCT capabilities: (0x1081) SCT Status supported.
    SMART Attributes Data Structure revision number: 10
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x000f 117 099 006 Pre-fail Always - 158141600
    3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0
    4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 429
    5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
    7 Seek_Error_Rate 0x000f 073 060 030 Pre-fail Always - 4319585187
    9 Power_On_Hours 0x0032 098 098 000 Old_age Always - 1864
    10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
    12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 437
    184 End-to-End_Error 0x0032 089 089 099 Old_age Always FAILING_NOW 11
    187 Reported_Uncorrect 0x0032 098 098 000 Old_age Always - 2
    188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
    189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
    190 Airflow_Temperature_Cel 0x0022 069 052 045 Old_age Always - 31 (Min/Max 25/31)
    191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
    192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 50
    193 Load_Cycle_Count 0x0032 097 097 000 Old_age Always - 6179
    194 Temperature_Celsius 0x0022 031 048 000 Old_age Always - 31 (0 19 0 0 0)
    197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
    198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
    199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
    254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
    SMART Error Log Version: 1
    ATA Error Count: 13 (device log contains only the most recent five errors)
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
    Powered_Up_Time is measured from power on, and printed as
    DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
    SS=sec, and sss=millisec. It "wraps" after 49.710 days.
    Error 13 occurred at disk power-on lifetime: 1779 hours (74 days + 3 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 10 ff ff ff 4f 00 09:58:41.053 READ FPDMA QUEUED
    60 00 b0 ff ff ff 4f 00 09:58:41.053 READ FPDMA QUEUED
    60 00 30 ff ff ff 4f 00 09:58:41.053 READ FPDMA QUEUED
    ea 00 00 00 00 00 a0 00 09:58:40.403 FLUSH CACHE EXT
    61 00 08 ff ff ff 4f 00 09:58:40.403 WRITE FPDMA QUEUED
    Error 12 occurred at disk power-on lifetime: 1722 hours (71 days + 18 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 00 ff ff ff 4f 00 00:01:28.048 READ FPDMA QUEUED
    60 00 00 ff ff ff 4f 00 00:01:28.048 READ FPDMA QUEUED
    60 00 08 ff ff ff 4f 00 00:01:28.047 READ FPDMA QUEUED
    60 00 00 ff ff ff 4f 00 00:01:28.047 READ FPDMA QUEUED
    60 00 30 50 3a c5 4e 00 00:01:28.045 READ FPDMA QUEUED
    Error 11 occurred at disk power-on lifetime: 1537 hours (64 days + 1 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 00 ff ff ff 4f 00 00:00:35.199 READ FPDMA QUEUED
    60 00 20 ff ff ff 4f 00 00:00:35.198 READ FPDMA QUEUED
    60 00 08 10 10 2b 4f 00 00:00:35.188 READ FPDMA QUEUED
    60 00 e0 20 e0 78 4f 00 00:00:35.187 READ FPDMA QUEUED
    60 00 90 68 e1 78 4f 00 00:00:35.185 READ FPDMA QUEUED
    Error 10 occurred at disk power-on lifetime: 1525 hours (63 days + 13 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 a0 ff ff ff 4f 00 00:00:15.374 READ FPDMA QUEUED
    60 00 08 ff ff ff 4f 00 00:00:15.373 READ FPDMA QUEUED
    60 00 08 ff ff ff 4f 00 00:00:15.373 READ FPDMA QUEUED
    60 00 80 ff ff ff 4f 00 00:00:15.370 READ FPDMA QUEUED
    60 00 68 ff ff ff 4f 00 00:00:15.370 READ FPDMA QUEUED
    Error 9 occurred at disk power-on lifetime: 1525 hours (63 days + 13 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 08 e0 9e 31 4f 00 00:00:15.146 READ FPDMA QUEUED
    60 00 a8 ff ff ff 4f 00 00:00:15.073 READ FPDMA QUEUED
    60 00 18 ff ff ff 4f 00 00:00:15.072 READ FPDMA QUEUED
    60 00 98 ff ff ff 4f 00 00:00:15.072 READ FPDMA QUEUED
    60 00 00 ff ff ff 4f 00 00:00:15.068 READ FPDMA QUEUED
    SMART Self-test log structure revision number 1
    No self-tests have been logged. [To run self-tests, use: smartctl -t]
    SMART Selective self-test log data structure revision number 1
    SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
    1 0 0 Not_testing
    2 0 0 Not_testing
    3 0 0 Not_testing
    4 0 0 Not_testing
    5 0 0 Not_testing
    Selective self-test flags (0x0):
    After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    Is this software bug or hard drive failure? Thanks in advance.

    Thanks for your answers.
    2ion wrote:
    Not necessarily, this is a Seagate hard drive. AFAIK Seek Error Rate and Raw Read Error Rate are 48bit values where the lower 24bit encode the total number of sectors read/saught (which overflows to zero) and the upper 24bit encode the acutal errors.
    smartctl -v 1,hex48 -v 7,hex48 -a /dev/sda
    should display OP's  data in a usuable format.
    In fact, I turned my recently purchased laptop in for a hard disk replacement of almost the same type as OP (ST500LM000-SSHD-8GB) twice, but all three drives of this type I had provided SMART values which were more of an oracle rather than data useful for monitoring purposes. Forums are full with people unsure about what to do with this kind of drives. If you google for the End-to-End errors with Seagate drives (here marked as FAILING!), you'll find people reporting that Seagate's own tools do not report any errors despite the attribute in question being reported by monitoring tools just as bad... Seagate is the horror. So, I'd say that it is rather uncertain whether the SMART values are connected to the actual drive failing or a faulty cable.
    OP, did you see these errors from the beginning or after a certain time, or perhaps after a kernel upgrade? Did you check the drive's cable? What was the situation before these errors showed up (maybe under Windows?)
    smartctl -v 1,hex48 -v 7,hex48 -a /dev/sda
    smartctl 6.3 2014-07-26 r3976 [x86_64-linux-3.19.3-3-ARCH] (local build)
    Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org
    === START OF INFORMATION SECTION ===
    Model Family: Seagate Laptop SSHD
    Device Model: ST1000LM014-SSHD-8GB
    Serial Number: W3829AM6
    LU WWN Device Id: 5 000c50 07be01372
    Firmware Version: LVD3
    User Capacity: 1,000,204,886,016 bytes [1,00 TB]
    Sector Sizes: 512 bytes logical, 4096 bytes physical
    Rotation Rate: 5400 rpm
    Form Factor: 2.5 inches
    Device is: In smartctl database [for details use: -P show]
    ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b
    SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
    Local Time is: Mon May 11 12:09:29 2015 CEST
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    See vendor-specific Attribute list for marginal Attributes.
    General SMART Values:
    Offline data collection status: (0x00) Offline data collection activity
    was never started.
    Auto Offline Data Collection: Disabled.
    Self-test execution status: ( 0) The previous self-test routine completed
    without error or no self-test has ever
    been run.
    Total time to complete Offline
    data collection: ( 150) seconds.
    Offline data collection
    capabilities: (0x73) SMART execute Offline immediate.
    Auto Offline data collection on/off support.
    Suspend Offline collection upon new
    command.
    No Offline surface scan supported.
    Self-test supported.
    Conveyance Self-test supported.
    Selective Self-test supported.
    SMART capabilities: (0x0003) Saves SMART data before entering
    power-saving mode.
    Supports SMART auto save timer.
    Error logging capability: (0x01) Error logging supported.
    General Purpose Logging supported.
    Short self-test routine
    recommended polling time: ( 1) minutes.
    Extended self-test routine
    recommended polling time: ( 198) minutes.
    Conveyance self-test routine
    recommended polling time: ( 2) minutes.
    SCT capabilities: (0x1081) SCT Status supported.
    SMART Attributes Data Structure revision number: 10
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x000f 115 099 006 Pre-fail Always - 0x000005184840
    3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0
    4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 433
    5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
    7 Seek_Error_Rate 0x000f 073 060 030 Pre-fail Always - 0x0001017be679
    9 Power_On_Hours 0x0032 098 098 000 Old_age Always - 1880
    10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
    12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 441
    184 End-to-End_Error 0x0032 089 089 099 Old_age Always FAILING_NOW 11
    187 Reported_Uncorrect 0x0032 098 098 000 Old_age Always - 2
    188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
    189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
    190 Airflow_Temperature_Cel 0x0022 061 052 045 Old_age Always - 39 (Min/Max 37/39)
    191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
    192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 50
    193 Load_Cycle_Count 0x0032 097 097 000 Old_age Always - 6282
    194 Temperature_Celsius 0x0022 039 048 000 Old_age Always - 39 (0 19 0 0 0)
    197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
    198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
    199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
    254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
    SMART Error Log Version: 1
    ATA Error Count: 13 (device log contains only the most recent five errors)
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
    Powered_Up_Time is measured from power on, and printed as
    DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
    SS=sec, and sss=millisec. It "wraps" after 49.710 days.
    Error 13 occurred at disk power-on lifetime: 1779 hours (74 days + 3 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 10 ff ff ff 4f 00 09:58:41.053 READ FPDMA QUEUED
    60 00 b0 ff ff ff 4f 00 09:58:41.053 READ FPDMA QUEUED
    60 00 30 ff ff ff 4f 00 09:58:41.053 READ FPDMA QUEUED
    ea 00 00 00 00 00 a0 00 09:58:40.403 FLUSH CACHE EXT
    61 00 08 ff ff ff 4f 00 09:58:40.403 WRITE FPDMA QUEUED
    Error 12 occurred at disk power-on lifetime: 1722 hours (71 days + 18 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 00 ff ff ff 4f 00 00:01:28.048 READ FPDMA QUEUED
    60 00 00 ff ff ff 4f 00 00:01:28.048 READ FPDMA QUEUED
    60 00 08 ff ff ff 4f 00 00:01:28.047 READ FPDMA QUEUED
    60 00 00 ff ff ff 4f 00 00:01:28.047 READ FPDMA QUEUED
    60 00 30 50 3a c5 4e 00 00:01:28.045 READ FPDMA QUEUED
    Error 11 occurred at disk power-on lifetime: 1537 hours (64 days + 1 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 00 ff ff ff 4f 00 00:00:35.199 READ FPDMA QUEUED
    60 00 20 ff ff ff 4f 00 00:00:35.198 READ FPDMA QUEUED
    60 00 08 10 10 2b 4f 00 00:00:35.188 READ FPDMA QUEUED
    60 00 e0 20 e0 78 4f 00 00:00:35.187 READ FPDMA QUEUED
    60 00 90 68 e1 78 4f 00 00:00:35.185 READ FPDMA QUEUED
    Error 10 occurred at disk power-on lifetime: 1525 hours (63 days + 13 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 a0 ff ff ff 4f 00 00:00:15.374 READ FPDMA QUEUED
    60 00 08 ff ff ff 4f 00 00:00:15.373 READ FPDMA QUEUED
    60 00 08 ff ff ff 4f 00 00:00:15.373 READ FPDMA QUEUED
    60 00 80 ff ff ff 4f 00 00:00:15.370 READ FPDMA QUEUED
    60 00 68 ff ff ff 4f 00 00:00:15.370 READ FPDMA QUEUED
    Error 9 occurred at disk power-on lifetime: 1525 hours (63 days + 13 hours)
    When the command that caused the error occurred, the device was active or idle.
    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    60 00 08 e0 9e 31 4f 00 00:00:15.146 READ FPDMA QUEUED
    60 00 a8 ff ff ff 4f 00 00:00:15.073 READ FPDMA QUEUED
    60 00 18 ff ff ff 4f 00 00:00:15.072 READ FPDMA QUEUED
    60 00 98 ff ff ff 4f 00 00:00:15.072 READ FPDMA QUEUED
    60 00 00 ff ff ff 4f 00 00:00:15.068 READ FPDMA QUEUED
    SMART Self-test log structure revision number 1
    Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
    # 1 Short offline Completed without error 00% 1871 -
    SMART Selective self-test log data structure revision number 1
    SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
    1 0 0 Not_testing
    2 0 0 Not_testing
    3 0 0 Not_testing
    4 0 0 Not_testing
    5 0 0 Not_testing
    Selective self-test flags (0x0):
    After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    These errors just appeared, not after upgrade and I didn't get them in the beginning. The situation before errors - everything worked exactly the same, I see no difference in performance, except that few seconds long freeze that sometimes happen. Can't tell about Windows, I have it pre-installed but never used it so I can't compare. I didn't check the cable, and I'd rather not do that - I don't want to mess with hardware, if I do something wrong I lose the warranty. If something is wrong then I'd rather have it checked and fixed by someone who knows how to do that (and for free, because I still have the warranty).

  • What can I do about following error: SIGBUS 10 bus error?

    Hello,
    We use iPlanet AS 6.0 SP3 on Solaris 8
    In kjs_1_CCS0 I found the following error:
    SIGBUS 10 bus error
    si_signo [10]: BUS
    si_errno [0]:
    si_code [1]: BUS_ADRALN [addr: 0x6966223b]
         stackpointer=B72FE880
    Inconsistent thread : best efforts attempt (may fail)
    "Thread-61" (TID:0x11c90568, sys_thread_t:0x11c904a0, state:CW, thread_t: t@67, threadID:0xb4b80000, stack_bottom:0xb4b80000, stack_size:0x80000) prio=5
    [1] java.lang.Object.wait(Object.java:424)
    [2] com.ibm.mq.server.MQThread.run(MQThread.java:923)
    Inconsistent thread : best efforts attempt (may fail)
    "Thread-59"/appl/iplanet/ias6/ias/bin/kjs[76]: 15876 Abort(coredump)
    After this the App server restarts itself
    Who knows what's wrong here?
    Thanks in advance
    Peter

    We got this same error with increasing frequency until it was happening all the time. Increasing the values of
    -Xms and -Xmx in the iasenv.ksh script seems to have completly eliminated the problem. It seems that when the jdk runs out of memory it will throw a Java lang OutofMemory error (which you will never see in the logs) followed by the SIGBUS error. Be careful with these settings they can severely affect the performance of the server you might try turrning on verbose:gc in order to watch memory usage.

  • InDesign Server CS6 (MacOS) - JavaScripting & Troubleshooting "Bus error" or "Segmentation fault"

    I'm attempting to convert a workflow from InDesign CS5.5 Desktop with AppleScript to InDesign Server CS6 with JavaScript. It seems most of our templates work fine but every now and then I run into one that seems to work properly but right after we export to PDF and JPG which is the final step in the script I get either a Bus error or a Segmentation fault error. The files do export and the console sits idle for a few seconds then I get the crash. It doesn't seem to give me anything else and I can't find a crash dump or core file anywhere on disk to examine.
    The exact same input files on InDesign CS5.5 Desktop completing a very similar automation task via AppleScript work without an issue or error. I'm not certain if it's a problem with the way the InDesign files were put together, a version problem between a CS5.5 file and CS6, or something that I'm doing wrong in the script.
    Is there a way to get InDesign Server to go into debug or verbose mode so that it will show more than just two word errors on crash?  I've read a few people talking here about the debug version but every path I've found to get access to the debug version runs into a roadblock with a bad link.
    I would appreciate a point in the current right direction for how to debug these templates this script.

    Re: verbose mode. These are not InDesign error messages. They are system errors, saying that an app (InDesign?) crashed, went away, hence could not issue any kind of message. Crash logs are the place to start. If they don't help, and the crash is outside your code, after that it's over to the maintainer (Adobe?)
    Worth sharing a suitable crash log, as the list of routines active at the crash can narrow down issues.

  • Solaris 8 - Motif, Xbae apps ZPR with purify or Bus error

    The application runs under 5.6 but after compiling and running on 5.8, I receive a Bus Error or when running purify receive a ZPR & COR. The c program is receiving the error during widget creation:
    tbl = XtVaCreateManagedWidget
    ("tbl",
    xbaeMatrixWidgetClass, parent, ...... etc.)
    Purify outputs this message:
    ZPR: This is occurring while in:
    _XtCompileCallbackList [Callback.c]
    CompileCallbacks [Create.c]
    xtCreate [Create.c]
    _XtVaCreateWidget [VarCreate.c]
    XtVaCreateManagedWidget [VarCreate.c]
    Reading 4 bytes from 0x12
    I have tended to think I have a versioning problem with Solaris 8 but I need some help.
    Thank you very much, Joanne

    The application runs under 5.6 but after compilingand
    running on 5.8, I receive a Bus Error or whenrunning
    purify receive a ZPR & COR. The c program is
    receiving the error during widget creation:
    tbl = XtVaCreateManagedWidget
    ("tbl",
    xbaeMatrixWidgetClass, parent, ......
    , parent, ...... etc.)
    Purify outputs this message:
    ZPR: This is occurring while in:
    _XtCompileCallbackList[Callback.c]
    CompileCallbacks [Create.c]
    xtCreate [Create.c]
    _XtVaCreateWidget [VarCreate.c]
    XtVaCreateManagedWidget
    ateManagedWidget [VarCreate.c]
    Reading 4 bytes from 0x12
    I have tended to think I have a versioning problem
    with Solaris 8 but I need some help.
    Thank you very much, Joanne

  • Core Dump on Solaris 10 (Signal 10 - Bus Error), but not on Solaris 8?

    Hi,
    We just moved our product from Solaris 8 to Solaris 10. It runs for months on Solaris 8 without any problems, while core dumped after running about 2 weeks on Solaris 10.
    Any clue on what could be wrong is apprecaited.
    pam

    Hi Andrew,
    Appreciate your answer very much. I am very new to Solaris and UNIX in general. Would you please let me know what kind of info would help diagnose the
    problem? I have stack pointer, output of "where" from gdb. frme pointer, etc.
    pam
    ===================
    GNU gdb 6.3
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "sparc-sun-solaris2.8"...(no debugging symbols found)
    Core was generated by `./warnsrvr'.
    Program terminated with signal 10, Bus error.
    #0 0x001a3ca8 in __1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__ ()
    (gdb) where
    #0 0x001a3ca8 in __1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__ ()
    #1 0x001a3ca8 in __1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__ ()
    Previous frame identical to this frame (corrupt stack?)
    ======================================
    (gdb) disassemble 0x001a3ca8
    Dump of assembler code for function __1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__:
    0x001a3c24 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+0>: cmp %o0, 1
    0x001a3c28 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+4>: be,pn %icc, 0x1a3c38 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+20>
    0x001a3c2c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+8>: sethi %hi(0x572000), %l6
    0x001a3c30 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+12>: ret
    0x001a3c34 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+16>: restore %g0, 0, %o0
    0x001a3c38 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+20>: ld [ %l6 + 0x358 ], %l5
    0x001a3c3c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+24>: cmp %l5, 0
    0x001a3c40 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+28>: bne,pn %icc, 0x1a3c50 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+44>
    0x001a3c44 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+32>: cmp %l5, 1
    0x001a3c48 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+36>: ret
    0x001a3c4c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+40>: restore %g0, 1, %o0
    0x001a3c50 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+44>: bne,pn %icc, 0x1a3cb0 <__1cSWPReferenceManagerOInputIonoModel6MrknKIONO_MODEL_khki_nGRESULT__+4>
    0x001a3c54 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+48>: sethi %hi(0x1a3c00), %l7
    0x001a3c58 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+52>: mov -1, %i1
    0x001a3c5c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+56>: sth %i1, [ %fp + -1864 ]
    0x001a3c60 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+60>: add %fp, -1824, %o0
    0x001a3c64 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+64>: ldd [ %l7 + 8 ], %f0
    0x001a3c68 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+68>: call 0x1c87f0 <___const_seg_900001301+16>
    0x001a3c6c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+72>: std %f0, [ %fp + -1856 ]
    0x001a3c70 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+76>: call 0x1cf888 <__1cKIono2Ascii6FrknKIONO_MODEL_pcki_v_+100>
    0x001a3c74 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+80>: add %fp, -1864, %o0
    0x001a3c78 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+84>: sllx %i2, 0x30, %o1
    0x001a3c7c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+88>: mov %i0, %o0
    0x001a3c80 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+92>: srax %o1, 0x30, %o1
    0x001a3c84 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+96>: call 0x182cb0 <__1cTGenReferenceManagerOGetCorrections6MrknKCLSGpsTime_rknICLSCoord_rnOCORRECTION_SET__nGRESULT__+3504>
    0x001a3c88 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+100>: add %fp, -1864, %o2
    0x001a3c8c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+104>: cmp %o0, 1
    0x001a3c90 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+108>: be,pn %icc, 0x1a3ca0 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+124>
    0x001a3c94 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+112>: mov %i0, %o0
    0x001a3c98 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+116>: ret
    0x001a3c9c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+120>: restore %g0, 0, %o0
    0x001a3ca0 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+124>: call 0x1a7068 <__1cSWPReferenceManagerPAdjustXTRATimes6MpnZCLSGnssSatellitePredictor_khrnKCLSGpsTime_rd_nGRESULT__+3584>
    0x001a3ca4 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+128>: add %fp, -1864, %o1
    0x001a3ca8 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+132>: ret
    End of assembler dump.
    =====================================
    (gdb) info registers
    g0 0x0 0
    g1 0xfd77ecb8 -42472264
    g2 0x11 17
    g3 0xecf0 60656
    g4 0xfd77e304 -42474748
    g5 0xfc 252
    g6 0x0 0
    g7 0xfeda4200 -19250688
    o0 0x1 1
    o1 0x20 32
    o2 0x693500 6894848
    o3 0xecf0 60656
    o4 0x6a21f0 6955504
    o5 0x1 1
    sp 0xfd77ec38 0xfd77ec38
    o7 0x1a3ca0 1719456
    l0 0x1b000021 452984865
    l1 0x2ca2a40 46803520
    l2 0x40173076 1075261558
    l3 0x57d22e16 1473392150
    l4 0x3fa80492 1067975826
    l5 0x3c06fe49 1007091273
    l6 0x4072b4a5 1081259173
    l7 0x410d711d 1091399965
    i0 0x421c0000 1109131264
    i1 0xffffffff -1
    i2 0x1d000018 486539288
    i3 0x2ca2808 46802952
    i4 0x40138e4a 1075023434
    i5 0x8b122e16 -1961742826
    fp 0xbfb17c3b 0xbfb17c3b
    i7 0xa817f0db -1474826021
    y 0x3 3
    psr 0xfe401007 -29356025
    wim 0x0 0
    tbr 0x0 0
    pc 0x1a3ca8 0x1a3ca8 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+132>
    npc 0x1a3cac 0x1a3cac <__1cSWPReferenceManagerOInputIonoModel6MrknKIONO_MODEL_khki_nGRESULT__>
    fsr 0x400420 4195360
    csr 0x0 0

  • CC: Fatal error in ccfe: Bus Error (core dumped)

    I'm trying to compile a file that's heavy on templates (both mine and boost's).
    After some time I get the following error:
    CC: Fatal error in ccfe: Bus Error (core dumped)ccfe consumes up to 390 mb aprox.
    What could be the cause of this?
    Could it be lack of memory?

    It is almost certainly not an out-of-memory problem. It is some sort of internal compiler error.
    To find and fix the problem, we would need a test case.

  • SetSystemUIMode Bus Error

    I have written a java program which accesses:
    SetSystemUIMode(kUIModeNormal, 0);
    (through JNI) to return system settings to normal after the java program has been locked out.
    When I call this function about one in ten calls it gives a Bus Error and brings down the whole program.
    I would like to avoid the program being taken down.
    You can reliably get this error by running the command through a for loop of about 100 loops.
    Anyone know how to fix this or can think of a work around.
    Thanks for any input!
    G4   Mac OS X (10.4.8)  

    see http://www.weblogic.com/platforms/index.html#solaris8
    Guna Desaiyan <[email protected]> wrote:
    SIGBUS 10* bus error
    si_signo [10]: SIGBUS 10* bus error
    I got this in the WL 4.5.1 log running on Sun Solaris.
    Please advise.
    Thanks,
    Guna DesaiyanDimitri

Maybe you are looking for

  • Vendor amount control in APP

    HI Team, Is there any way to control in an APP for a particular vendor by considering all Invoices 'X' amount is allowed? Thanks In Advance Regards Rashid

  • JIT with JavaCard?

    HI, Can anyone tell me if CAP file bytecode is simply interpreted on the card by the JCVM or are there optimization techniques such as JIT available on todays Java Card smart cards? Thanks in advance, Ann

  • I have Photoshop Elements 6 and am dealing with the GIF frame delay bug. Must I upgrade?

    I am dealing with the Photoshop Elements 6 GIF animation frame delay bug. I understand there has not been a fix for some time so I want to know if one has been developed. If not what do I have to do to address this. Can I get an upgrade? What steps d

  • CNN video question

    Hi, Anyone else have issues watching CNN videos on there Mac? It keeps telling me to download Windows Media Player 9, but I already have it. Thanks!

  • Nokia c3-00 cannot connect to internet after resto...

    after restoring, my phone change, the theme become gray, the communities, ovi store and other features gone. also in the internet other function gone like goto address, the only remain is the home,browser and web services, they are useless coz they c