Segfault when performing match on POSIXlt object

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Segfault when performing match on POSIXlt object

Marco Giuliano
Hi All,
I found a possible unexpected behavior when performing match/%in% on
POSIXlt objects, e.g. :

  d <- as.POSIXlt('2018-01-01')

  # match(<anything>,<POSIXlt>) --> segfault
  match(0,d)

  # consequently also this fails :
  0 %in% d

REPORTED ERROR ON LINUX:
   *** caught segfault ***
  address 0x16dc2, cause 'memory not mapped'

Verified on 3.5.0 on linux, 3.5.1 on Windows.

I think this could be a bug, since even if that match operation makes no
sense, the R session is not supposed to crash with segmentation fault, but
rather throw an exception.

Thanks in advance

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Segfault when performing match on POSIXlt object

Martin Maechler
>>>>> Marco Giuliano
>>>>>     on Fri, 31 Aug 2018 08:53:02 +0200 writes:

    > Hi All, I found a possible unexpected behavior when
    > performing match/%in% on POSIXlt objects, e.g. :

    >   d <- as.POSIXlt('2018-01-01')

    >   # match(<anything>,<POSIXlt>) --> segfault match(0,d)

    >   # consequently also this fails : 0 %in% d

    > REPORTED ERROR ON LINUX: *** caught segfault *** address
    > 0x16dc2, cause 'memory not mapped'

    > Verified on 3.5.0 on linux, 3.5.1 on Windows.

Confirmed (Linux, I think all version >= 3.4.0, but not in R
3.3.3 (or earlier, presumably).

Note the segfault happens inspite of the match_transform() utility
which explicitly checks for "POSIXlt" and the code comment which
says that "POSIXlt" should have been transformed to character,
but seems to fail in recent versions of R.

    > I think this could be a bug, since even if that match
    > operation makes no sense, the R session is not supposed to
    > crash with segmentation fault, but rather throw an
    > exception.

Definitely.  It is a bug.

    > Thanks in advance

Thank you for reporting!

Martin Maechler, ETH Zurich

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Segfault when performing match on POSIXlt object

Martin Maechler
>>>>> Martin Maechler  on Fri, 31 Aug 2018 16:00:07 +0200 writes:

>>>>> Marco Giuliano on Fri, 31 Aug 2018 08:53:02 +0200 writes:

    >> Hi All, I found a possible unexpected behavior when
    >> performing match/%in% on POSIXlt objects, e.g. :

    >> d <- as.POSIXlt('2018-01-01')

    >> # match(<anything>,<POSIXlt>) --> segfault match(0,d)

    >> # consequently also this fails :

    > 0 %in% d

    >> REPORTED ERROR ON LINUX: *** caught segfault *** address
    >> 0x16dc2, cause 'memory not mapped'

    >> Verified on 3.5.0 on linux, 3.5.1 on Windows.

    > Confirmed (Linux, I think all version >= 3.4.0, but not in
    > R 3.3.3 (or earlier, presumably).

ooops that was an offset error:

      Bug in all versions >= 3.3.3,
      but not in 3.2.5 (or earlier, presumably)

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Segfault when performing match on POSIXlt object

Marco Giuliano
Hi Martin,
should I file a formal bug report somewhere or you've already done it ?

On Fri, Aug 31, 2018 at 4:04 PM Martin Maechler <[hidden email]>
wrote:

> >>>>> Martin Maechler  on Fri, 31 Aug 2018 16:00:07 +0200 writes:
>
> >>>>> Marco Giuliano on Fri, 31 Aug 2018 08:53:02 +0200 writes:
>
>     >> Hi All, I found a possible unexpected behavior when
>     >> performing match/%in% on POSIXlt objects, e.g. :
>
>     >> d <- as.POSIXlt('2018-01-01')
>
>     >> # match(<anything>,<POSIXlt>) --> segfault match(0,d)
>
>     >> # consequently also this fails :
>
>     > 0 %in% d
>
>     >> REPORTED ERROR ON LINUX: *** caught segfault *** address
>     >> 0x16dc2, cause 'memory not mapped'
>
>     >> Verified on 3.5.0 on linux, 3.5.1 on Windows.
>
>     > Confirmed (Linux, I think all version >= 3.4.0, but not in
>     > R 3.3.3 (or earlier, presumably).
>
> ooops that was an offset error:
>
>       Bug in all versions >= 3.3.3,
>       but not in 3.2.5 (or earlier, presumably)
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Segfault when performing match on POSIXlt object

Martin Maechler
>>>>> Marco Giuliano
>>>>>     on Fri, 31 Aug 2018 16:50:56 +0200 writes:

    > Hi Martin, should I file a formal bug report somewhere or
    > you've already done it ?

No, I haven't,
and as I may not address this bug further myself (in the near
future), it may be best if you file a formal report.

I will create an account for you on R's bugzilla - you will be
notified and can update your initial pseudo-random password.

Best,
Martin

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Segfault when performing match on POSIXlt object

Marco Giuliano
Bug report submitted :
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17459
Thanks!

On Fri, Aug 31, 2018 at 6:48 PM Martin Maechler <[hidden email]>
wrote:

> >>>>> Marco Giuliano
> >>>>>     on Fri, 31 Aug 2018 16:50:56 +0200 writes:
>
>     > Hi Martin, should I file a formal bug report somewhere or
>     > you've already done it ?
>
> No, I haven't,
> and as I may not address this bug further myself (in the near
> future), it may be best if you file a formal report.
>
> I will create an account for you on R's bugzilla - you will be
> notified and can update your initial pseudo-random password.
>
> Best,
> Martin
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Segfault when performing match on POSIXlt object

Kurt Hornik-5
>>>>> Marco Giuliano writes:

Thanks.  Should be fixed in the trunk with c75224: will close the PR
after more testing.

Best
-k

> Bug report submitted :
> https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17459
> Thanks!

> On Fri, Aug 31, 2018 at 6:48 PM Martin Maechler <[hidden email]>
> wrote:

>> >>>>> Marco Giuliano
>> >>>>>     on Fri, 31 Aug 2018 16:50:56 +0200 writes:
>>
>> > Hi Martin, should I file a formal bug report somewhere or
>> > you've already done it ?
>>
>> No, I haven't,
>> and as I may not address this bug further myself (in the near
>> future), it may be best if you file a formal report.
>>
>> I will create an account for you on R's bugzilla - you will be
>> notified and can update your initial pseudo-random password.
>>
>> Best,
>> Martin
>>
>>

> [[alternative HTML version deleted]]

> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Segfault when performing match on POSIXlt object

Marco Giuliano
Thanks a lot !

Best,
Marco

On Sat, Sep 1, 2018 at 2:48 PM Kurt Hornik <[hidden email]> wrote:

> >>>>> Marco Giuliano writes:
>
> Thanks.  Should be fixed in the trunk with c75224: will close the PR
> after more testing.
>
> Best
> -k
>
> > Bug report submitted :
> > https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17459
> > Thanks!
>
> > On Fri, Aug 31, 2018 at 6:48 PM Martin Maechler <
> [hidden email]>
> > wrote:
>
> >> >>>>> Marco Giuliano
> >> >>>>>     on Fri, 31 Aug 2018 16:50:56 +0200 writes:
> >>
> >> > Hi Martin, should I file a formal bug report somewhere or
> >> > you've already done it ?
> >>
> >> No, I haven't,
> >> and as I may not address this bug further myself (in the near
> >> future), it may be best if you file a formal report.
> >>
> >> I will create an account for you on R's bugzilla - you will be
> >> notified and can update your initial pseudo-random password.
> >>
> >> Best,
> >> Martin
> >>
> >>
>
> >       [[alternative HTML version deleted]]
>
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel