Possible problem with read()

From: Gerhard W. Gruber (sparhawk_at_gmx.at)
Date: 11/25/03


Date: Tue, 25 Nov 2003 21:08:13 +0100

On Tue, 25 Nov 2003 09:50:47 +0100 wrote mru@kth.se (Måns Rullgård) in
comp.os.linux.development.system with <yw1x4qws96hk.fsf@kth.se>

>Not it the first one has claimed some PCI device or something like
>that.

No. It just tried to load the config file. I don't know why it behaves like
this, but the flow goes like this

init_module()
   InitPICE()
      LoadConfig()
         ParseProfile()
            while(ReadFile());
         if(error)
            return errocode;
exit();

The funny thing is, that as you can see above ReadLine is fully contained in a
loop that loads the configuration data. The actual flow, as I can see in the
log is that LoadConfig() is called which in turn calls ParseProfile which will
use my version of ReadLine to return each individual line of the configfile.
ParseProfile is called as it is expected, but then it seems to return
prematuraly, goes back back with an errorcode to init_module which will exit.
and AFTER that I can see a lot of ReadLine function calls, which all fail
then. There are way to many Readline Traces in the log, there are currently
only about 4 lines in the config file, but I can see at least 20 or 30 and at
the end I can see some kernel crashdump.

Now I wonder why ReadLine is executed after the module is already unloaded.
Could this having something to do with that I use fp->read() and this gets
detached for some reason? It is the only thing that I could think of. But how
can I prevent this?
In your example (Kasper) I read that I only can read in a process context.
Could this be the problem? But then I wonder why the original code worked,
because it never seemd to have this problem.
I also don't see any logical differen between your code and mine. The only
difference I have is that I use a static buffer in the module, while you
allocate one with get_free_page. I checked the file and the open succeeds, so
this is not the issue.

-- 
Gerhard Gruber
Maintainer of
SoftICE for Linux - http://sourceforge.net/projects/pice
Fast application launcher - http://sourceforge.net/projects/launchmenu


Relevant Pages

  • Re: Pluggable Modules
    ... >properties file with plugins specified? ... obscure file somewhere he has to load into a text editor to edit ... themselves and update the config file. ...
    (comp.lang.java.programmer)
  • YAML config files with environment specific settings
    ... cod I'm able to load the file within my initializer and ... Since this setting is a server location that varies by environment, ... tried to use the by-environment structure and changed my config file to ... error: Uncaught exception: syntax error on line 1, ...
    (comp.lang.ruby)
  • XmlReader Question
    ... parses the config file many times and I do not want to load the config file ... The problem is I am using XMLReader because of speed and after I ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Urlscan with multiple .ini files?
    ... Just to confirm, you can load multiple instances of UrlScan, but they will ... instances will refer to the config file of the first loaded instance. ... > - config'd each ini so the logging is to separate locations ...
    (microsoft.public.inetserver.iis.security)
  • Re: Keyboard model under XFree86-4.3 on a ThinkpPad T40
    ... It doesn't load it, you do. ... You load it by editing the config file to ... say what keyboard you want, or you do it key by key with xmodmap. ... Then modify to taste with xmodmap. ...
    (comp.os.linux.portable)