Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 8.1 crashes #122

Closed
minuq opened this issue Jun 6, 2014 · 24 comments
Closed

Windows 8.1 crashes #122

minuq opened this issue Jun 6, 2014 · 24 comments

Comments

@minuq
Copy link

minuq commented Jun 6, 2014

Problemereignisname: APPCRASH
Anwendungsname: pyfa.exe
Anwendungsversion: 0.0.0.0
Anwendungszeitstempel: 49180193
Fehlermodulname: sqlite3.dll
Fehlermodulversion: 0.0.0.0
Fehlermodulzeitstempel: 4c30323e
Ausnahmecode: c0000005
Ausnahmeoffset: 0003a2cd
Betriebsystemversion: 6.3.9600.2.0.0.256.4
Gebietsschema-ID: 1031
Zusatzinformation 1: 5861
Zusatzinformation 2: 5861822e1919d7c014bbb064c64908b2
Zusatzinformation 3: d1d9
Zusatzinformation 4: d1d94a13d3609d6b740644c12508f581

Happen like every 5 minutes when i'm messing around with fits. Doesn't depend on ships, modules, whatever, not reproducable (unless you count continuing to fit stuff as reproducing, but it won't crash on the same module over and over)

@neheran
Copy link

neheran commented Jun 7, 2014

i have the same on windows 7 64bit. It crashes all the freaking time, sometimes after a couple of seconds of starting it. I'm going insane soon.

Problem signature:
Problem Event Name: APPCRASH
Application Name: pyfa.exe
Application Version: 0.0.0.0
Application Timestamp: 49180193
Fault Module Name: sqlite3.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4c30323e
Exception Code: c0000005
Exception Offset: 0003a214
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1031
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

@blitzmann
Copy link
Collaborator

Unfortunately I cannot reproduce any of the crashes that are being reported. It might be an
environment issue but I don't see why the latest version of pyfa would cause crahses while the previous version was fine.

Can you both try some of the nightly builds and try to pinpoint which build the problem starts with? We have builds that go all the way back to April 3rd. That'll give us a place to start.

http://blitzmann.it.cx/pyfa-nightly/

@neheran
Copy link

neheran commented Jun 8, 2014

Alright I downloaded the latest nightly (from today) and extracted it in a seperate folder. Does work so far without crashes. I'll keep you updated.

@blitzmann
Copy link
Collaborator

That... makes no sense.

You're talking about pyfa-nighty-20140608-win-23044b5 correct? The only changes from the release and this build are a fix for #118 and adding #117

Unless #118 causes it to crash from queuing up so many skills. Hmm... With the official release, did you notice if it happened when working on your character, or on All 5, or what? Also, were you using the .exe installer, or the zipped file?

@minuq
Copy link
Author

minuq commented Jun 8, 2014

It happened to me on any character, All 5 and All 0. i also noticed that sometimes the Resistances/Recharge Rates etc don't change when i switch characters. I'm using the .exe version and will now go through and try the nightly versions.

@blitzmann
Copy link
Collaborator

Can you give reproduction steps to show that stats don't update when switching characters?

@blitzmann
Copy link
Collaborator

Also, if folks can get a video of starting pyfa all the way to it crashing, that would probably help a lot, just so I can replicate 1:1 what you're doing.

@minuq
Copy link
Author

minuq commented Jun 8, 2014

Sadly not. All i did was fire up pyfa since it crashed, load up a fit, switch character to all V and back. Last nightly build works for me as well, talking about pyfa-nighty-20140608-win-23044b5. Will upload a video shortly as soon as i get my crappy connection to work.

edit: Also the nightly builds don't crash, checked all of the current version.

@minuq
Copy link
Author

minuq commented Jun 8, 2014

Interesting enough, after i moved the latest nightly build to C:\Program Files (x86) as well, it started crashing too Latest nightly build is crashing on me too now, not depending on the folder i started it from. http://youtu.be/JfwbTV2eH5I here's the link to the video though.

edit: new crash message following the "old" crash message:

Problemsignatur:
  Problemereignisname:  APPCRASH
  Anwendungsname:   pyfa.exe
  Anwendungsversion:    0.0.0.0
  Anwendungszeitstempel:    49180193
  Fehlermodulname:  wxbase28uh_vc.dll
  Fehlermodulversion:   2.8.11.0
  Fehlermodulzeitstempel:   4bedf306
  Ausnahmecode: c000041d
  Ausnahmeoffset:   000852d0
  Betriebsystemversion: 6.3.9600.2.0.0.256.4
  Gebietsschema-ID: 1031
  Zusatzinformation 1:  edcd
  Zusatzinformation 2:  edcdabf00f8246ebc598b0a88b00c29d
  Zusatzinformation 3:  1994
  Zusatzinformation 4:  1994cb6795cdf0cd14032572276f194c

@sydney-whittington
Copy link

Same thing is happening to me on 64-bit Windows 7. Recorded a quick video of it happening:
https://www.dropbox.com/s/ce9ezc9f3x2asfs/Pyfa%20Crash.mp4

I've seen it crash on loading drones (like this one), equipping modules from the market, and selecting and deselecting drones from the drone bay. About to try the nightly builds and see if anything changes.

Edit: Most recent nightly still crashes, so going to go back before the recent release and see if I can find a stable one.

Edit 2: Looks like the pyfa-nighty-20140528-win-749934b is the last stable one for me, although since the crash isn't entirely predictable, there is a possibility it is just less likely to crash than actually crash-free. It still crashed on me in the pyfa-nighty-20140602-win-7d58b2c build.

@blitzmann
Copy link
Collaborator

Thank you guys for participating and help in trying to nail this down. The videos are very helpful.

Someone on the forums mentioned that disabling automatic HTML export seems to fix the crashes. I don't have automatic export enabled on my test install which might be why I cannot reproduce, and I'm not currently home. Can you please try to disable this option on your installations and report back? The option is in Window > Preferences > HTML Export

EDIT:
I've been able to reproduce the crash. Gonna look into it, but it seems that a quick fix would be to disable automatic HTML export until it's resolved

@blitzmann
Copy link
Collaborator

With automatic HTML export and running pyfa from source, I was able to get a few exceptions (long traceback included).

When pyfa did crash, dump file states that "exception was raised when thread tried to read from or write to a virtual address for which it does not have the appropriate access."

C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\session.py:1879: SAWarning: Attribute history events accumulated on 2 previously clean instances within inner-flush event handlers have been reset, and will not result in database updates. Consider using set_committed_value() within inner-flush event handlers to avoid this warning.
  self._flush(objects)
Exception in thread Thread-13:
Traceback (most recent call last):
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\threading.py", line 810, in __bootstrap_inner
    self.run()
  File "C:\Users\Ryan\Dropbox\Git\blitzmann\Pyfa\gui\utils\exportHtml.py", line 152, in run
    dnaFit = sFit.exportDna(fit[0])
  File "C:\Users\Ryan\Dropbox\Git\blitzmann\Pyfa\service\fit.py", line 727, in exportDna
    return Port.exportDna(fitID)
  File "C:\Users\Ryan\Dropbox\Git\blitzmann\Pyfa\service\port.py", line 624, in exportDna
    fit = sFit.getFit(fitID)
  File "C:\Users\Ryan\Dropbox\Git\blitzmann\Pyfa\service\fit.py", line 244, in getFit
    self.recalc(fit, withBoosters=True)
  File "C:\Users\Ryan\Dropbox\Git\blitzmann\Pyfa\service\fit.py", line 857, in recalc
    fit.clear()
  File "C:\Users\Ryan\Dropbox\Git\blitzmann\Pyfa\eos\saveddata\fit.py", line 254, in clear
    c = chain(self.modules, self.drones, self.boosters, self.implants, self.projectedDrones, self.projectedModules, self.projectedFits, (self.character, self.extraAttributes))
  File "C:\Users\Ryan\Dropbox\Git\blitzmann\Pyfa\eos\saveddata\fit.py", line 127, in drones
    return self.__drones
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\attributes.py", line 233, in __get__
    return self.impl.get(instance_state(instance), dict_)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\attributes.py", line 579, in get
    value = self.callable_(state, passive)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\strategies.py", line 505, in _load_for_state
    return self._emit_lazyload(session, state, ident_key, passive)
  File "<string>", line 1, in <lambda>
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\strategies.py", line 567, in _emit_lazyload
    result = q.all()
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\query.py", line 2264, in all
    return list(self)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\query.py", line 2376, in __iter__
    return self._execute_and_instances(context)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\query.py", line 2389, in _execute_and_instances
    close_with_result=True)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\query.py", line 2380, in _connection_from_session
    **kw)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\session.py", line 843, in connection
    close_with_result=close_with_result)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\session.py", line 847, in _connection_for_bind
    return self.transaction._connection_for_bind(engine)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\session.py", line 298, in _connection_for_bind
    self._assert_active()
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\session.py", line 198, in _assert_active
    "This session is in 'prepared' state; no further "
InvalidRequestError: This session is in 'prepared' state; no further SQL can be emitted within this transaction.

Exception in thread Thread-14:
Traceback (most recent call last):
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\threading.py", line 810, in __bootstrap_inner
    self.run()
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\gui\utils\exportHtml.py", line 152, in run
    dnaFit = sFit.exportDna(fit[0])
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\service\fit.py", line 727, in exportDna
    return Port.exportDna(fitID)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\service\port.py", line 624, in exportDna
    fit = sFit.getFit(fitID)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\service\fit.py", line 244, in getFit
    self.recalc(fit, withBoosters=True)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\service\fit.py", line 858, in recalc
    fit.calculateModifiedAttributes(withBoosters=withBoosters, dirtyStorage=self.dirtyFitIDs)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fit.py", line 279, in calculateModifiedAttributes
    self.gangBoosts = self.fleet.recalculateLinear(withBoosters=withBoosters, dirtyStorage=dirtyStorage)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fleet.py", line 63, in recalculateLinear
    self.wings[0].recalculateLinear(self.store, withBoosters=withBoosters, dirtyStorage=dirtyStorage)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fleet.py", line 131, in recalculateLinear
    self.squads[0].recalculateLinear(store, withBoosters=withBoosters, dirtyStorage=dirtyStorage)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fleet.py", line 179, in recalculateLinear
    store.set(self.leader, "squad", clearingUpdate=False)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fleet.py", line 251, in set
    if thing.item is None:
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\module.py", line 284, in item
    self.__fetchItemInfo()
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\module.py", line 99, in __fetchItemInfo
    self.__hardpoint = self.__calculateHardpoint(item)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\module.py", line 523, in __calculateHardpoint
    if effectName in item.effects:
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\attributes.py", line 233, in __get__
    return self.impl.get(instance_state(instance), dict_)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\attributes.py", line 579, in get
    value = self.callable_(state, passive)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\strategies.py", line 505, in _load_for_state
    return self._emit_lazyload(session, state, ident_key, passive)
  File "<string>", line 1, in <lambda>
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\strategies.py", line 567, in _emit_lazyload
    result = q.all()
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\query.py", line 2264, in all
    return list(self)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\loading.py", line 72, in instances
    rows = [process[0](row, None) for row in fetch]
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\loading.py", line 432, in _instance
    session_identity_map.add(state)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\identity.py", line 119, in add
    % (key, ))
AssertionError: A conflicting state is already present in the identity map for key (<class 'eos.gamedata.Effect'>, (29977, 4160))

Traceback (most recent call last):
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\threading.py", line 810, in __bootstrap_inner
    self.run()
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\gui\utils\exportHtml.py", line 152, in run
    dnaFit = sFit.exportDna(fit[0])
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\service\fit.py", line 727, in exportDna
    return Port.exportDna(fitID)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\service\port.py", line 624, in exportDna
    fit = sFit.getFit(fitID)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\service\fit.py", line 244, in getFit
    self.recalc(fit, withBoosters=True)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\service\fit.py", line 858, in recalc
    fit.calculateModifiedAttributes(withBoosters=withBoosters, dirtyStorage=self.dirtyFitIDs)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fit.py", line 279, in calculateModifiedAttributes
    self.gangBoosts = self.fleet.recalculateLinear(withBoosters=withBoosters, dirtyStorage=dirtyStorage)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fleet.py", line 63, in recalculateLinear
    self.wings[0].recalculateLinear(self.store, withBoosters=withBoosters, dirtyStorage=dirtyStorage)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fleet.py", line 131, in recalculateLinear
    self.squads[0].recalculateLinear(store, withBoosters=withBoosters, dirtyStorage=dirtyStorage)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fleet.py", line 178, in recalculateLinear
    self.leader.calculateModifiedAttributes(dirtyStorage=dirtyStorage)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fit.py", line 321, in calculateModifiedAttributes
    self.projectedDrones, self.projectedModules)
  File "C:/Users/Ryan/Dropbox/Git/blitzmann/Pyfa\eos\saveddata\fit.py", line 155, in projectedDrones
    return self.__projectedDrones
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\attributes.py", line 233, in __get__
    return self.impl.get(instance_state(instance), dict_)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\attributes.py", line 579, in get
    value = self.callable_(state, passive)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\strategies.py", line 505, in _load_for_state
    return self._emit_lazyload(session, state, ident_key, passive)
  File "<string>", line 1, in <lambda>
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\strategies.py", line 567, in _emit_lazyload
    result = q.all()
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\query.py", line 2264, in all
    return list(self)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\query.py", line 2376, in __iter__
    return self._execute_and_instances(context)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\orm\query.py", line 2391, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\engine\base.py", line 664, in execute
    return meth(self, multiparams, params)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\sql\elements.py", line 282, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\engine\base.py", line 761, in _execute_clauseelement
    compiled_sql, distilled_params
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\engine\base.py", line 828, in _execute_context
    None, None)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\engine\base.py", line 1023, in _handle_dbapi_exception
    exc_info
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\util\compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\engine\base.py", line 822, in _execute_context
    conn = self._revalidate_connection()
  File "C:\Users\Ryan\Dropbox\WinPython-32bit-2.7.6.2\python-2.7.6\lib\site-packages\sqlalchemy\engine\base.py", line 243, in _revalidate_connection
    raise exc.ResourceClosedError("This Connection is closed")
StatementError: This Connection is closed (original cause: ResourceClosedError: This Connection is closed) u'SELECT drones."groupID" AS "drones_groupID", drones."fitID" AS "drones_fitID", drones."itemID" AS "drones_itemID", drones.amount AS drones_amount, drones."amountActive" AS "drones_amountActive", drones.projected AS drones_projected \nFROM drones \nWHERE drones."fitID" = ? AND drones.projected = 1' [immutabledict({})]

@sydney-whittington
Copy link

Yeah, looks like disabling html export on the current release fixed the crashing on mine. It's a good workaround until we figure out what the problem is.

@blitzmann
Copy link
Collaborator

A little background on how the automatic HTML works:

You change a fit, it has a 1 second delay to handle "quick fitting" so that it doesn't start to run immediately after adding a module. Then it starts to process. This process can take a few seconds on large fit databases. If you change a fit again while it's still processing, it sends a flag to tell it to stop processing the current process and start over. This helps with timing and keeping the load on the database down.

I believe this is part of the reason for this crash. When we are looping through the fits, we must check to see if the stop flag has been set in the middle of the loop and, if so, exit out. However, there are a few loops in the HTML export code, and we need to be careful about where exactly we put this check. I think the crash happens when we try to change a fit at the same time as the export is trying to handle it, causing conflicts. Removing the 1 second delay causes these errors to pop up all the time when trying to fit things in quick succession.

The quickest, simplest fix would simply be to shove the entire bit of code into a try...except block and fail silently if we run into problems. This will mean that, most of the time, the export will be up to date, but for those occasions if we run into these exceptions it will skip the update. Considering that this isn't really an end of the world dilemma, I believe this is a good path to take.

@minuq
Copy link
Author

minuq commented Jun 10, 2014

This may solve the issue, if it's related to HTML export. Too bad my first video failed, but i had pyfa crash on me right after i loaded a fit without changing anything. I'll try to reproduce it and get a video of it.

@blitzmann
Copy link
Collaborator

So, pyfa has a FitChanged event that fires whenever a fit is changed. It basically lets pyfa know to recalculate the fit and update the stats pane.

Every time you add or remove a module/charge, this event fires. The fucntion that responds to this event also starts the automatic HTML export if enabled.

However, simply opening a fit also fires this event as a shortcut to calc the fit and update the stats. So I find it entirely possible that it crashed after simply opening the fit.

@blitzmann
Copy link
Collaborator

Whelp, still getting the crash. Different exception:

Unhandled exception at 0x76FC8E19 (ntdll.dll) in python.exe: 0xC0000005: Access violation writing location 0x00000014.

And more:
InterfaceError: (InterfaceError) Cursor needed to be reset because of commit/rollback and can no longer be fetched from. None None

@blitzmann
Copy link
Collaborator

I think I found the problem commit via bisect: fbc336b

The automatic HTML export doesn't necessarily cause the issue, rather it allows the issue to manifest. Seems the issue might stem from the porting of the import/export features from EOS to the service layer.

Since this is a somewhat hard problem to reproduce (can sometimes go 2-3 minutes of refitting without hitting it), I'm not 100% confident of the problematic commit, but it is somewhere to start

@blitzmann
Copy link
Collaborator

Can you guys try something?

In the pyfa directory, open up service/fit.py. Find the exportDna() function and replace the function with this:

def exportDna(self, fitID):
    fit = eos.db.getFit(fitID)
    return Port.exportDna(fit)

Please keep in mind proper indentation otherwise python will have a fit. Then open service/port.pyand find the exportDna() function in this file. Replace the function definition with def exportDna(fit): and then remove these two lines:

    sFit = service.Fit.getInstance()
    fit = sFit.getFit(fitID)

Obviously make sure automatic HTML export is enabled (please enable then close and reopen pyfa, otherwise the setting will not save if pyfa crashes). Then please see if you can reproduce. This seems to work for me, but I'd like confirmation from others.

@minuq
Copy link
Author

minuq commented Jun 11, 2014

Works fine for me so far (after i figured out you used space and not tabs :))

@neheran
Copy link

neheran commented Jun 11, 2014

Same here.

@blitzmann
Copy link
Collaborator

Excellent. I'll commit this fix and get ready for another release then.

@minuq
Copy link
Author

minuq commented Jun 11, 2014

I'd like to thank you for your fast and excellent support, keep up the good work!

@blitzmann
Copy link
Collaborator

My pleasure. I want pyfa to not crash as much as the next guy 😄

I'd like to thank you guys for going the extra mile with videos and local code changes upon my request. Really proved helpful.

As for the cause of this crash, and this is a best guess, but I think it stems from the HTML export thread trying to modify a location in memory that is controlled by the main thread. When I moved the import / export functions from the backend "eos" to the service layer, I must have allowed these two threads to cross using the same data - probably the fit object that it's trying to export. Threading is confusing and I've never really dealt with it much. But hopefully this fixes things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants