Hi All,
Sorry to bother everyone again.Ofcourse  Prof Ripley ,Yihui and Uwe had
replied to my email.But this segmentation fault error was not solved.I agree
with Prof Ripley,as he said my R and all other configurations,are very
old.But what i don't understand is ,i was able to run analysis till few days
before,and why suddenly this error.

*The configuartions i use:---*

*R-version
*

*> version*

*               _*

*platform       i486-pc-linux-gnu*

*arch           i486*

*os             linux-gnu*

*system         i486, linux-gnu*

*status         Patched*

*major          2*

*minor          4.0*

*year           2006*

*month          11*

*day            25*

*svn rev        39997*

*language       R*

* *

*R-Package   Version  *

*DBI      "0.1-11" *

*RMySQL  "0.5-11"  *

* *

*MySQL version: 5.0.32*


*A small R- program* *also doesn't run now*,whereas with these same
configurations,i ran correlation analysis,regression analysis for my
datasets.

Now if i do this :---

*library(RMySQL)

myDbconnect<-function(dbName,hostName)
{
    print("myDbconnect print before driver")
    drv<-MySQL()
    #print(drv)
    print("myDbconnect print after driver")
    #con <- dbConnect(drv, user="xyz", password="xyz",dbname = dbName, host
= hostName)
    con<-dbConnect(drv)

    print("myDbconnect print after connecting the db")
    return(con)
}




main<-function()
{

     print("inside main")
     dbName<-"AHP2006"
    hostName<-"mia.foresightint.com"
    con<-myDbconnect(dbName,hostName)
     print("hello hello")
}

main()*

Before driver and after driver both the text inside print function are
printed.But in the dbconnect some error occurs.*I do not have access to the
packages,my seniors have that*.All i do is with the scripts.All i read about
segmentation fault is some faulty C-code in the packages.I think the problem
is with DBI package.Just wanted to know* other than any error in the
packages, can a segmentation fault happen*?Because i was not informed about
any changes made in the packages.Where am i going wrong?

*Error:---------------*

*> source("sample.R")
Loading required package: DBI
[1] "inside main"
[1] "myDbconnect print before driver"
[1] "myDbconnect print after driver"

 *** caught segfault ***
address 0x55, cause 'memory not mapped'

Traceback:
 1: .Call("RS_MySQL_newConnection", drvId, con.params, groups,
default.file,     PACKAGE = .MySQLPkgName)
 2: mysqlNewConnection(drv, ...)
 3: .class1(object)
 4: .class1(object)
 5: is(object, Cl)
 6: .valueClassTest(standardGeneric("dbConnect"), "DBIConnection",
"dbConnect")
 7: dbConnect(drv, user = "xyz", password = "xyz", dbname = dbName,     host
= hostName)
 8: myDbconnect(dbName, hostName)
 9: main()
10: eval.with.vis(expr, envir, enclos)
11: eval.with.vis(ei, envir)
12: source("sample.R")

Possible actions:
1: abort (with core dump)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:


*
I tried doing some debugging.But could not find a solution.
If i do back tracing :----

> *dbConnect*

standardGeneric for "dbConnect" defined from package "DBI"

  defined with value class: "DBIConnection"



function (drv, ...)

.valueClassTest(standardGeneric("dbConnect"), "DBIConnection",

    "dbConnect")

<environment: 0x839e7e0>

Methods may be defined for arguments: drv



> *methods:::.valueClassTest*

*function (object, classes, fname)*

*{*

*    if (length(classes) > 0) {*

*        for (Cl in classes) if (is(object, Cl))*

*            return(object)*

*        stop(gettextf("invalid value from generic function \"%s\", class
\"%s\", expected %s",*

*            fname, class(object), paste("\"", classes, "\"",*

*                sep = "", collapse = " or ")), domain = NA)*

*    }*

*    object*

*}*

*> mysqlNewConnection*

*function (drv, dbname = "", username = "", password = "", host = "",*

*    unix.socket = "", port = 0, client.flag = 0, groups = NULL,*

*    default.file = character(0))*

*{*

*    if (!isIdCurrent(drv))*

*        stop("expired manager")*

*    con.params <- as.character(c(username, password, host, dbname,*

*        unix.socket, port, client.flag))*

*    groups <- as.character(groups)*

*    if (length(default.file) == 1) {*

*        default.file <- file.path(dirname(default.file),
basename(default.file))*

*        if (!file.exists(default.file))*

*            stop(sprintf("mysql default file %s does not exist",*

*                default.file))*

*    }*

*    drvId <- as(drv, "integer")*

*    conId <- .Call("RS_MySQL_newConnection", drvId, con.params,*

*        groups, default.file, PACKAGE = .MySQLPkgName)
// here it gets stopped,traceback line 1*

*    new("MySQLConnection", Id = conId)*

*}*

-- 
Thanks in advance
Moumita

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to