Check for stack corruption and if you are correctly loading the GDTR. Check out the example below.
;...
ldgt[GDTR]
;...
GDT:
;Null Descriptor
DW 0x00
DW 0x00
DB 0x00
DB 0x00
DB 0x00
DB 0x00
;System (Ring 0) Code Descriptor
DW 0xFFFF ;Limit (Lower 16 bits)
DW 0x0000 ;Base (Lower 16 bits)
DB 0x00 ;Base (Middle 8 bits)
DB 0x9A ;Present, Ring 0, Code, Non-Conforming, Readable
DB 0xCF ;Granularity, Big, 0, AVL, Limit (Upper 4 bits)
DB 0x00 ;Base (Upper 8 bits)
;System (Ring 0) Data Descriptor
DW 0xFFFF ;Limit (Lower 16 bits)
DW 0x0000 ;Base (Lower 16 bits)
DB 0x00 ;Base (Middle 8 bits)
DB 0x92 ;Present, Ring 0, Data, Expand-Up, Writable
DB 0xCF ;Granularity, Big, 0, AVL, Limit (Upper 4 bits)
DB 0x00 ;Base (Upper 8 bits)
.end:
GDTR: DW GDT.end - GDT - 1 ;Size of GDT (minus 1 byte)
DD GDT ;Location of GDT