Why I’m No Longer Vegan

Veganism has seen a generous increase of practitioners of its philosophy and diet over the following years, which has seen an increase in the number of vegan-friendly products on supermarkets and restaurants. However, while the philosophy of veganism is undeniably fantastic in its principles of respecting sentient life, there are a number of flaws within this 21st century urban diet.

Difficulty of Obtaining Essential Nutrients – Vitamin B12, Iodine and Selenium

Firstly, as the title suggests, I would like to mention that I did practice veganism for around a year or so for ethical reasons, however, unfortunately stopped due to the seer difficulty of getting essential nutrients without the use of excessive supplementation. I also began to show the signs of iodine deficiency.

This leads onto my first point, you can’t not get all the essential micro-nutrients which the body needs, and ones which can obtained are usually harder to obtain. For instance, there is no plant which contains active vitamin B12, and other essential nutrients such as iodine and selenium are usually only obtained from one or two plant sources. Iodine is usually only found in seaweed such as kelp and typically most people will not be able to easily obtain this from their local supermarkets, and thereby would have to resort to taking supplements. The same applies to selenium, another essential mineral which is only typically obtained from Brazil Nuts. These tend to be expensive and can be unaffordable for low income families; again, we need to resort to supplementation  in order to obtain this. The Vegan Society even recommends taking supplements for the aforementioned nutrients above due to their convenience, as well as, being the economical choice.

vegan supplements.jpg

Many vegans claim that veganism is a natural diet and is the optimal diet for humans, although, how can this be case when most people will be dependent on supplementation to obtain the missing nutrients? Even when I was following a vegan diet, I did not claim veganism to be the best diet for health, in fact, quite the opposite and stated that a pescetarian diet is the healthiest, which can be evidenced from the long life expectancy of Japanese people. There is a reason that no culture has fully adopted a vegan diet.

Are vegans healthier and can omnivores lack vitamin B12 too?

You may have read studies stating vegans typically have better health than vegetarians and omnivores, but this isn’t exactly true, since most vegetarians and vegans are generally more health conscious, and as a result, tend to exercise more regularly and consume less alcohol in comparison to the average omnivore. This leads to better overall health in the individual. Even when I was vegan, I would not state that consuming meat is unhealthy as such, it is the amount of meat which people tend to eat, which is far too much.

Some vegans claim that omnivores lack vitamin B12, and state that vitamin B12 is produced by bacteria typically found in the soil, therefore if we started to consume unwashed vegetables we would be to obtain vitamin B12 without the use of any animal products or supplements. It is true that vitamin B12 is solely produced by bacteria, although, it is important to note that we’re aren’t able to digest most raw vegetables sufficiently in order to gain the full nutritional benefits due to the evolution of our digestive systems. Our digestive systems are in a in-between state, while most of our diet should be plant-based, our digestive systems have evolved slightly to be able to process animal products such as meat. And yes, omnivores can lack vitamin B12, but this is typically due to underlying health problems and not diet.

Ostro-Veganism and Ostro-Vegetarianism

I do not agree with the treatment of animals in the dairy and egg industry, and tend to consume little diary or eggs in my diet. I typically only consume eggs twice a week and natural yogurt once or twice a week. I do drink fortified plant milks and aren’t against fortification of foods. Although, it is important to note that I am not dependent on supplements in order to obtain all the nutrients required for optimal health.

mussel farm

Recently, some people (including myself) have adopted ostro-veganism/vegetarianism which is the inclusion of non-sentient seafood such as mussels and oysters. Both of these foodstuffs contain the three essential nutrients which are difficult to obtain on a vegan diet, while being an excellent ethical and environmental choice. Mussels are typically farmed on long lengths of rope in the ocean and therefore have little impact on existing ecosystems. Most studies have suggested that bivalves actually help to cleanse the oceans and improve the water quality for other sea-life. More importantly, since bivalves have no central nervous system and do not have the ability to escape danger, it has been suggested that these organisms are incapable of feeling pain.

 

 

Advertisements
Posted in Ethics, Health | Leave a comment

Debugging Stop 0x17C – PDC_LOCK_WATCHDOG

Stop 0x17C is a very rare bugcheck which I have only come across on a handful of occasions, and therefore it can be quite daunting to debug, especially since there is almost no documentation.

The bugcheck appears to be caused by a synchronization issue, whereby a thread has held a lock for longer than the allocated time limit. I’m uncertain on what exactly a PDC lock is, and haven’t been able to find any useful information on it. However, judging by the context in which crash was occurring, I believe that I have been able to devise a suitable debugging methodology for this bugcheck.

Firstly, since the bugcheck appears to be occurring when the system was entering or leaving standby mode, I firstly dumped the power state information using the !poaction debugger extension.

0: kd> !poaction
PopAction: fffff80088166820
State..........: 0 - Idle
Updates........: 0
Action.........: None
Lightest State.: Unspecified
Flags..........: 10000003 QueryApps|UIAllowed
Irp minor......: ??
System State...: Unspecified
Hiber Context..: 0000000000000000

Allocated power irps (PopIrpList - fffff80088166ee0)
IRP: ffffd40e760c88a0 (wait-wake/S4), PDO: ffffd40e73f1c060
IRP: ffffd40e7525c940 (wait-wake/S4), PDO: ffffd40e75223620
IRP: ffffd40e75245940 (wait-wake/S4), PDO: ffffd40e75251060
IRP: ffffd40e752dfc10 (wait-wake/S4), PDO: ffffd40e75e14060
IRP: ffffd40e76f3ec10 (wait-wake/S4), PDO: ffffd40e75157050
IRP: ffffd40e753a1ab0 (wait-wake/S4), PDO: ffffd40e76eeda90
IRP: ffffd40e753e9010 (wait-wake/S4), PDO: ffffd40e7539a060
IRP: ffffd40e753908b0 (wait-wake/S4), PDO: ffffd40e75398060
IRP: ffffd40e753e48b0 (wait-wake/S4), PDO: ffffd40e7538f060
IRP: ffffd40e752bb010 (wait-wake/S4), PDO: ffffd40e7538e060
IRP: ffffd40e76f2ac10 (wait-wake/S4), PDO: ffffd40e76e84060
IRP: ffffd40e7558b740 (wait-wake/S4), PDO: ffffd40e75153050
IRP: ffffd40e752e1c10 (wait-wake/S4), PDO: ffffd40e76ea63c0
IRP: ffffd40e7b509700 (wait-wake/S4), PDO: ffffd40e76e98060

Irp worker threads (PopIrpThreadList - fffff80088165a10)
THREAD: ffffd40e710c1040 (static)
THREAD: ffffd40e710d7040 (static)

Broadcast in progress: FALSE

No Device State present

There appears to be number of power IRPs related to the S4 power state which is Hibernation mode. The system appears to be in the standby mode; this was implemented in Windows 8, and allows a system to instantly ‘wake’ from a sleep state.

Let’s examine one of these IRPs and see what type of I/O request is being issued.

0: kd> !irp ffffd40e760c88a0
Irp is active with 4 stacks 2 is current (= 0xffffd40e760c89b8)
No Mdl: No System Buffer: Thread 00000000: Irp stack trace.
cmd flg cl Device File Completion-Context
[N/A(0), N/A(0)]
0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000
>[IRP_MJ_POWER(16), IRP_MN_WAIT_WAKE(0)]
0 e1 ffffd40e73f2ce40 00000000 fffff80b8707f3e0-ffffd40e74a431a0 Success Error Cancel pending
\Driver\ACPI ndis!ndisWaitWakeIoCompletion
Args: 00000005 00000000 00000000 00000000
[IRP_MJ_POWER(16), IRP_MN_WAIT_WAKE(0)]
0 e0 ffffd40e74a43050 00000000 fffff80087f21890-ffffd40e73f50f00 Success Error Cancel
Page 35f36 not present in the dump file. Type ".hh dbgerr004" for details
Page 35f36 not present in the dump file. Type ".hh dbgerr004" for details
*** ERROR: Module load completed but symbols could not be loaded for e1d65x64.sys
\Driver\e1dexpress nt!PopRequestCompletion
Args: 00000005 00000000 00000000 00000000
[N/A(0), N/A(0)]
0 0 00000000 00000000 00000000-ffffd40e73f50f00

Args: 00000000 00000000 00000000 00000000[/code]

The major code for the IRP is 16, and therefore we know that we are dealing with a power management related request. The Minor code is 0, and as a result, we know that the I/O request is related to waking from a sleep power transition state. The parameter provided with IRP indicates the lowest power state in which the device can be awoken from. We can dump the enumeration values for system power states using the following:

0: kd> dt nt!_SYSTEM_POWER_STATE
PowerSystemUnspecified = 0n0
PowerSystemWorking = 0n1
PowerSystemSleeping1 = 0n2
PowerSystemSleeping2 = 0n3
PowerSystemSleeping3 = 0n4
PowerSystemHibernate = 0n5
PowerSystemShutdown = 0n6
PowerSystemMaximum = 0n7

We can see that the device is able to accept requests when it is in the hibernation power state.

The driver present in the IRP stack was related to Intel. I’ve chosen another IRP (ffffd40e753a1ab0), and this time it revealed that an Xbox driver was present with a time stamp of 2015. From my experience, Xbox drivers are usually unstable and tend to cause several BSODs, and thus could be a likely culprit for the crash. It is also important to note that the driver seemed to be network related too.

0: kd> lmvm mt7612US

start end module name
fffff80b`88c00000 fffff80b`88c61000 mt7612US (no symbols)
Loaded symbol image file: mt7612US.sys
Image path: \SystemRoot\System32\drivers\mt7612US.sys
Image name: mt7612US.sys
Timestamp: Wed Dec 9 06:44:11 2015 (5667CDBB)
CheckSum: 00062A42
ImageSize: 00061000
Translations: 0000.04b0 0000.04e4 0409.04b0 0409.04e4

Unfortunately, the OP hasn’t come to me regarded our suggestions of updating the driver, and thereby we can’t be certain how effective this debugging methodology will be for future dumps.

Posted in Uncategorized | Leave a comment

Debugging Stop 0xC4 – Pool Allocation Error

A Stop 0xC4 is thrown by Driver Verifier and is typically very easy to debug. However, I thought I would show a few aspects of the bugcheck which are useful for identifying how the crash occurred and how you can find this information using WinDbg.

There are three key parameters for a Stop 0xC4: the first parameter, third parameter and fourth parameter.

BugCheck C4, {2000, fffff80f5527b048, 0, 56706353}
Probably caused by : ScpVBus.sys ( ScpVBus+b048 )

The first parameter indicates that the caller of the function was expecting a non-executable pool allocation, however, was provided with a executable pool allocation instead. The third parameter provides the pool type for the allocation.

We can find the pool type enumeration values within the POOL_TYPE enumeration.

: kd> dt nt!_POOL_TYPE
   NonPagedPool = 0n0
   NonPagedPoolExecute = 0n0
   PagedPool = 0n1
   NonPagedPoolMustSucceed = 0n2
   DontUseThisType = 0n3
   NonPagedPoolCacheAligned = 0n4
   PagedPoolCacheAligned = 0n5
   NonPagedPoolCacheAlignedMustS = 0n6
   MaxPoolType = 0n7
   NonPagedPoolBase = 0n0
   NonPagedPoolBaseMustSucceed = 0n2
   NonPagedPoolBaseCacheAligned = 0n4
   NonPagedPoolBaseCacheAlignedMustS = 0n6
   NonPagedPoolSession = 0n32
   PagedPoolSession = 0n33
   NonPagedPoolMustSucceedSession = 0n34
   DontUseThisTypeSession = 0n35
   NonPagedPoolCacheAlignedSession = 0n36
   PagedPoolCacheAlignedSession = 0n37
   NonPagedPoolCacheAlignedMustSSession = 0n38
   NonPagedPoolNx = 0n512
   NonPagedPoolNxCacheAligned = 0n516
   NonPagedPoolSessionNx = 0n544

The fourth parameter contains the address of the pool tag. We can use the .formats command with the address to obtain the stored string and then reverse the string to provide the pool tag. This string can then be used with the !pooltag extension to provide the name of the driver. Although, it should be noted that the !pooltag extension will only provide definitions for drivers defined within the pooltag.txt file.

1: kd> .formats 56706353
Evaluate expression:
  Hex:     00000000`56706353
  Decimal: 1450206035
  Octal:   0000000000012634061523
  Binary:  00000000 00000000 00000000 00000000 01010110 01110000 01100011 01010011
  Chars:   ....VpcS
  Time:    Tue Dec 15 11:00:35 2015
  Float:   low 6.60773e+013 high 0
  Double:  7.16497e-315

The reverse of VpcS is ScpV.

1: kd> !pooltag ScpV
Pooltag ScpV
Description: Mass storage driver tags

It appears that the pool tag is a generic tag used for a wide range of mass storage devices.

Using the lmvm command with the driver from the bugcheck description, we can see that the driver which potentially caused the crash was related to a bus driver.

1: kd> lmvm ScpVBus
Browse full module list
start             end                 module name
fffff80f`55270000 fffff80f`5527e000   ScpVBus  T (no symbols)           
    Loaded symbol image file: ScpVBus.sys
    Image path: ScpVBus.sys
    Image name: ScpVBus.sys
    Browse all global symbols  functions  data
    Timestamp:        Sun May  5 14:31:26 2013 (5186CFAE)
    CheckSum:         00010BD7
    ImageSize:        0000E000
    Translations:     0000.04b0 0000.04e4 0409.04b0 0409.04e4
    Information from resource tables:

To be specific, the driver was a third-party bus driver related to Dual Shock 3.

In addition to this, we can use the second parameter as the return address to find who called the faulting instruction. Again, this appears to be point to our third-party bus driver.

1: kd> knL
 # Child-SP          RetAddr           Call Site
00 ffffd801`60fb70f8 fffff802`7bdf803f nt!KeBugCheckEx
01 ffffd801`60fb7100 fffff802`7b8d9cef nt!VerifierBugCheckIfAppropriate+0x6b
02 ffffd801`60fb7140 fffff802`7bdef8b0 nt!VfReportIssueWithOptions+0x103
03 ffffd801`60fb7190 fffff802`7be05b3a nt!VfCheckPoolType+0x90
04 ffffd801`60fb71d0 fffff80f`5527b048 nt!VerifierExInitializeNPagedLookasideList+0x5a
05 ffffd801`60fb7250 ffffa60f`94f55410 ScpVBus+0xb048
06 ffffd801`60fb7258 00000000`00000000 0xffffa60f`94f55410

Using the ub command on the return address we can see that the disassembly reveals several calls involving the ScpVBus.

1: kd> ub fffff80f`5527b048
ScpVBus+0xb027:
fffff80f`5527b027 53              push    rbx
fffff80f`5527b028 637056          movsxd  esi,dword ptr [rax+56h]
fffff80f`5527b02b 488d0d4ea3ffff  lea     rcx,[ScpVBus+0x5380 (fffff80f`55275380)]
fffff80f`5527b032 4533c9          xor     r9d,r9d
fffff80f`5527b035 4533c0          xor     r8d,r8d
fffff80f`5527b038 33d2            xor     edx,edx
fffff80f`5527b03a 48c740d818000000 mov     qword ptr [rax-28h],18h
fffff80f`5527b042 ff15d88fffff    call    qword ptr [ScpVBus+0x4020 (fffff80f`55274020)]
Posted in Uncategorized | Leave a comment

Release of WinDbg Preview for Windows 10

Microsoft have decided to release a new version of WinDbg with a new UI. The UI has been designed to provide WinDbg with a more contemporary appearance, and more importantly, provide easier access to some of the important features of WinDbg such as the Registers window and the Command output window.

WinDbg Preview – Dark Theme

I’ve only started to use the preview version of WinDbg today, however, I have noted that once a dump file has been loaded into the debugger, the last line of the call stack is also printed. In addition to this, you’re also now able to switch between a light and dark themed Windbg, which is a feature that I quite enjoy using, especially if you’re potentially using WinDbg for long periods of time.

The underlying engine is the exact same at the moment, and therefore all the usual extensions and commands will work with this version of WinDbg. Although, I feel that debugger is rather sluggish against its current counterpart, despite the fact, that Microsoft have stated it has been designed to be smoother!

For more details, please visit the following blog post on Debugging Tools for Windows, which also provides the download link for the debugger. Please note that Microsoft have made no intentions yet to release the preview version for other operating system builds such as Windows 7. Although, I suspect that further alterations will be made to this version of WinDbg in the future, which will hopefully allow backwards compatibility with earlier operating systems.

 

 

 

Posted in Debugging, WinDbg | Leave a comment

Some Notes on the Goldbach Conjecture

The Goldbach Conjecture is a very simple conjecture to understand providing you have some basic knowledge about primes. It is one of those conjectures which is very easy to comprehend, but fiendishly difficult to solve. It was first conceived during a letter written by Goldbach to Euler in 1742. There is currently a strong and weak version of the Goldbach Conjecture, with the weak conjecture actually being the original conjecture.

goldbach_conjectures

xkcd: Goldbach Conjectures

The original conjecture asks to prove that all positive integers greater than 2 are equivalent to the sum of three primes, the only problem with the original conjecture, is that Goldbach considered the unit “1” to be prime, which has now been dismissed in Mathematics. However, the conjecture has been restated by Euler to the following modern equivalent, which is known as the strong Goldbach Conjecture (sometimes referred to as the binary Goldbach Conjecture):

Strong Goldbach Conjecture: Every positive even integer greater than or equal to 4, can be expressed as the sum of two primes.

The conjecture can also be expressed using the totient function:

\phi (p) + \phi (q) = 2m,

where m is a positive integer and p and q are both prime numbers. The totient function can be defined as the following (p is prime):

\phi(p) = p - 1

The weaker version of the Goldbach conjecture asks a slightly different question, and is as follows:

Weak Goldbach Conjecture: Every odd integer greater than or equal to 9, can be expressed as the sum of three odd primes.

Similarly, Levy’s Conjecture claims that all odd integers greater than or equal to 7, can be expressed the sum of prime and twice a prime.

p + 2q = n, where n is a positive integer greater than or equal to 7, and p and q are both primes.

Goldbach Number:

Goldbach numbers are any positive even integers which are the sum of two odd primes.

Goldbach Partition:

The Goldbach Partition is the number of ways in which a positive even integer n, can be written as the sum of two primes. The function which produces these partitions is called the Goldbach Partition function G(n). It is defined in the following manner:

G(n) = #{(p, q) | n = p + q, p \le q}

 Methods for proving the Goldbach Conjecture:

The two most common methods which have been used for solving the Goldbach Conjecture involve the Hardy-Littlewood Method along with a number of different sieving methods which have been used to produce greater asymptotic bounds on the distribution of which natural numbers can be written as Goldbach Partitions.

References:

Goldbach Conjecture – Wolfram MathWorld

Goldbach Partition – Wolfram MathWorld

Goldbach Number – Wolfram MathWorld

On Partitions of Goldbach’s Conjecture (Woon)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted in Uncategorized | 1 Comment

Project Euler: Problem 29

Problem 29 is actually a very easy problem to solve, but I will not provide the direct code, however, instead will provide the answer to the problem along with some insight into how to solve the problem using Java or a similar programming language.

The solution for the problem is 9183.

There are three key constructs which you will need to include in your code, and these are:

  • Nested For-loop
  • Power function
  • A collection to hold the sequence of numbers generated from the power function.

If you use the above programming constructs within your problem, then you’ll the solution to the problem almost instantly. A important point to remember is to consider the size of the numbers which will be generated, and which data types will be able to hold such large numbers (integers won’t work!).

 

 

 

Posted in Uncategorized | Leave a comment

Understanding Atom Tables

Atom Tables have been a structure on Windows which I wanted to investigate for a while, but only have managed to find the time to write about now.

Atom Tables enable strings to be encoded by with a 16-bit integer (an atom) which can then be shared among different processes. The encoded strings stored within the table are then referred to as atom names. There is two forms of Atom Table: Global Atom Table defined for all processes on the system and Local Atom Table which is defined privately for process which created the table.

Following from this, there are two types of Atom; String Atoms and Integer Atoms. The type which I had mentioned in the first paragraph refers to String Atoms.

For a String Atom, a string is passed to GlobalAddAtom or AddAtom, either function then returns a 16-bit integer which can be used to access the string stored within the atom table. We can use the GlobalFindAtom or FindAtom functions to do so.

Properties of String Atoms:

  • The values returned are within the range of 0xC000 to 0xFFFF.
  • The string can be no longer than 255 bytes in size.
  • The reference count associated with each atom name, is incremented when the string is added to the table, and decremented when a string is removed from the table. The atom is only removed from the atom table when the atom name reference count has decremented to 0.

Properties of Integer Atoms:

  • The values given are within the range of 0x0001 to 0xBFFF.
  • There is no reference count or storage limitations associated.

The Atom Table has the following structure:

0: kd> dt _RTL_ATOM_TABLE
nt!_RTL_ATOM_TABLE
+0x000 Signature : Uint4B
+0x004 ReferenceCount : Int4B
+0x008 PushLock : _EX_PUSH_LOCK
+0x010 ExHandleTable : Ptr64 _HANDLE_TABLE
+0x018 Flags : Uint4B
+0x01c NumberOfBuckets : Uint4B
+0x020 Buckets : [1] Ptr64 _RTL_ATOM_TABLE_ENTRY

Each entry within the atom table is then represented with the following structure:

0: kd> dt _RTL_ATOM_TABLE_ENTRY
nt!_RTL_ATOM_TABLE_ENTRY
   +0x000 HashLink         : Ptr64 _RTL_ATOM_TABLE_ENTRY
   +0x008 HandleIndex      : Uint2B
   +0x00a Atom             : Uint2B
   +0x010 Reference        : _RTL_ATOM_TABLE_REFERENCE
   +0x028 NameLength       : UChar
   +0x02a Name             : [1] Wchar

You can dump a Local Atom Table with the !atom extension, and dump a Global Atom Table with the !gatom extension. Here is an example of !gatom:

6: kd> !gatom

Global atom table c00c( 1) = Protocols (18) pinned
c031( 1) = Button (12)
c042( 1) = msctls_updown32 (30)
c00d( 1) = Topics (12) pinned
c00e( 1) = Formats (14) pinned
c024( 1) = TaskbandHWND (24)
c04b( 1) = SysIPAddress32 (28)
c023(47) = OleEndPointID (26)
c04a( 1) = RichEdit20W (22)
c02b( 1) = _IDH_ALTTAB_STICKY_PREV (46)
c032( 1) = Static (12)
c02d( 1) = _IDH_WINALTTAB_PREV (38)
c045( 1) = SysTreeView32 (26)
c018( 1) = UxSubclassInfo (28) pinned
c03c( 1) = msctls_hotkey32 (30)
c044( 1) = tooltips_class32 (32)
c046( 1) = SysMonthCal32 (26)
c047( 1) = SysDateTimePick32 (34)
c007( 1) = StdShowItem (22) pinned
c053( 1) = ClipboardDataObjectInterface (56)
c011( 1) = True (8) pinned
c03f( 1) = SysListView32 (26)
c04c( 1) = UIAE{46a56456-04b6-4a08-a2bd-9a764fc58246} (84)
c010( 1) = EditEnvItems (24) pinned
c01c( 1) = PROGMAN (14)
c02a( 1) = _IDH_ALTTAB_STICKY_NEXT (46)
c04e( 1) = MozillaPluginWindowPropertyAssociation (76)
c012( 1) = False (10) pinned
c02c( 1) = _IDH_WINALTTAB_NEXT (38)
c03e( 1) = msctls_trackbar32 (34)
c015( 1) = Close (10) pinned
c021( 4) = AllowConsentToStealFocus (48)
c038( 1) = ToolbarWindow32 (30)
c04d( 2) = MSAA_*FCFFFFFF00000000 (44)
[...]

The first column is the entry within the atom table, the number represents the unique 16-bit decimal representation of the string assigned to that atom; I believe the second column is the the number entries within that bucket and the last column is the number of references. Atom Tables are based upon the Hash Table data structure.

References:

Posted in Computer Science, WinDbg, Windows Internals | Leave a comment