Author |
Topic: Strange crash (Read 914 times) |
|
sveinioslo
Developer
member is offline


Posts: 64
|
 |
Re: Strange crash
« Reply #2 on: Dec 13th, 2012, 1:33pm » |
|
> List Variables utility runs in a different, asynchronous, thread it can sometimes pick up data from the heap which is transiently invalid <
So, would this be related to invalid cache or critical section or ...?
This got me started on the assembler, i had been waiting for a reason to dig into the assembler stuff. More than 20 years since i did anything in assembler. I was thinking i would like to write a custom LVu with selectable variables + more. I started to read about critical section (MSDN), but that was a bit too much new info at once. So i started another 'first x86' project instead. Been thinking about this issue the past weeks.
If this is a critical section issue: When i write the custom LVu in assembler:
While running in/from ide, no issues.
While running in/from ide in a PROC and started from timerlib, no issues, timerlib takes care of critical section.
While running in/from ide and called directly from a modified timerlib, take care, if/when error in code, no way of stopping it ??
While running as a separat .exe ?? There were some info about how to enter critical section from an external process. But i guess it takes some time before i reach that level.
If it's not critical section issue, then ??.
Hope you have time for some info regarding this, i'll do my best to google the things i don't understand.
Svein
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Strange crash
« Reply #3 on: Dec 13th, 2012, 9:28pm » |
|
on Dec 13th, 2012, 1:33pm, sveinioslo wrote:| So, would this be related to invalid cache or critical section or ...? |
|
Neither really: it's because a string is represented by a 6-byte descriptor (a 4-byte pointer plus a 2-byte length) and there are no CPU instructions which perform 'atomic' operations on 6-byte blocks. Therefore any communication of a BBC BASIC string between one thread and another will inevitably involve two operations, and there's therefore a possibility that they won't be 'coherent' (in other words the 4-byte address and the 2-byte length won't belong to the same string).
Quote:| I was thinking i would like to write a custom LVu with selectable variables + more. |
|
There is already a 'custom' List Variables utility by Malcolm Marten ('List Variables Alternative'), described at the bottom of this Wiki page; I don't know whether that might be a better starting point:
http://bb4w.wikispaces.com/Tools+and+Utilities
Quote:| I started to read about critical section (MSDN), but that was a bit too much new info at once. |
|
A Critical Section would certainly be one solution, but that requires both ends to cooperate, and of course you have no way of modifying the BB4W interpreter to use a Critical Section 'at its end'. Indeed such a modification wouldn't be sensible, since it would impair the performance of the interpreter - which is a price too high to pay to fix a minor problem with a debugging tool.
Naturally I'll fix the List Variables crash if and when I release another version of BB4W, but I've no idea when that might be.
Richard.
|
|
Logged
|
|
|
|
sveinioslo
Developer
member is offline


Posts: 64
|
 |
Re: Strange crash
« Reply #4 on: Dec 14th, 2012, 12:25am » |
|
> 6-byte descriptor (a 4-byte pointer plus a 2-byte length) and there are no CPU instructions which perform 'atomic' operations on 6-byte blocks < Aah!, didn't think of that, very theoretical, yes.
> Naturally I'll fix the List Variables crash if and when <
I'm probably the only one running tests like that. Now that i know, i'm fine with it as it is.
> List Variables utility by Malcolm Marten <
Haven't tried it, but from the description, it is very far from what i have in mind. It is something i have wanted to do, but not without assembler. I could upload the running demo skeleton gui design idea, if you are curious.
Svein
|
|
Logged
|
|
|
|
|