Can not save any project or source file - access violation. lazarus / 13-General ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-03 20:08 Hello, I have the following setup: lazarus ide 1.2.6 fpc 2.6.4 ubuntu 14.04 LTS Have been trying to get started for two weeks, but no chance: any time I want so save anything, 'access violation'. Sudoing Lazarus doesn't help. There is a similar topic which is said to be Mint specific. Maybe it isn't? Thanks in advance - kriz ---------------------------------------------------------------------- BigChimp · 2014-11-04 08:23 Why would you sudo Lazarus? If you installed via the debs (or any way, really), you should run as a regular user. Is the directory where you try to save your project writeable for your user? ---------------------------------------------------------------------- Bart · 2014-11-04 12:27 What windowmanager are you using (Unity perhaps)? You can try to run lazarus in gdb an get a backtrace. Bart ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-05 21:34 Hi to both of you, ant thanks a lot! Unfortunately, I never even get to the point where I can decide which directory to save to: the moment I click 'save as' I get the 'access violation' - with the choice of either not to save or to quit Lazarus. I'll try to follow Bart's advise and run a gdp back trace. After two weeks exposure to Ubuntu that should be a piece of cake... For the installation, I followed this link: http://wiki.lazarus.freepascal.org/Lazarus_release_version_for_Ubuntu My window manager is Compiz. Thank you very much for your help! Kriz ---------------------------------------------------------------------- CM630 · 2014-11-06 09:40 Quote from: kriz_ze_kraut on November 03, 2014, 09:08:35 pmHave been trying to get started for two weeks, but no chance: any time I want so save anything, 'access violation'. Sudoing Lazarus doesn't help. 'access violation' does not sound to me like "file permission denied", but rather like "memory access violation". If so, sudo should not help. And as you have described, you cannot even get to the "Save as..." dialogue. Otherwise you could have tried to save on a FAT or NTFS file system (i.e. flash drive), though AFAIK you cannot execute binaries from a non-linux OS. Did you try to open another (existing) project and see if you can save changes? I can make an empty project for you. ---------------------------------------------------------------------- Bart · 2014-11-06 10:57 Does Menu->Project->Open project (which shows a fileOpenDialog) also crash? Bart ---------------------------------------------------------------------- minesadorada · 2014-11-06 11:29 Is this a UTF /Internationalization issue? ---------------------------------------------------------------------- BigChimp · 2014-11-06 11:39 @minesadorada: who knows? Let's first do some fault finding to find out what the problem is. Running lazarus under the debugger should give a good indication. ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-06 22:08 Hi to all of you! Does Menu->Project->Open project (which shows a fileOpenDialog) also crash? Not immediately - only when I try to save that project afterwards. The moment I click on 'Save As' I get the 'Access  Violation' and thereafter Laz hangs. It's got to be something about my installation, but first I installed ubuntu, and then (following the book) I installed Laz. I reinstalled once, but the results were exactly the same. The gdb back trace I can only do after the weekend. The disk filing system, btw., is standard - whatever Ubuntu uses for a first-time installation. Thanks a lot, and good knight! kriz ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-07 17:34 Hi to everybody! Finally, I de- and then re-installed, and it works now ('Hello World!'). I assume now that the trouble was due to the first de- installation being incomplete. I purged now everything using 'find', etc. For the installation, I followed the procedure on this link: http://wiki.lazarus.freepascal.org/Install_on_Ubuntu_from_.deb_files It seems that I still haven't understood the Wiki to an extend where I can locate the appropriate HowTo for exactly the current version. In any case, I am impressed by the readiness of you folks to help an absolute newbie! Kind regards - kriz ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-11 16:04 Hi everybody, it's working now and the bug is back: whenever the 'save as' dialogue opens with even the slightest problem (such as: the file to save exists already, etc.), then the response is always 'Access Violation'. Sometimes the system hangs then and has to be terminated, but most of the time I can proceed. Nevertheless, I have converted some 1500 lines of Delphi code so far and it is doing something. Not yet the real thing, but that will follow during the next couple of days, I am sure. Thank you all! If someone wants an error dump or some such thing on the above problem, I'd be very happy to provide! Best regards - Kriz ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-11 16:08 Hi everybody, it's working now and the bug is back: whenever the 'save as' dialogue opens with even the slightest problem (such as: the file to save exists already, etc.), then the response is always 'Access Violation'. Sometimes the system hangs then and has to be terminated, but most of the time I can proceed. Nevertheless, I have converted some 1500 lines of Delphi code and it is doing something. Not yet the real thing, but that will follow during the next couple of days, I am sure. Thank you all! If someone wants an error dump or some such thing on the above problem, I'd be very happy to provide! Best regards - Kriz ---------------------------------------------------------------------- BigChimp · 2014-11-11 16:45 Sorry to hear you're still having problems; glad you're persevering! As Bart suggested earlier, a gdb backtrace/stacktrace would be nice as it may give an idea where the problem is. BTW: you can set up a completely separate FPC+Lazarus trunk (development version) install if you want to, e.g. using the fpcup [1] tool (see wiki, note: I'm one of the authors). As all fixes go into trunk, it may be that the bug is solved for you... [1] http://wiki.lazarus.freepascal.org/fpcup ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-12 21:47 Maybe I have something better than a gdb trace: it now also happens in my own source code, the moment I open an opendialog. The message looks like this: Project taxes raised exception class 'External: SIGSEGV'. At address B7173926. I have traced it to this function in 'commondialog.inc'. It happens inside the '      Application.HandleMessage';  Code is at the bottom of this message. An earlier contributor had suggested, that the problem might be between my filing system and Lazarus. Ubuntu says ext3/ext4, but then, I also have an external 2T drive mounted. Ubuntu doesn't say anything about that guy's filing system, but I believe it is NTFS, since it has been hooked to a Windows machine before. I am going to disconnect that drive and see what happens. After that, it will be gdb resp. fpcup... Thanks a lot for your advice.  And good night - kriz function TCommonDialog.DoExecute : boolean; var   CanClose: boolean; begin   FCanCloseCalled := False;   if Assigned(FOnShow) then     FOnShow(Self);   TWSCommonDialogClass(WidgetSetClass).ShowModal(Self);   // can close was called from widgetset loop   if not FCanCloseCalled then   begin     repeat       if (FUserChoice <> mrNone) and (Handle<>0) then       begin         CanClose := True;         DoCanClose(CanClose);         if not CanClose then           FUserChoice:=mrNone;       end;       if FUserChoice <> mrNone then         break;       { win32 widgetset dialogs use their own message loop,         so only FUserChoice may have been set already }       Application.HandleMessage;     until false;   end;   Result := (FUserChoice = mrOk); end; ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-13 07:57 Hi everybody, removing a USB-drive and a stick on another server and then rebooting did not help. So it happens within the repeat loop of the code snippet that I posted last. Kind regards - Kriz ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-16 11:35 Hi to everyone, the 'access violation' is indeed a memory access violation, and it happens in the file open dialogs whenever some error is not trapped (such as trying to save or merely opening a directory with no write access rights), and it happens both under Windows and under Linux, and the first messages in forums date back to 2009. It happens both in the IDE itself and in programs that I wrote and compiled with the IDE. What can I do to help fixing these bugs? Kind regards - Kriz ---------------------------------------------------------------------- BigChimp · 2014-11-16 12:46 File open? Not file save? I'm getting confused... You could provide a gdb trace in a bug report (there may be an existing bug report). (run gdb lazarus, then run, then run Lazarus till you get the AV, then bt to get a backtrace/stacktrace see http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_GDB) If possible, make sure you use the latest stable Laz version (or Lazarus trunk/development version) ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-19 10:03 Hi there, attached is now a gdb trace of laz up to the bug, and also the terminal output. Since it was my first experience with gdb, it may not (yet) include all necessary information, but - hey! - there's no harm in trying! Best regards - Kriz ---------------------------------------------------------------------- stuartbloom · 2014-11-26 11:26 Hi there,I am having EXACTLY the same issue.  I am running Ubuntu in a Virtual Box; evertying runs OK until I try to open the save dialog. I have tried creating a gdb log, but when i run "gdb lazarus" I get "lazarus: No such file or directory" as the last line in gdb. Any assistance would be most gratefully accepted. Thanks in advance Stuart ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-26 13:07 Hi Stuart, this is what I did: the pgm you need to gdb is not lazarus but startlazarus. To find that, I used: find / -name startlazarus 2>/dev/null Once you found it, cd to that directory and then run 'gdb startlazarus'. I did that and submitted the result, but so far no answer. But you need not despair completely: The exception seems to happen whenever you open the dialog in a directory where you don't have write access. If you have created your application UNDER your home directory, the dialog will open in that directory and you are OK. However, if you then try to open parent directories until you have reached your home, then Laz will crash again. Once this exception has happened, Laz is dead and you need to kill and restart it. I am a newcomer to Linux und dabble just like yourself, but I have reasonable experience with Delphi. The bug that concerns us here initially put me off Laz completely, but since I  found how to work around it, I have already converted several Delphi programs to Laz  which I am now happily using daily under Ubuntu. ---------------------------------------------------------------------- Leledumbo · 2014-11-27 04:46 gdb-ing startlazarus won't allow you to get proper backtrace, since the process space is different (startlazarus simply starts lazarus). it's correct to gdb lazarus, just point to the correct location of lazarus binary. ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-27 08:05 Hi there, here is now what comes out when I 'gdb lazarus' (instead of 'gdb startlazarus'). I ran laz, then opened 'save as' in my home directory, and bingo - the last three lines of this trace say it all. This is particularly upsetting because it happens to newbies like myself: the moment you have installed Laz and you have looked at the example projects, when you hit 'save as' you have crashed Laz. (Because in the sample directory you don't have write rights). IMHO it shouldn't be too difficult to fix - especially since the rest of Lazarus seems to be quite a formidable package! What must I do to submit this as a bug? Best regards  -- Kriz chris@chris-linux:/usr/share/lazarus/1.2.6$ ls components                doceditor        languages     packager converter                 docs             lazarus       README.txt COPYING.GPL.txt           examples         lazarus.app   startlazarus COPYING.LGPL.txt          fpmake_add.inc   lazbuild      startlazarus.app COPYING.modifiedLGPL.txt  fpmake.pp        lcl           test COPYING.txt               fpmake_proc.inc  localize.bat  tools debian                    ide              localize.sh   units debugger                  images           Makefile designer                  install          Makefile.fpc chris@chris-linux:/usr/share/lazarus/1.2.6$ gdb lazarus GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from lazarus...(no debugging symbols found)...done. (gdb) run Starting program: /usr/share/lazarus/1.2.6/lazarus [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux- gnu/libthread_db.so.1". [New Thread 0xb69bdb40 (LWP 11394)] [New Thread 0xb5fffb40 (LWP 11395)] TMainIDE.ParseCmdLineOptions:   PrimaryConfigPath="/home/chris/.lazarus"   SecondaryConfigPath="/etc/lazarus" [New Thread 0xb525db40 (LWP 11396)] [New Thread 0xb48ffb40 (LWP 11397)] [New Thread 0xb40feb40 (LWP 11398)] Looking for code tools config file:  "/home/chris/.lazarus/codetoolsoptions.xml" NOTE: codetools config file not found - using defaults [Thread 0xb40feb40 (LWP 11398) exited] NOTE: help options config file not found - using defaults TLazSourceFileManager.OpenProjectFile select form in designer: Form1:TForm1 TDesigner [New Thread 0xb40feb40 (LWP 11400)] [New Thread 0xae592b40 (LWP 11401)] [New Thread 0xadbffb40 (LWP 11402)] [New Thread 0xad1ffb40 (LWP 11403)] [Thread 0xadbffb40 (LWP 11402) exited] [Thread 0xad1ffb40 (LWP 11403) exited] [Thread 0xb48ffb40 (LWP 11397) exited] [Thread 0xb40feb40 (LWP 11400) exited] [New Thread 0xb40feb40 (LWP 11404)] Program received signal SIGSEGV, Segmentation fault. 0xb7172926 in ?? () from /usr/lib/i386-linux-gnu/libpixman-1.so.0 (gdb) ---------------------------------------------------------------------- Leledumbo · 2014-11-27 08:18 Quote from: kriz_ze_kraut on November 27, 2014, 09:05:51 amWhat must I do to submit this as a bug? Still at (gdb) prompt, type 'bt' to get full backtrace. Make sure your lazarus is compiled with debug info (Tools->Configure Build Lazarus->Profile to Build->Choose Debug IDE), otherwise the backtrace won't be useful enough. Copy and send it to the bugtracker, explaining the problem. ---------------------------------------------------------------------- stuartbloom · 2014-11-27 09:13 kriz_ze_kraut Thank you very much.  Yeah, if I go to open a project in another folder, and then go to save, it work fine. Now I can get to play Thanks again Stuart ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-27 18:59 Hi to all of you, thank goodness there's a workaround!  Eventually I DID get Laz recompiled with debug options. However, once I get Laz to crash, there is no output in the terminal window. If the gdb trace is such an important tool, surely there is somewhere a description on how to produce it? Kind regards - Kriz ---------------------------------------------------------------------- kriz_ze_kraut · 2014-11-27 20:08 Hi all, I got through to the bugtracker, and it is known there: 0025920: OpenDialog crashes with EXTERNAL:SIGSEV and RunError (216) Priority=minor, which indeed it is once one knows the work-around. Good night - kriz