Skip to content

misconfigured remap.config causes unexpected crash #6301

Closed

Description

@duke8253

We're seeing this stack when remap config contains errors like the following (wrong plugin .so file name for the compression plugin, should be compress.so but the old gzip.so is used here):

map http://foo1.com/ http://foo2.com/ @plugin=conf_remap.so @pparam=/home/ats/conf_remap.config @plugin=gzip.so @pparam=/home/ats/gzip.config @plugin=cachekey.so @pparam=--uri-type=remap @pparam=--capture-prefix=/(.*):(.*)/$1/
#0  0x000000000063f1b1 in vol_init_data_internal (d=d@entry=0x2b306e104000) at ../../../../../../_vcs/trafficserver9/iocore/cache/Cache.cc:1139
#1  0x0000000000646e5d in vol_init_data (d=0x2b306e104000) at ../../../../../../_vcs/trafficserver9/iocore/cache/Cache.cc:1247
#2  Vol::init(char*, long, long, bool) () at ../../../../../../_vcs/trafficserver9/iocore/cache/Cache.cc:1247
#3  0x00000000006485f7 in Cache::open(bool, bool) () at ../../../../../../_vcs/trafficserver9/iocore/cache/Cache.cc:2089
#4  0x0000000000648c84 in CacheProcessor::diskInitialized (this=<optimized out>) at ../../../../../../_vcs/trafficserver9/iocore/cache/Cache.cc:835
#5  0x000000000065532e in CacheDisk::openDone (this=<optimized out>) at ../../../../../../_vcs/trafficserver9/iocore/cache/CacheDisk.cc:212
#6  0x000000000073c0d7 in handleEvent (data=0x2b305fdecf60, event=2, this=0x2b309989f900) at ../../../../../../_vcs/trafficserver9/iocore/eventsystem/I_Continuation.h:167
#7  handleEvent (data=0x2b305fdecf60, event=2, this=0x2b309989f900) at ../../../../../../_vcs/trafficserver9/iocore/eventsystem/I_Continuation.h:163
#8  EThread::process_event(Event*, int) () at ../../../../../../_vcs/trafficserver9/iocore/eventsystem/UnixEThread.cc:136
#9  0x000000000073cf5c in EThread::execute_regular (this=this@entry=0x2b3062f5bec0) at ../../../../../../_vcs/trafficserver9/iocore/eventsystem/UnixEThread.cc:249
#10 0x000000000073d386 in execute (this=0x2b3062f5bec0) at ../../../../../../_vcs/trafficserver9/iocore/eventsystem/UnixEThread.cc:338
#11 EThread::execute (this=0x2b3062f5bec0) at ../../../../../../_vcs/trafficserver9/iocore/eventsystem/UnixEThread.cc:316
#12 0x000000000073b669 in spawn_thread_internal (a=0x2b305fdc58c0) at ../../../../../../_vcs/trafficserver9/iocore/eventsystem/Thread.cc:92
#13 0x00002b305e0b8dd5 in start_thread () from /lib64/libpthread.so.0
#14 0x00002b305ededead in clone () from /lib64/libc.so.6

After reverting changes introduced in #6071 the problem went away.

Activity

  1. gtenev commented on Jan 7, 2020

    @gtenev
    Contributor

    Unfortunately I was unable to reproduce and wonder if more information is needed.
    Please find the setup and the steps I used below.

    ATS version: current 9.0.x (4a0b3c7)
    Tested on CentOS 7 and Mac OS X 10.15.2

    (Bad) configuration files:

    # cat etc/trafficserver/remap.config
    map http://foo1.com/ http://foo2.com/ \
        @plugin=conf_remap.so @pparam=conf_remap.config \
        @plugin=gzip.so @pparam=/home/ats/gzip.config \
        @plugin=cachekey.so @pparam=--uri-type=remap @pparam=--capture-prefix=/(.*):(.*)/$1/
    
    # cat etc/trafficserver/conf_remap.config
    CONFIG proxy.config.url_remap.pristine_host_hdr INT 1
    

    Started the traffic_server or traffic_manager with the bad config and got the expected "Fatal: remap.config failed to load" error but no crash/core/stack. Also tried starting the server with a good configuration containing compress.so and switching to a bad one containing gzip.so and then performed config reload but still could not reproduce.

    Any more info or ideas?

  2. randall commented on Jan 7, 2020

    @randall
    Contributor

    @duke8253 Was this from master or 9.0.x branch?

  3. duke8253 commented on Jan 7, 2020

    @duke8253
    ContributorAuthor

    This is on 9.0.x branch. We're testing 9.0.x internally and this crash started to happen after merging in that change, @shinrich might have some more information to share.

  4. zwoop commented on Feb 6, 2020

    @zwoop
    Contributor

    @gtenev Looks like we need to address this as well.

  5. gtenev commented on Feb 7, 2020

    @gtenev
    Contributor

    @zwoop, sure, unfortunately was not able to reproduce it on our side.

    Discussed ideas with @shinrich on slack. The issue seems to happen when a plugin is not found and ATS errors as expected and while exiting ATS crashed. Susan speculated that it might have something to do with huge disks and large remap.config.

    I picked one of our prod-spec machines with large disks and added even larger number of remap rules and still failed to reproduce with our internal ATSv9 build (may be the machine spec is not quite the same or there is a timing issue that I cannot hit).

    Since this is a problem only if the remap.config specifies a missing plugin during the initial start, I double checked the related code. I tried both starting and config reload (reloading heavily) still got the expected error and not the crash. Run ASAN and still no luck.

  6. duke8253 commented on Sep 27, 2021

    @duke8253
    ContributorAuthor

    Not seeing it anymore, closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions