Another external sigsegv problem lazarus / 39-Graphics ---------------------------------------------------------------------- Irvine · 2010-01-25 18:36 I have been doing a lot of Google-ing trying to find an answer to my problem and while there it does seem to be fairly common can't find anything that is directly applicable. I am running Lazarus on  Ubuntu and for the moment am trying to write some short routines that initialize  the image of an image box at runtime, then change the image  when the image box is right clicked. Here is the relevant code, it compiles okay but I get an "external sigsegv" exception when it runs. (occasionaly I get a 216 error on a second attempt at running.) QuoteProcedure Set_image; Begin     Form1.icon_map.GetBitmap(0, Form1.X1Y1.Picture.Bitmap); //external sigsegv      state := 'img1' end; procedure TForm1.X1Y1MouseUp(Sender: TObject; Button: TMouseButton;   Shift: TShiftState; X, Y: Integer); begin      If Button = mbRight Then        Begin            If state = 'img1'   Then               Begin                   Form1.icon_map.GetBitmap(1, Form1.X1Y1.Picture.Bitmap);                   state := 'img2'               end              Else               If state = 'img2'  Then                 Begin                     Form1.icon_map.GetBitmap(2, Form1.X1Y1.Picture.Bitmap);                     state := 'img3'                 end                 Else                   Begin                       Form1.icon_map.GetBitmap(0, Form1.X1Y1.Picture.Bitmap);                       state := 'img1'                   end        end; end;    I would be grateful if someone could help out with this, the breadth and variety of posted reasons for this error is astounding. ---------------------------------------------------------------------- Marc · 2010-01-25 19:25 What is Form1.icon_map and when is Set_image called Please give us a compilable example showing your problem. With the individual lines is nothing wrong. ---------------------------------------------------------------------- theo · 2010-01-25 19:28 It would be helpful if you told us what these cryptic names mean. I guess "icon_map" is a TImageList and "X1Y1" is a TImage, right? I cannot reproduce the problem in this case. What is your Lazarus Version and OS? When are you calling Set_image? SIGSEGV means the same as "access violation". It is rather unspecific, see: http://en.wikipedia.org/wiki/SIGSEGV EDIT: Sry Marc, you were faster ;-) ---------------------------------------------------------------------- Irvine · 2010-01-25 19:51 Thanks for responding, I kept on Google-ing and  managed to figure out what was wrong and was posting this  post as solved when you replied. Basically I was not initializing the Timage properly. I thought I was and it compiled okay, but..... For anyone else searching these forums the Wikipedia article on "external sigsegv errors" puts everything in the correct context and thus helps a lot. Also, just to finish:         "Form1.icon_map" is a TimageList         Set_image is  called by TForm1.FormCreate at form creation. That was the mistake I was making, I was trying to initialize it during the initialization section. (Okay, so I am stupid. but I learned Pascal a very long time ago and Objects really make me feel like a dinosaur.) Anyway, thank you for your prompt attention.